Sign in to follow this  
Narf the Mouse

[SlimDX] Exceedingly odd bug

Recommended Posts

Assume that all operations are done axis-aligned; I haven't tried rotating it.

The bug: If a box model/mesh (the current version of my game engine only uses boxes for models and collision, on the theory that, if it can handle boxes, it can theorically handle anything) is scaled along the Z (forward/back) axis by twice the Z distance between itself and the camera, (the mesh being "SlimDX.Direct3D9.Mesh.CreateBox(Device, 1F, 1F, 1F)"):

A) If the mesh is placed below the camera, the forward-left triangle on the top face of the mesh flickers; that is, flickers between being drawn and not being drawn (showing the background). The sides, front, back and bottom are not visible in this position.
B) If the mesh is placed above the camera, the back-right triangle on the bottom face of the mesh flickers; that is, flickers between being drawn and not being drawn (showing the background). The sides, front, back and top are not visible in this position.
A1 || B1) If the mesh is placed either to the left or to the right (along the X-axis) at minimum half of its width (such that one of its sides is precisely aligned along the camera's Z-axis) or more, the whole mesh appears to flicker; that is, flickers between being drawn and not being drawn (showing the background). If this minimum is not met, the conditions of A) and B) prevail.

Things I've done recently that might have resulted in this new bug: Upgraded to Windows 7 and DirectX10 (from Windows XP and DirectX9).

This happens with both my own lighting code and the DirectX/SlimDX default drawing routines (Vaguely possibly relevant Mesh.Draw() code):

[code]
if (display.HasDefaultLighting) // If a lighting Effect file is loaded;
{
display.GetLighting.SetValue<Matrix4x4>("World", World);
display.GetLighting.SetValue<Matrix4x4>("WorldRotation", new Matrix4x4(WorldOrientation));

display.GetLighting.BeginPass(0);
}
else // Else use DirectX/SlimDX's default drawing routines.
display.Device.SetTransform(TransformState.World, World);

for (int t = 0; t < textures.Length; ++t)
{
if (textures[t] != null)
display.Device.SetTexture(0, textures[t]);
mesh.DrawSubset(t);
}
if (display.HasDefaultLighting)
{
display.GetLighting.EndPass();
}
[/code]

This seems like it might be a known bug; is it? If so, what might cause it?
Is there any obvious place I should look for the cause of this bug?
Do you have any thoughts on this bug?

Thanks.

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