Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Fix liquid shader compile error

Open VReaperV opened this issue 1 year ago • 5 comments

Reported by someone in-game.

VReaperV avatar Oct 20 '24 21:10 VReaperV

Why do we even have this file? It doesn't work at all so shouldn't we just nuke it?

slipher avatar Oct 20 '24 21:10 slipher

There's an issue for it: #850. It is used however, e. g. on map https://users.unvanquished.net/~sweet/pkg/map-citadel_0%2B0.dpk.

VReaperV avatar Oct 20 '24 21:10 VReaperV

It doesn't work at all so shouldn't we just nuke it?

It does sort of work, but there are some issues with it that need to be fixed.

VReaperV avatar Oct 22 '24 09:10 VReaperV

Why add a GLSL compile macro that's always enabled? The point of those is to build multiple variants of the shader.

Also it's possible that grid lighting or deluxe mapping are globally disabled.

slipher avatar Oct 22 '24 12:10 slipher

Why add a GLSL compile macro that's always enabled? The point of those is to build multiple variants of the shader. Also it's possible that grid lighting or deluxe mapping are globally disabled.

Well, it's required for ReadLightGrid() and ComputeDeluxeLight() to be available. Perhaps liquid shader should just be disabled if those aren't available.

VReaperV avatar Oct 22 '24 12:10 VReaperV

Well, it's required for ReadLightGrid() and ComputeDeluxeLight() to be available.

Could just write #define USE_GRID_LIGHTING or whatever in the liquid shader.

slipher avatar Oct 23 '24 06:10 slipher

I've changed this to actually check if lightgrid/deluxegrid are available. Otherwise it would probably break if the map lacks one.

VReaperV avatar Oct 23 '24 10:10 VReaperV

LGTM

slipher avatar Nov 07 '24 06:11 slipher