Lighting problems
Hi there
I have problems adding lights on my project. I have created a simple cube with different colors on the different sides. Very simple. And it works very well if I have set D3Ddev.RenderState.Lighting = False (my Direct3D device is called D3Ddev).
So I tried to set the Renderstate.Lighting to true. As expected, my object became black. So I added this:
D3Ddev.Lights(0).Type = LightType.Directional
D3Ddev.Lights(0).Diffuse = Color.White
D3Ddev.Lights(0).Direction = New Vector3(0.0F, 0.0F, 1.0F)
D3Ddev.Lights(0).Update() ' Commit()
D3Ddev.Lights(0).Enabled = True
But it still don't work. I believe I have misunderstood something, and that I must apply the light to something or...I don't know.
I have noticed that the D3Ddev.DeviceCaps.MaxActiveLights = 0.
Can anyone help me? I have VB.NET and DirectX 9c (december 2004). Does anyone have a VB.NET project that I can look at?
- theHollow
Split from http://www.xtremedotnettalk.com/showthread.php?t=72399
Hi there
I have problems adding lights on my project. I have created a simple cube with different colors on the different sides. Very simple. And it works very well if I have set D3Ddev.RenderState.Lighting = False (my Direct3D device is called D3Ddev).
So I tried to set the Renderstate.Lighting to true. As expected, my object became black. So I added this:
D3Ddev.Lights(0).Type = LightType.Directional
D3Ddev.Lights(0).Diffuse = Color.White
D3Ddev.Lights(0).Direction = New Vector3(0.0F, 0.0F, 1.0F)
D3Ddev.Lights(0).Update() ' Commit()
D3Ddev.Lights(0).Enabled = True
But it still don't work. I believe I have misunderstood something, and that I must apply the light to something or...I don't know.
I have noticed that the D3Ddev.DeviceCaps.MaxActiveLights = 0.
Can anyone help me? I have VB.NET and DirectX 9c (december 2004). Does anyone have a VB.NET project that I can look at?
- theHollow
Split from http://www.xtremedotnettalk.com/showthread.php?t=72399
Last edited: