Random Skybox Artifacts

Started by
3 comments, last by Stefan Fischlschweiger 9 years, 6 months ago

Hi,

I'm rendering a skybox by drawing 5 quads (front, back, left, right, top). This is Direct3D9.

This works when rendering to the backbuffer, as usual.

However, when I render a video, very strange problems occur. It looks as if one additional triangle is inserted.

Rendering a video from my application involves reloading the device and rendering to a rendertarget without presenting.

csb84zqhkqiuyr7mj.png

What I found out so far:
* the entire triangle has texture coordinates (0,0), and definitely belongs to the Skybox (same texture, same pixel shader)

* the triangle appears even if I just render one quad of the skybox. In that case, the triangle appears exactly opposite the quad. For example, if I render the "back" quad only, then the triangle appears in the front.

* The problem is sporadic - sometimes it just works, sometimes it doesn't.

* The debug runtime shows no problems, except an unrelated "Warning - device that was created without D3DCREATE_MULTITHREADED was accessed from a different thread". UPDATE: I solved that, and it made no difference. The skybox artifact still appears.

Does anybody have an idea what's wrong here? smile.png

Advertisement

Rendering a video from my application involves reloading the device and rendering to a rendertarget without presenting.

Could you elaborate on this? Are you using two cpu threads over the same device? (Also see into "shared device/require device")

It then can be the problem of putting instructions onto a device while it is being put instructions onto by different thread.

Rendering skybox involves multiple GPU commands, and those can combine in their order with commands from the other thread (that uses the device).

Anyway, if you use two threads, try "lock" keyword(C#), or other language keyword on the device variable, this will cause threading being not paralel but serial in case that during lock closure other threads will MOV over the device memory- and see if your problem gets solved by it.

Thanks, I have made the code single-threaded. However, the same problem appears so the problem must be somewhere else.

Any other ideas?

Then post your DrawIndexedPrimitve() call . (or unindexed version)

With this someone will more likely help you (seeing variables passed to drawindexprimitive and tracking their volatility possibly)

You could instead use a cube model with inverted normals for your skybox

This topic is closed to new replies.

Advertisement