From e1d10f5b4a0b5b1bf7243fc26cd692f4d93764c8 Mon Sep 17 00:00:00 2001 From: DavidBluecame Date: Sat, 6 Feb 2016 16:33:00 +0100 Subject: [PATCH] Fix crash when using Textures with Windows or Normal coords and Caustic Photons When using Windows or Normal coordinates for textures, which are view-dependant, the mcintegrator Caustic Photons generation did not have the camera assigned, causing a crash. I've assigned a camera to the state before generating the Caustic Photons to avoid the crash. However, we have to consider that Photons are supposed to be view-independent, but when using textures with Window or Normal coordinates (which are view dependant), then the Photons WILL also be view dependant as well! So, using textures with "tricks" like Normal or Windows coordinates can cause low frequency noise in animations with Photons. --- src/yafraycore/mcintegrator.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/yafraycore/mcintegrator.cc b/src/yafraycore/mcintegrator.cc index dab9f168..86932d11 100644 --- a/src/yafraycore/mcintegrator.cc +++ b/src/yafraycore/mcintegrator.cc @@ -377,6 +377,7 @@ bool mcIntegrator_t::createCausticMap() surfacePoint_t sp1, sp2; surfacePoint_t *hit=&sp1, *hit2=&sp2; renderState_t state; + state.cam = scene->getCamera(); unsigned char userdata[USER_DATA_SIZE+7]; state.userdata = (void *)( &userdata[7] - ( ((size_t)&userdata[7])&7 ) ); // pad userdata to 8 bytes while(!done)