Hello Christian, On 07/29/2014 04:21 PM, Christian Bar wrote: > In the meanwhile, I've discovered that the original shader actually works > with a directional light, but not with a point light. Otherwise, with my > modification it works with the point light, but not with the directional one. > > To make both lights work, I added after the line > " vec3 LightPosition = gl_LightSource[0].position.xyz;\n" > of the original shader the following lines: > " if(gl_LightSource[0].position.w != 0.0)\n" > " LightPosition -= vec3(gl_ModelViewMatrix * gl_Vertex);\n" > Also, in the fragment shader I added the light color to the fragment final > color calculation: > " color = clamp(gl_LightSource[0].diffuse.rgb * texcolor * basecolor * > intensity, 0.0, 1.0);\n" > Hope this makes sense to you :)
sorry for the delay. Those are nice improvements, thanks for sending them! Committed. Cheers, Carsten ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users