hide texture
Re: hide texture
I guess you mean, how to make a meshbuffer invisible. It would be nice if you could set the MaterialType to some invalid value, but I think this draws the meshbuffer black and probably writes to the depth buffer. So I think the only way is to write a do-nothing pixel shader. Like
Code: Select all
main() { discard; }
Re: hide texture
i have a cube ,i put a texture on it, I need this texture to be sometimes visible and invisible in other times (when the texture is invisible,the cube must still visible)
-
- Posts: 66
- Joined: Sat Sep 29, 2012 11:58 am
Re: hide texture
Use 2 shaders, one that use the cube's texture, other use some other colour to render the cube.
Change the shader of the cube whenever you need.
Change the shader of the cube whenever you need.
Re: hide texture
Easiest solution - replace the texture in the SMaterial by another. Slightly more complicated - as long as each side of your cube has it's own vertices you can change the vertex-alpha values with IMeshManiputator::setVertexColorAlpha as long as the material type is one that supports vertex alpha values, like EMT_TRANSPARENT_ADD_COLOR.
Shaders are another solution.
Shaders are another solution.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: hide texture
TRANSPARENT_ADD_COLOR doesn't use transparency at all. Pehaps you mean TRANSPARENT_VERTEX_ALPHA?
Re: hide texture
EMT_TRANSPARENT_ADD_COLOR also uses vertex alpha. EMT_TRANSPARENT_VERTEX_ALPHA works as well.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm