Skip to main content
gamedev.net
🔒 Locked

Mesh Lightning Problem

Started by sansured Nov 28, 2005 at 12:17 PM 2 replies 450+ views
Original Post
sansured
sansured
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.
Armadon
Armadon
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.
sansured
sansured
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 lightD3DXVECTOR4 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?
sansured
sansured
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 :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.