Hi there,

i have tried to change the uv for an triplanar texture to animate it. But the Documentation i have found seems not to be complete. We have weights and a pos(position i think) as input. My thoughts was that here the pos input should do the uv stuff. But there comes wierd results that looks like the texture is stretched. i only can see lines. Then i thought i can maybe go over the texture2d with a sampler input but than the triplanar size setting is no longer working. What did i miss or is this not possible in visual shaders?

triplanar only (works like i expected)

tried with the pos input

tried to work through a second texture (triplanar size settings are gone)

I am very thankful for every help or hint on this.

    kuligs2 I don’t know what you are talking about. When? Where?

      kuligs2 wait, didnt godot not remove the visual scripting thing?

      This is a VisualShader, not a visual script.

      dahasky I don’t know what you are talking about. When? Where?

      Godot used to have visual scripts. That's long gone.

        Tomcat thank you for the explanation . Didn’t know that.

        • Edited

        dahasky Just connect TextureParameterTriplanar node like you initially did, and in the inspector under Shader Parameters you'll be able to adjust/animate the offset/scale. This is a bit more convenient than using pos.

        If you want to use pos have in mind that the node expects object space pixel coordinate plugged here. Since vertex in the fragment shader is in view space, you'll need to transform it back to object space. You can do this by multiplying it with the inverse view matrix and then with the inverse model matrix. Add and/or multiply some vec3 uniform(s) to that and plug the result into pos.

        Alternatively you can send object space vertex from vertex to fragment shader via a varying.

          xyz Thank you. I have tried what you wrote. But it seems that i am not familar enough with visual shaders to do that. So i decided to change it into a "normal" shader. There these things are no Problem. I thought as a shader beginner i should try the visual stuff at first. Visual shaders seems to work on some stuff, on others not or i am to much a beginner 😃

          • xyz replied to this.

            dahasky By "normal shader" you mean standard material. Adjusting triplanar position/scale is the same for both (if you don't use pos). Both can be just set in the inspector.

              xyz yes, standard material to code the shader direct without the visual stuff. Now it works like i want.