Jump to content
  • Advertisement
Sign in to follow this  
sansured

Mesh Lightning Problem

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

Hi everyone, I have a problem about mesh lightning.I am using .x files for meshs.Mesh lights are stable ı want to change it.I mean some sides of mesh are visible but others not, they are dark.I want to set the light to my look vector so all the sides of mesh can be visible. http://img165.imageshack.us/img165/8895/meshlightsproblem3sh.jpg This ss is show my problem i guess. Does anyone have any idea about solving my problem? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
From what I can see, in theory there is nothing wrong in that screenshot if the light is coming from the bottom as the light hits the bottom the other sides are darkened as would normally be the case.

If you want to set the light direction to your lookAt vector than you can do that using simple math. You could use a simple approach and position the light at the origin at the viewer and then cast a ray from the viewer using the lookAt vector and then use that resulting vector as the lights direction.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
Thanks for your answer but i can't set the light point.

I set the light like that in the code below.

[sourcecode]

g_pEffect->SetVector( "g_vDiffuse", (D3DXVECTOR4*)&g_pMaterials[nObjectnum].MatD3D.Diffuse );

// or

// Like that i try to set the coord of light

D3DXVECTOR4 vLighDir( vLightDir.x, vLightDir.y, vLightDir.z, 1.0f );

g_pEffect->SetVector( "lhtDir", & vLighDir );

[sourcecode]

But it is not working.Do you have any idea about it?

Share this post


Link to post
Share on other sites
I solved the problem.Thanks Armadon for your answer.
The problem was caused from my .fx file.
Thanks everyone who answer or read the post :)

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.

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!