Archived

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

Confused about D3D's lighting model

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

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