Hi
I've been having some issues with graphical glitches.
I've loaded a model (.x file) which is a basic landscape and I use it instead of the playground model.
But when an active entity hits the model it creates a number of triangles (glitches) in different colors. Where are the triangles comming from and how do I get rid of them?
I've attached and image that shows the glitch in action.
Thanks for the help.
Strange graphic glitch
Strange graphic glitch
- Attachments
-
- glitch
- Graphics problem.jpg (45.34 KiB) Viewed 6193 times
Re: Strange graphic glitch
That's... very odd. Is this in the latest v0.9.0 using the default display systems? Did you notice any unusual collision behavior?
Re: Strange graphic glitch
I'm using the default display systems.
I've managed to track down the exact line that causes the problem.
In your playground demo you set the models worldmatrix by using this code:
group.worldMatrix = Matrix.CreateFromYawPitchRoll((float)Math.PI, 0, 0) * Matrix.CreateTranslation(0, -10, 0);
I changed that to (I wanted the model to be placed on the "ground"):
group.worldMatrix = Matrix.CreateFromYawPitchRoll((float)Math.PI, 0, 0) * Matrix.CreateTranslation(0, 0, 0);
This causes the glitch. If I change the value to anything else but 0 it works just fine.
However I do not think that this should cause any graphical glitches, it should just change the word matrix of the model right?
I've managed to track down the exact line that causes the problem.
In your playground demo you set the models worldmatrix by using this code:
group.worldMatrix = Matrix.CreateFromYawPitchRoll((float)Math.PI, 0, 0) * Matrix.CreateTranslation(0, -10, 0);
I changed that to (I wanted the model to be placed on the "ground"):
group.worldMatrix = Matrix.CreateFromYawPitchRoll((float)Math.PI, 0, 0) * Matrix.CreateTranslation(0, 0, 0);
This causes the glitch. If I change the value to anything else but 0 it works just fine.
However I do not think that this should cause any graphical glitches, it should just change the word matrix of the model right?
Re: Strange graphic glitch
That's correct, it shouldn't cause any issues. I can't seem to replicate it; have you seen it happen when using the default playground model?
The only thing I can think of that would cause the spontaneous creation of new triangles is if new entities are being added to the EntityDrawer. Try checking to see if there are any calls to EntityDrawer.addEntity/addDisplayObject after initialization. If you aren't observing any collision issues, it's unlikely that this is the cause but it's worth testing.
Have you tried forcing the EntityDrawer to use CPU instancing instead of shader instancing by passing in false for the third parameter to the EntityDrawer constructor (near the top of the startSimulation method)? Does it still happen?
The only thing I can think of that would cause the spontaneous creation of new triangles is if new entities are being added to the EntityDrawer. Try checking to see if there are any calls to EntityDrawer.addEntity/addDisplayObject after initialization. If you aren't observing any collision issues, it's unlikely that this is the cause but it's worth testing.
Have you tried forcing the EntityDrawer to use CPU instancing instead of shader instancing by passing in false for the third parameter to the EntityDrawer constructor (near the top of the startSimulation method)? Does it still happen?
Re: Strange graphic glitch
I've attached a .x file for you to try.
Replace your playground model with this one and see if you also get the glitches.
This is not a big issue for me since I've translated the model slightly to avoid the problem.
Replace your playground model with this one and see if you also get the glitches.
This is not a big issue for me since I've translated the model slightly to avoid the problem.
- Attachments
-
- test.zip
- (197.14 KiB) Downloaded 327 times
Re: Strange graphic glitch
Unfortunately no, the problem isn't replicated when I use that model.