I would like to add a kind of moving sheen effect to a shader. One way I thought of doing it would be to use the clear coat layer reflecting a rotating environment map.
The material in the Playcanvas editor has no controls to rotate the environment, so I’m wondering whether there is any way to control that in a custom shader? Perhaps by rotating the normals in the environment lookup (although I haven’t found the code for that part of the standard material yet, so not sure if that would work.)
In other words: which shader chunk can I modify to play with the way the environment reflection happens in the clear coat section?
Right, I haven’t tried it before, but studying the engine source code what Yaustar proposes will work.
I think if the cubeMapRotationMatrix uniform is provided in your material as soon as material.update() is called the relevant shader chunk will be updated to use that rotation.
You can check here how to calculate the rotation matrix in your own script: