Jump to content
  • Advertisement

Archived

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

Guest Anonymous Poster

d3dim directional lights question

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

Just a couple of ideas:

1) Are you using D3DVERTEX vertices? Lighting doesn't affect D3DLVERTEX structures (I think)
2) Are you setting the vertex normals?

--TheGoop

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
im using d3dvertex.
my ambient is set to the max for rgb and 0 for alpha.

could it be the material?

Share this post


Link to post
Share on other sites
Do other types of lights work correctly? If they do then you just have something for the directional light setup wrong. If not then something else is wrong. Put your code up somewhere so i can take a look at it.

Josh

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
what does the d3dlight7 dvDirection property do for directional lights? it doesn't seem to be doing anything for me. everything looks the same when the x y and z and different and not zero.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
its the like the d3dim lights sample
this is in b/w beginscene and endscene

LONG fTimeKey = timeGetTime();
FLOAT x = sinf( fTimeKey*2.000f );
FLOAT y = sinf( fTimeKey*2.246f );
FLOAT z = sinf( fTimeKey*2.640f );

// Set up the light structure
D3DLIGHT7 light;
ZeroMemory( &light, sizeof(light) );
light.dltType = D3DLIGHT_DIRECTIONAL;
light.dcvDiffuse.r = 0.5f + 0.5f * x;
light.dcvDiffuse.g = 0.5f + 0.5f * y;
light.dcvDiffuse.b = 0.5f + 0.5f * z;
light.dvDirection = D3DVECTOR( x, y, z );

pd3dDevice->SetLight( 0, &light );
pd3dDevice->LightEnable( 0, TRUE );

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!