Jump to content
  • Advertisement

Archived

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

level10boy

Confused about D3D's lighting model

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

Advertisement
Guest Anonymous Poster
how do you change the shading thats being used?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
g_pD3DDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_GOURAUD);

Share this post


Link to post
Share on other sites
quote:
Original post by eng3d
.. and Phong. When?



By Phong I assume you mean Phong Shading. Phong Illumination has been in D3D for years.

Phong Shading is already possible. Use pixel shaders, there are samples on the relevent IHV websites. Better methods are also possible with pixel shaders.

Simple implementations of Phong Shading are even possible without pixel shaders using the DOTPRODUCT3 per pixel operation. i.e. you put the normals in as vertex colours (3 dimensional vectors = xyz==rgb) so that they get iterated across the face of the polygon. The light vector is passed in a constant such as TFACTOR and the DOTPRODUCT3 operation (L.N) takes place for ever pixel.


--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

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!