Jump to content
  • Advertisement
Sign in to follow this  
jor1980

[SlimDx] device setlight

This topic is 3019 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 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
Advertisement
It sounds like you want the Device.EnableLight method. To "update" the light you just set it to the device again.

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
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!