Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Generate skybrush material

Open VReaperV opened this issue 1 year ago • 11 comments

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.

VReaperV avatar Sep 13 '24 23:09 VReaperV

For me it fixes plat23, but introduces a regression on Watah, viewpos -8657 3096 179 177 5:

unvanquished_2024-09-14_063550_000

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.

slipher avatar Sep 14 '24 11:09 slipher

Hmm, so there are maps with more than 1 skybox. I think I know how to fix it in that case.

VReaperV avatar Sep 14 '24 14:09 VReaperV

For me it fixes plat23, but introduces a regression on Watah, viewpos -8657 3096 179 177 5:

unvanquished_2024-09-14_063550_000

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.

VReaperV avatar Sep 14 '24 22:09 VReaperV

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.

cu-kai avatar Sep 14 '24 22:09 cu-kai

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.

VReaperV avatar Sep 15 '24 10:09 VReaperV

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.

slipher avatar Sep 15 '24 15:09 slipher

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.

VReaperV avatar Sep 15 '24 16:09 VReaperV

I fixed the above issue, but this fix seems to degrade performance considerably.

VReaperV avatar Sep 16 '24 21:09 VReaperV

Something wrong here:

	if ( environmentNoFogDraw && renderSkyBrushDepth ) {
		renderSkyBrushDepth = true;
	}

slipher avatar Sep 16 '24 21:09 slipher

Ah, right, should be set to false. Still doesn't fix the performance issue however.

VReaperV avatar Sep 16 '24 21:09 VReaperV

I have some ideas on how to fix this without decreasing performance, just need to correctly select which skybox to draw.

VReaperV avatar Sep 16 '24 21:09 VReaperV