GLSL Shaders - using 3d textures

   2055   1   1
User Avatar
Member
77 posts
Joined:
Offline
Hello,

I have successfully set up a GLSL shader that reads a texture from disk with texture2D(<textureparametername>, pos.yx).

I would now like to read a 3d texture but I am unsure if Houdini even supports this with its user end GLSL shader builder, or what file format that I need to use.

I have tried adding the following lines:

uniform sampler3D texture; //texture being the name of my parameter that points to a bgeo volume, image or whatever the correct input format is)
float test = texture3D(texture,pos.xyz);

I do not get any errors but I get a value of zero back, regardless of where I set the pos.xyz value.

Because it is error free, I am assuming the problem is one of two situations:

1. It is supported but I am not using the right file format. (I tried bgeo and a single tga, I even looked into i3d, God help me)
2. It is not supported and the error is ignored in Houdini itself.

My question is this: If it is supported, what format do I need to use? Also is there anything else I need to do differently?

Again, i have a working case of a texture2D sample of a tga file. Also, I made sure that the 3dViewport was set to gl 2.1, which is the version of the GLSL shader that I am working with.
Andrew Schneider | Principal FX Artist / Developer | Guerrilla Games
User Avatar
Member
77 posts
Joined:
Offline
When I try to read a 2dArray I get an error!

WARNING: Failed to bind variable ‘texture’

This makes me think that 2D arrays are supported but I do not know how to list them in the file path parameter.
Andrew Schneider | Principal FX Artist / Developer | Guerrilla Games
  • Quick Links