Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Simulating phong lighting with cubemapping

This topic is 5863 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

Hello, I want to render the specular highlights of sun on water with the phong lighting model. I will not use pixel&vertex shaders by now, but only cubemapping and texgen. Is this possible? My idea is this: Given V = viewpoint - waterpoint N = waternormal R = V reflected by N 1) precalculate a cubemap with the specular color for each possible R 2) use this cubemap in realtime to simulate phong lighting 3) calculate R using D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR (Dx 8) 4) backtransform R from camera to world space 5) access the cubemap with the world-space R to get the specular highlight Ok, the overall idea seem ok to me. But I''m not sure about the math behind the computation of R. I''ve always done phong lighting using (reflected light) dot (viewpoint-point) and now I want (reflected (viewpoint-point)) dot light. Is this the same? Also is all this calculus space-independent (as I hope)? Thank you guys! Stefano Lanza

Share this post

Link to post
Share on other sites

  • 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!