Hei,
Currently doing a lot of shader chunk editing, and I had this idea:
“What if I were able to override the texture2DBias()
function?”
It’s used in basically all the different shader chunks to sample the different texture maps. Its also clearly a custom function since its not part of standard glsl. So being able to re-write this would allow for a consistent change to how all the texture maps of the materials are read. Meaning lots less work if say, you wanna do some funky changes to the texture tiling or something similar.
So I had a look through the PlayCanvas engine code and sure enough it looks like it’s defined in these three scripts:
I tried treating these as shader chunks overriding material.chunks.gles2PS
, material.chunks.gles3PS
and material.chunks.webgpuPS
. The compiler does not complain about these not being shader chunks, but neither does it seem to actually react to any changes I make to them.
Anyone got any ideas?