Haven’t had too much luck so far - even though his shader code looks like to should be fairly simple to port.
Has anyone else tried this? Decals I would have thought comes up in most games, be it bullet holes, selection markers, or terrain details - but I haven’t seen an example Panda implementation.
I don’t think I’m calculating the depth properly. So trying a different way, and have come across an issue:
Is texpad_x available in GLSL?
AssertionError: Shader input texpad_depthmap is not present.
at line 496 of c:\buildslave\dev_sdk_win_i386\build\panda3d\panda\src\pgraph\shaderAttrib.cxx
:display:gsg:glgsg(error): at 3598 of c:\buildslave\dev_sdk_win_i386\build\panda3d\panda\src\glstuff\glGraphicsStateGuardian_src.cxx : invalid operation
I can get the decal projecting onto geometry, but the screensize needs to be square (FilterManager doing its thing with non-square resolutions). If texpad_ doesn’t seem to work in GLSL, is there an easy way I can calculate it and input that into the shader based on screensize?
My decal moves within the volume when the camera is translated. Spinning the camera in ok. I think its to do with the line : vec4 localPos = inv_modelview * worldPos; Is there a matrix I can use to offset this translation? I tried several that panda provides, but thinking I might need to calculate some sort of matrix python side and pass it to the shader?
If you want to transform something without taking the translation into account, set the fourth (.w) coordinate to 0 before multiplying it with the matrix.