Lights in DirectX

Started by
3 comments, last by dustpuppy 21 years, 8 months ago
I have created a little graphics engine, that has a free roaming camera, frame, etc. When it comes to lights, I am getting a little stumped. The tiger.x and knot.x that come with the SDK in the media files refuse to light at all. I just get a black object on the screen. All the other .x files when loaded, light. I know that the tiger.x is a progressive mesh and I believe knot.x is as well. Does this have an impact on the lighting engine in DirectX?
Advertisement
Probably, tiger.x has no vertex normals. Try using D3DXComputeNormals.


My site
I have done that, but no joy. Still a textured but not lit object.
Apologies.

Didn''t bother testing whether D3DXComputeNormals actually succeeded. It didn''t.

Looking through the code for the progressive mesh example, it looks like the sample code plays around with FVF format when it clones a copy of the mesh.
After cloning the object and playing around with its FVF. tiger.x and knot.x now light correctly.

No offense to the SDK team, but the documentation for D3D does seem a trifle lacking, compared to the MSDN stuff that MS produces.

This topic is closed to new replies.

Advertisement