You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Batch of lightmapper fixes and minor improvements
- Fix objects with no material being considered as fully transparent by the lightmapper. - Added "environment_min_light" property: gives artistic control over the shadow color. - Fixed "Custom Color" environment mode, it was ignored before. - Added "interior" property to BakedLightmapData: controls whether dynamic capture objects receive environment light or not. - Automatically update dynamic capture objects when the capture data changes (also works for "energy" which used to require object movement to trigger the update). - Added "use_in_baked_light" property to GridMap: controls whether the GridMap will be included in BakedLightmap bakes. - Set "flush zero" and "denormal zero" mode for SSE2 instructions in the Embree raycaster. According to Embree docs it should give a performance improvement.
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
// From Embree.
|
||||
#include <math/vec2.h>
|
||||
#include <math/vec3.h>
|
||||
#include <xmmintrin.h>
|
||||
|
||||
using namespace embree;
|
||||
|
||||
@@ -185,12 +186,18 @@ void embree_error_handler(void *p_user_data, RTCError p_code, const char *p_str)
|
||||
}
|
||||
|
||||
LightmapRaycasterEmbree::LightmapRaycasterEmbree() {
|
||||
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
|
||||
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
|
||||
|
||||
embree_device = rtcNewDevice(nullptr);
|
||||
rtcSetDeviceErrorFunction(embree_device, &embree_error_handler, nullptr);
|
||||
embree_scene = rtcNewScene(embree_device);
|
||||
}
|
||||
|
||||
LightmapRaycasterEmbree::~LightmapRaycasterEmbree() {
|
||||
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_OFF);
|
||||
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_OFF);
|
||||
|
||||
if (embree_scene != nullptr)
|
||||
rtcReleaseScene(embree_scene);
|
||||
if (embree_device != nullptr)
|
||||
|
||||
Reference in New Issue
Block a user