Problem in managed D3D Lights

Started by
11 comments, last by Calin 17 years, 9 months ago
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.
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;
)

My project`s facebook page is “DreamLand Page”

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.
You can find informations about the Direct3D fixed function light system in the unmanaged documentation. The managed documenation is missing this informations.
I didnt get it, what should i do to set up the lights right..
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, …
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]
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:

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.
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!

-------!(>_<)!-------play some of my games!

This topic is closed to new replies.

Advertisement