Hello, i made a wind shader using vertex colors from model to simulate wind on a tree, my shader works as intended until i rotate my model and see that the wind effect is tied to the model rotation, i search the Docs and i found that i need to put “world_vertex_coords” in render mode but after adding this to my shader if i move my model from world origin (0,0,0) its get distorted and the models location is out of place. Can someone can give me any idea on what i can do. My shader without the world_vertex_coords works but its rotating with the model, if using world_vertex_coords is not possible there is a way to get the model rotation in radians and subtract from the wind_direction (is in radians too)?
Thank you but i already tried that. VERTEX = (VIEW_MATRIX * vec4(trunk_vertex, 1.0)).xyz;
Using VIEW_MATRIX my model moves with the camera. I also tried using MODEL_VIEW_MATRIX, INV_VIEW_MATRIX but the result are worst.
I am thinking if there is a way to get the model rotation angle in degrees or radians in the Y axis and subtract it from the uniform wind_direction_radian_sway? if i can do this in gdshader i can adjust the wind direction.
Update: The correct way to transform any directional movement (like wind) from local space to world space (you can rotate the model using transform) is: