Generate skybrush material
Generate a material for skybrushes and use it with the stencil buffer to prevent material system from rendering stuff over the skybox which would be normally culled by the BSP.
Fixes #1249.
For me it fixes plat23, but introduces a regression on Watah, viewpos -8657 3096 179 177 5:
This is a special map because it has two skyboxes. For now the material system always shows the red one, but that happens to be the correct one at that spot. It shouldn't look like a box though.
Hmm, so there are maps with more than 1 skybox. I think I know how to fix it in that case.
For me it fixes plat23, but introduces a regression on Watah, viewpos
-8657 3096 179 177 5:
This is a special map because it has two skyboxes. For now the material system always shows the red one, but that happens to be the correct one at that spot. It shouldn't look like a box though.
This is fixed now.
Hmm, so there are maps with more than 1 skybox. I think I know how to fix it in that case.
Another map with >1 skybox you may wish to test on is tremship.
Another map with >1 skybox you may wish to test on is tremship.
Thanks. It's still a bit broken there, but an improvement over what we had.
Great, now both of the skyboxes can be drawn depending on where you are.
The spot I screenshotted above isn't 100% fixed FWIW. If you look through at an oblique angle, you can see some movers floating in space. But maybe that just needs to wait for other entities to be migrated to the material system.
Yeah, I'm not sure yet what is causing that issue. On master though, you can see the whole room with those surfaces in that spot.
I fixed the above issue, but this fix seems to degrade performance considerably.
Something wrong here:
if ( environmentNoFogDraw && renderSkyBrushDepth ) {
renderSkyBrushDepth = true;
}
Ah, right, should be set to false. Still doesn't fix the performance issue however.
I have some ideas on how to fix this without decreasing performance, just need to correctly select which skybox to draw.
