Pass texture3d to shader

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
yv
Posts: 34
Joined: Sun Aug 20, 2006 2:52 pm

Pass texture3d to shader

Post 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!
yv
Posts: 34
Joined: Sun Aug 20, 2006 2:52 pm

3d texture to shader

Post 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!
TheC
Posts: 93
Joined: Fri May 05, 2006 7:50 am

Post 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.
Post Reply