Jump to content
  • Advertisement
Sign in to follow this  
golgoth

Per pixel lighting!

This topic is 5021 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 m on the case of per pixel lighting! well everything goes fine until I want a move my light position... based on: http://www.ronfrazier.net/apparition/index.asp?appmain=research/per_pixel_lighting.html: here s my code: SNIP... Int i; Int l_vertexCount = in_primitive->GetVertexCount(); Float l_radius = 1.0f; Vector3 l_coords; Vector3 l_vertex; Vector3 l_origin = Vector3(0.0f, 1.0f, 3.0f); for (i = 0; i < l_vertexCount; ++i) { l_vertex = in_primitive->GetVertex(i); l_coords = (l_vertex - l_origin) / (l_radius * 2.0f); glMultiTexCoord2fvARB(GL_TEXTURE0_ARB, (Float*) &l_coords); glMultiTexCoord1fARB(GL_TEXTURE1_ARB, l_coords.z); } SNIP... the thing is, when playing with the l_radius the intesity of the light changes no problems... but... the l_origin should move the light but it doesn't... it always stick in the middle of what ever i m lighting... if rotating a mesh... the light rotate with it... and there s no way to change the light position... any ideas? THX

Share this post


Link to post
Share on other sites
Advertisement
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!