Jump to content
  • Advertisement
Sign in to follow this  
codymanix

Using ambient light with bumpmapping (managed directX)

This topic is 4835 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 Iam using managed directX and want to do some bumpmapping. It looks fine so far but the problem is that ambient light is completely ignored so that the the side of my models which aren't facing the light is completely black: device.RenderState.Ambient = System.Drawing.Color.FromArgb(0x606060); int factor = VectorToRgba(Vector3.Normalize(viewV-planetV), 1.0f); device.RenderState.TextureFactor = factor; device.SetTexture(0, planet.BumpTexture); device.TextureState[0].TextureCoordinateIndex = 0; device.TextureState[0].ColorOperation = TextureOperation.DotProduct3; device.TextureState[0].ColorArgument1 = TextureArgument.Diffuse;//;TextureColor device.TextureState[0].ColorArgument2 = TextureArgument.TFactor; device.SetTexture(1, planet.Texture); device.TextureState[1].TextureCoordinateIndex = 0; device.TextureState[1].ColorOperation = TextureOperation.Modulate; device.TextureState[1].ColorArgument1 = TextureArgument.TextureColor; device.TextureState[1].ColorArgument2 = TextureArgument.Current;

Share this post


Link to post
Share on other sites
Advertisement
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!