Page 1 of 1

Pass texture3d to shader

Posted: Mon Mar 19, 2007 11:25 am
by yv
I pass vertices (irr::video::S3DVertex ) to the shader engine. According to the docs, there is a way to specify a 2d texture coordinate (or possibly 2 coordinates) associated with the vertex and access these coordinates in the shader.

I would like to use texture3d() shader functionality.

Starting with generating a 3-dimensional texture and ending with passing vector3df texture coordinates to the shader engine, what is the method in irrlicht to do that?

Help much appreciated!

3d texture to shader

Posted: Tue Mar 20, 2007 12:36 pm
by yv
Ok. I think I can use the two texture coordinates and save xy in the first and z in the second in the vertex information and it gets correctly passed to the shader.

I was not able to find a way to pass a 3d texture (not a 2d texture) to the shader in irrlicht. Please help.

Thank you!

Posted: Tue Mar 20, 2007 2:50 pm
by TheC
You can pass two texture coords by using irr::video::S3DVertex2TCoords.

To get a 3D texture into your shader, you'll need to add the correct code to the driver you are using. Probably a DDS loader to load the 3D texture.