Search Forums
-
Your alpha test is wrong. Use these settings: device.RenderState.AlphaBlendEnable = true; device.RenderState.SourceBlend = Blend.SourceAlpha; ...
-
As a general rule, if your shader isn't working, go back to an older version that was working, and make smaller changes while making sure that it works after each change.If your shader never functioned, then you should be starting with a simple sample shader that works, and then modifying it towards what you want step by step as per above.This ...
-
Try these renderstates: // enable alpha blending device.RenderState.AlphaBlendEnable = true; device.RenderState.SourceBlend = ...
-
Quasar- Good clarification. I assumed that the normal would already be in the vertex format he was using, and the 0,0,1 value was provided as a reference.
-
Forever, or until another it is overwritten somewhere else.
-
Yep, converting to vectors and taking the cross product works as well. You don't actually need to normalize those vectors though. The result of the Sin/Cos pairs will be unit length anyways, and even if they weren't, it wouldn't affect the sign of the cross products z value.
-
Yes, you need to use GraphicsDevice.SetRenderTarget(...) methods.Just search for RenderTarget and you will find lots of samples.
-
Code looks clean and simple. Looks like your draw method potentially tests for frustum containment twice (if it's not contained) which seems unnecessary. Tests it once in a Draw method, then tests again in an overloaded call method.The real test of the code though, is does it work for you?Also, the box class seems to be a custom ...
-
first determine which turning direction will be the closer. This pseudo code should do it. What you're missing is some kind of code to account for the fact that 360 degrees wraps back to 0 and vice versa. float minDelta = 2; // minimum angle to bother turningfloat leftDelta = Angle - WantedAngle;if (leftDelta ...
-
In the content pipeline, there are helper methods to do it, but I'm guessing you're creating your height map at runtime.If you're normal map is applied to your heightmap always in the same x and y directions, then you really don't need to even use binormals/bitangents in your normal map shader.Imagine you have a standard height map like ...