Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Lighing problem [FIXED]

This topic is 3565 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a problem with my simple lighting in OpenGL-ES 2.0. The problem is that my rotation box is all black. Vertex Shader: vNormalWS = normalize( uWorldInvTranM * vec4(aNormal, 0.0) ).xyz; Fragment Shader: mediump vec3 lightDir = normalize(vLightTarget - vLightPos); float lightFac = max(0.0, -dot(vNormalWS, lightDir)); gl_FragColor = texture2D(sampler, vTexCoord) * lightFac; My cube is just black. If I donty multiply with the world inverse transpose matrix, one side is lighted (correct). But I rotate my box every frame, so the lighted side should switch. Please help me! --------------- EDIT: Fixed it, was a vertex bind that was fucked. [Edited by - SimonS on January 19, 2009 8:54:58 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!