Skip to content

Commit

Permalink
Fix crash when using Textures with Windows or Normal coords and Caust…
Browse files Browse the repository at this point in the history
…ic 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.
  • Loading branch information
DavidBluecame committed Feb 6, 2016
1 parent 76cd344 commit e1d10f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/yafraycore/mcintegrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e1d10f5

Please sign in to comment.