if you construct yourself a base sphere out of a subdivided cube in a 3D DCC such as blender you'll be able to have a better mapping on it. A UV Sphere isn't great for this, yeah.
3D NoiseTexture for VisualShader
To sample the 3D noise properly, don't use the UV coordinates, but the model vertex coordinates as sample points. If use world space vertex coordinates, then the noise won't move with the planet (rotating, scaling, translating).
Yeah, that's a bit more complex but also more powerful/flexible way to go.
@Megalomaniak said: if you construct yourself a base sphere out of a subdivided cube in a 3D DCC such as blender you'll be able to have a better mapping on it. A UV Sphere isn't great for this, yeah.
Never would have thought of that. Thanks!
@SIsilicon28 said: To sample the 3D noise properly, don't use the UV coordinates, but the model vertex coordinates as sample points. If use world space vertex coordinates, then the noise won't move with the planet (rotating, scaling, translating).
I tried multiplying the vertex
input by the world transform but it was still behaving as if the vertices were defined in model space. (Also I recognize I should be using 3D noise here but this is a minimum example).
FYI I'm using the built-in SphereMesh and not the imported mesh from Blender.
If you try moving the sphere with that setup, you'll see what I mean.
Sorry I wasn't clear. With the above config, the texture is still behaving as if it is relative to the model space, i.e. when I move the camera the same part of the texture is always facing me.
Figured it out! After a bit of reading, vertices in fragment shader are in VIEW space. Camera is VIEW->WORLD matrix. Further multiply by INV(WORLD) got the vertices in MODEL space.
I also needed to do some extra work with the noise shaders in the ShaderV package. I noticed even with correct verts I was getting some strange texture stretching in the Z-axis. After investigation into the shader code, I noticed that even though it states 3D noise, it only uses the .xy coordinates of the input vector. Changing that to .xyz gave the desired effect.
Thanks everyone for the pointers!
Also one more follow-up, just discovered the TextureUniformTriplanar node. Didn't even know what triplanar mapping was but turns out to be exactly what I needed. Using a texture to generate the height map to generate the terrain instead of a 3D noise plugin has the added benefit of using the built-in normal map functionality Godot provides.
UnknownUser pls help me, im newbie and i dont know where and how can i change it from .xy coordinates to .xyz?