Why is Noise3D not working? It's fully black

Godot Version

v4.2.2.stable.official [15073afe3]

Question

So, I was following this nice tutorial about raymarching when the author suggested using a noise shader that he made himself in another video.
As I’ve been learning shaders for a couple of weeks, I wanted to put my skills to the test and, instead of coding a whole perlin noise shader, decided to use a sampler2D uniform to set a NoiseTexture with a FastNoiseLite in the inspector.
That works great, except that the Noise is limited to 2D and so the texture UV on the sphere looks warped.
Poking around the engine and searching the docs I found there are Texture3Ds and NoiseTexture3Ds. I decided to try and make it work using them but even after setting all the parameters in the inspector, it looks fully black.
I tried searching for this issue but I could find very little on very old threads about using Noise3D in code to generate volumetric fog.

So now I’m wondering if I’m using Noise3D incorrectly.
Here is a screenshot with the most relevant information:


On the right is a sphere that samples a Noise2D and on the left is the one that samples the Noise3D. Notice the inspector with the black Noise3D.

Thanks in advance to anyone who can help :smiley:

Here’s a post that, presumably, has a solution to your issue using VisualShader nodes.

The solution in that post is largely based on the use of this repository.

1 Like

Wow, that’s really useful!
I actually tried visual shaders before but I found they lacked common nodes like those.

Thank you, I’ll make good use of these :smile:

However, I still don’t know how 3D textures work so I’ll keep this up until someone can help.

If you need help understanding how to utilize 3D textures, I recommend:

  • Doing a quick google search
  • Searching on YouTube for shader tutorials regarding noise etc.
  • Opening a new topic on the forums

3D textures are just 2D textures with an extra dimension.