So today i found out that when i render the scene to a renderTargetCube then draw it as a reflection it required me to reverse the culling…
So nearly my entire scene from depth map to lighting and shadow, uses custom DrawUserIndexedPrimitives with polygons wound for counterclockwise culling.
When i render the scene to a rendertargetcube then map that to a sphere i get a funny look… so im staring and staring like what am i seeing then i realized its culled backwards ? I seperate the draw some more and flip on clockwise and sure enough it all looks normal again.
That has got to be one of the strangest bugs ive seen in a while.
How in the world does rendering to a reflection cube actually cause the culling direction to change when the view is at its center and the polygons are wound counter clockwise ?.
In the above image nearly everything uses counter clockwise winding other then the grid and a couple debug cube shaders. The primary exception is the reflection sphere nearly dead center it was rendered with the entire scene set to clockwise even though that is actually the backface of all these cubes and spheres shown and even the skybox.
I now just have one super nasty bug to squash well for the moment.
SpriteBatch destroys my depthbuffer and makes the shadow depth go haywire and turning it off doesn’t undo whatever it did.