weird rendering artefacts

A528d11e2590c45b74a53dadde386125
0
Xcrypt 101 Feb 22, 2012 at 00:38

Hey,

I’m getting some weird rendering artefacts but I have no idea what I might be doing wrong…
My engine is running on top of the Direct3D10 framework.

This is a cube being rotated with my engine:
http://i39.tinypic.com/14l0fah.jpg
The cube also flashes constantly (first white, then the cube colour, then white, and so on) in real-time (only while moving/rotating).

This is a sphere just standing still with my engine:
http://i44.tinypic.com/xfcjo8.jpg
The sphere is made up of around 1M vertices.
However, I also get (different) artefacts when the sphere is made of less vertices.

If anyone even has an idea what might be going wrong that would be really helpful,
I’ve been going over my code for some time, trying to change some things but no success…

2 Replies

Please log in or register to post a reply.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Feb 22, 2012 at 10:04

The cube looks like you are drawing both sides of each face.

The white bits are the other side (face pointing away from the camera) and are showing through because of z fighting.

A528d11e2590c45b74a53dadde386125
0
Xcrypt 101 Feb 22, 2012 at 12:00

it’s really nothing like z-fighting (I think) Give me some time, and I’ll upload a video

EDIT: I asked a teacher today, he found out that the problem was caused by a projection matrix (D3DXPerspectiveFovLH) in which I set the value for the near plane to 0.0f. This caused the artefacts because it divides by this number in a later stage.