Sign in to follow this  
codymanix

Using ambient light with bumpmapping (managed directX)

Recommended Posts

codymanix    132
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

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