Sign in to follow this  
jor1980

[SlimDx] device setlight

Recommended Posts

Hi i am having problems setting light for the device, i am doing an example in slimdx made for directx : device.RenderState.Lighting = True device.Lights(0).Type = LightType.Directional device.Lights(0).Diffuse = Color.White device.Lights(0).Direction = New Vector3(1, 1, -1) device.Lights(0).Update() device.Lights(0).Enabled = True i have translate this to slimdx but i don´t find the method update to update the light changes and then the method enabled, i have search in slimdx documentation to see if there are any similar method but i didn´t found it This is my code: Device.SetRenderState(RenderState.Lighting, True) Dim light As New Light light.Type = LightType.Directional light.Diffuse = Color.White light.Direction = New Vector3(1, 1, -1) Device.SetLight(0, light)

Share this post


Link to post
Share on other sites
Quote:
Original post by jpetrie
It sounds like you want the Device.EnableLight method. To "update" the light you just set it to the device again.


Thank´s that is what i wanted

anf if i want for example tow lights could be right the next:

Dim light As New Light
light.Type = LightType.Directional
light.Diffuse = Color.White
light.Direction = New Vector3(1, 1, -1)
Device.SetLight(0, light)
Device.EnableLight(0, True)

light.Type = LightType.Directional
light.Diffuse = Color.White
light.Direction = New Vector3(-1, -1, -1)
Device.SetLight(1, light)
Device.EnableLight(1, True)

Or i need to declare two lights:

Dim ligh1 as new light
Dim light2 as new light

and then set it to the device

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this