@Seyed Morteza Kamali solved his own problem of rotating a mesh cubemap with shadergraph here: How can I rotate cubemap in shadergraph?
However, I have a starry night cubemap inside my Skybox shader done in Unity Shader Graph, and as there is no way to directly attach a script to a Skybox material, I've been accessing the skybox material and the shader via external script. I've been using the Bolt visual scripting, and with this script, it is fairly easy to access other properties of the skybox but not the rotation (4x4 matrix). It is possible to access floats, vector2's, texture maps and even the Cubemap, but even if I have set the cubemap rotation, which to my knowledge has to be done with a Matrix 4, as an Exposed property, when trying to access it, e.g with FindPropertyIndex
it gives the value -1, indicating that the property is not found.
Edit: ok, I found this in the Unity documentation:
Matrix parameters are not exposed in the material inspector, but can be set and queried with SetMatrix and GetMatrix from scripts.
As far as I understand the documentation, the example assumes a mesh renderer, which the skybox doesn't have. Another idea would be to use 3 vectors, which could be exposed and then apply the rotation somehow to them at the same time, I did some tests in this, but all I managed to create was to distort the cubemap.
Again I am not trying to rotate the entire skybox, but just a cubemap inside the skybox shader – this would allow different rotations to daytime clouds and nighttime stars.
Would be best if everything could be done inside ShaderGraph, with the speed and axis values published as properties. A custom function perhaps? I am using URP 7.2.0 and Unity 2019.3.0f6.