Morgancentral99 / jmonkeyengine

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

Fix lighting shader #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
A recent change has caused the phong_lighting shader to incorrectly shade
surfaces. To try this, run any of the lighting demos, notice how the light
becomes brighter as the camera approaches the surface.

Original issue reported on code.google.com by ShadowIs...@gmail.com on 24 Jun 2009 at 11:33

GoogleCodeExporter commented 8 years ago

Original comment by ShadowIs...@gmail.com on 18 Jul 2009 at 4:02

GoogleCodeExporter commented 8 years ago
This issue has been fixed. The problem was that the phong_lighting.vert shader 
was
not writing to the varying variable wvPosition which is used by the fragment 
shader.
Adding the line:
wvPosition = (g_WorldViewMatrix * pos).xyz;

to the vertex shader fixed it.

Original comment by ShadowIs...@gmail.com on 12 Aug 2009 at 12:32

GoogleCodeExporter commented 8 years ago

Original comment by e.so...@gmail.com on 25 Mar 2010 at 9:13