How to use 3D Textures ? (Sampler3D)

panicqpanicq Posts: 67Member

Hey,

I'm trying to sample a 3D texture in godot shading language but cannot make it work.
I've generated a 3D noise texture using this tool: https://github.com/SIsilicon/Godot-Volumetrics-Plugin/tree/v1.0 (scroll to see the Texture3D tool)

I've added the .png extention and imported it as a 3D texture in the import section.

In my shader I'm simply using

return texture(noise3D, vec3(UV.xy, 0)).r;

And when changing the z value of the UV I'm not moving through the slices correctly...

Any thought on that as there is no documentation ?

Comments

  • panicqpanicq Posts: 67Member

    Ok, my mistake, I was not correctly importing the 3D texture (enabling repeat helps a lot and I realized that the slices where not matching with the texture my bad...)

  • MegalomaniakMegalomaniak Posts: 2,658Admin
    edited May 29

    @SIsilicon28 maybe create a wiki page on your repo and write up a intro tutorial/"how to use"?

    The current readme.md might be packing info too tightly together and makes it hard to digest for a newcomer?

  • panicqpanicq Posts: 67Member

    @Megalomaniak said:
    @SIsilicon28 maybe create a wiki page on your repo and write up a intro tutorial/"how to use"?

    The current readme.md might be packing info too tightly together and makes it hard to digest for a newcomer?

    Things to remember:

    • When saving the texture don't forget to add the .png extension
    • Setup the right vertical and horizontal slices in the Texture3D import settings (do not forget to note them when editing the texture in the Tool)
    • Restart Godot.
    • If the texture is locked and you can't reimport it, removing all dependencies wont work :( soltuion -> change the name of the texture in your OS file explorer and it will reimport.

    Cheers

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file