Zaylyaev / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

bad world uniform values #497

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In com.jme3.renderer.RenderManager, in function updateUniformBindings.

TempVars is used to store the values passed to the uniforms. For matrices it's 
not a problem since the values are immediatly stored into a buffer. But 
uniforms don't copy the values of vectors, only refercences. So if the TempVars 
is reused before de shader is updated, the value may be overwriten.

It happens when using the ViewPort world binding with MultiPass lighting. The 
value passed to g_ViewPort is therefore equal to the direction of the light.

Original issue reported on code.google.com by amand.be...@gmail.com on 23 May 2012 at 11:09

GoogleCodeExporter commented 8 years ago
This seems like a legitimate and harmful issue. Marking as high priority for 
now.

Original comment by ShadowIs...@gmail.com on 1 Jun 2012 at 3:46

GoogleCodeExporter commented 8 years ago
Paul recommended adding a new setter that would, instead of storing the 
reference to the object, would copy the object onto the Uniform. It would work 
in this particular case and in the Material lighting method.

Original comment by ShadowIs...@gmail.com on 17 Jun 2012 at 10:37

GoogleCodeExporter commented 8 years ago
I have attempted to add the additional setter function to the uniform class and 
have failed. It seems more work than its worth to support two methods of 
setters. Instead there will be a new UniformBindingManager class that will have 
a single variable per UniformBinding that will be used to set the uniform.

Original comment by ShadowIs...@gmail.com on 9 Jul 2012 at 3:26

GoogleCodeExporter commented 8 years ago

Original comment by ShadowIs...@gmail.com on 11 Jul 2012 at 12:39