Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

I ran into this exact GLSL issue a few months back. Excuse the plug, but I wrote up my solution here, if you want something that's backwards compatible: https://coaldev.tumblr.com/post/170129777035/preprocessing-glsl-shaders

Since you're using C++, you may have an easier time implementing this.

I haven't done the replacement trick for now, though I was doing something similar in the LibGDX build and will eventually here again to consolidate constants between shaders and game code. Your write-up did help me get to a solution with macros for hardcoding array-access and branching to stick to a single sampler call each pass. I'm happy with that for now, I just need to check that it resolves the corruption issue in korpiroot's screenshot. It doesn't happen on any of my machines but I did see it on my roommate's computer so I can check on that.