This is really doing my head in.
My renderer is multi-threaded, but the renderer itself runs on a single core. Not on the main thread though.
At the start of a render pass I render an environment cube by rendering each face into a texture cube using SetRenderTarget(RenderTargetCube,CubeMapFace)
Then I render the sky, and all the other geometry is rendered by pass number.
Render environment map
I then use the rendered environment map as an input to a few shaders. Glass, water, ocean, etc.
Every shader that uses the environment map glitches. Every second or two it just goes horribly wrong.
It is driving me mad.
I wondered if my code was interfering with the graphics device on the main thread, but I have built in a profiler to my engine and even with a bunch of game objects , huge ocean, and sky .... it's not even reaching 4 mS .
I can also see my synchronisation is working well and I am not getting threading issues.
So ... lost.
Anyone have any ideas what I can try?
Extra info, just tried rendering the environment map once at the start of the run, and the glitch goes away.
Not a lot of use as a dynamic environment map though.