Jump to content
  • Advertisement
Sign in to follow this  
pnx

Problem with Ambient Lighting

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

Hey Everyone

I'm pretty new at spending time on DirectX so i worked my way through a tutorial and now i want to add some light to my scene.
The scene i want to create is a small camera sequence, with a camera being in the valley in the cubes and one light source cycling through the inner of the ring.
So at first i want to create a directional light to get light work in general.
But everything i do just does not work!
Maybe you can give me some hints!

Thats how the render works now in wireframe. When light is turned off all the cubes are totally white. So this is in wireframe that you can get the basic idea:
http://img819.imageshack.us/img819/241/screengd.png

Thank you!

Here is the code:

http://codepad.org/HtvnhImX

[Edited by - pnx on July 4, 2010 4:57:57 PM]

Share this post


Link to post
Share on other sites
Advertisement
It doesn't appear you set the material (dev->SetMaterial(...)) anywhere.

FYI, if you don't change the light or material parameters, you only need to set them once. You don't need to set them for each render.

EDIT: you don't show your vertex structure so it must be assumed you've set the vertex normals correctly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!