• Advertisement
Sign in to follow this  

Problem in managed D3D Lights

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

I have problem with lights in 3d.. I use managed direct3d using c#. I use directional light and it is too weak. I need to increase its intensity. So some one help me ASAP, thnx.

Share this post


Link to post
Share on other sites
Advertisement
In what way it's weak?
The light has some properties like Range and Attenuation, these affect the intensity of your directional light.
It's highly possible though that you need some Ambient light in your scene.

(i.e.
_device.Lights[1].Ambient = Color.FromArgb(150,150,150);
_device.Lights[1].Enabled = true;
)

Share this post


Link to post
Share on other sites
Thnx for response, but the problem is still unsolved... i think i have a problem in ambient light, i added the code you gave me in previous post

device.Lights[1].Ambient = Color.FromArgb(150,150,150);
device.Lights[1].Enabled = true;

and it just did nothing, and i am enabling device.RenderState.Lighting=true;
if there is a solution to this problem tell me..

or tell me how to deal with attenuation cause i dont understand attenation0,attenation1,attenation2 means and what is the relationship between them and Range... waiting for response ASAP, thnx.

Share this post


Link to post
Share on other sites
Light intensity depends on more than just the lights. That was the reason why I post the link to the documentation. Could you please provide us some more of your code? Like your material setup, your vertex format, …

Share this post


Link to post
Share on other sites
Any chance of a screenshot of the current lighting? You can embed it into the post using the html <img> tag. It would make it a lot easier to see whats wrong and help you. [smile]

Share this post


Link to post
Share on other sites
My vertex format is position normal textured format, and my material is:

Material m = new Material();
m.Diffuse = Color.FromArgb(255,255,255);

I use it in all drawings and i use drawsubset(...) in the mesh..

An image of the scene:

Share this post


Link to post
Share on other sites
Your materials have a diffuse color but your light emits only ambient light to the scene. You should give your material an ambient color or add an diffuse part to your light.

Share this post


Link to post
Share on other sites
I had a similar problem with my lights seeming too weak. Nothing I changed seemed to make any difference, that is until I added this line in my setup:

device.RenderState.NormalizeNormals = true;

As soon as I did this the lights were working perfect!

Share this post


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

  • Advertisement