how to transparent texture 3d model ( fade in fade out )
how to transparent texture 3d model ( fade in fade out )
how to transparent texture 3d model ( fade in fade out )
i can use in 2d image
but in 3d my texture model can t use
thankyou
________
JUSTIN BIEBER
i can use in 2d image
but in 3d my texture model can t use
thankyou
________
JUSTIN BIEBER
Last edited by koller202 on Thu Feb 17, 2011 1:09 am, edited 1 time in total.
how
sorry i can t do it
T_T
________
Dodge colt history
Code: Select all
void irr::scene::ISceneNode::setMaterialTexture ( u32 textureLayer,
video::ITexture * texture
) [inline]
T_T
________
Dodge colt history
Last edited by koller202 on Thu Feb 17, 2011 1:09 am, edited 1 time in total.
Then I'm terribly sorry but if with the tutorial, the documentation, the api and the search function you can't even get a basis working with which we could help you, then it's quie likelly you're trying something that is out of your league, at least for now. Pratice coding, read a lot on site like gamedev and forums like his one, try small things then try it out yourself THEN come for help with any problems ou might still have.
Good luck
Good luck
Look at video::SMaterial Class Reference. SMaterial have public atribute MaterialType. It can be se to type which suports alpha chanel of texture. EMT_TRANSPARENT_ALPHA_CHANNEL is one you are probably looking for.
To change material type of node, use ISceneNode function setMaterialType(video::E_MATERIAL_TYPE newType).
So your code will look something like:
Of course your texture have to have some transparency. Use png format to load transparent textures or use IVideoDriver::makeColorKeyTexture() function to make one from ordinary texture.
For fade in/ out effect EMT_TRANSPARENT_VERTEX_ALPHA might be more useful. In this material type vertex transparency is used to make node transparent. You need to get mesh buffer out of node then acces vertices and change their transparency one by one.
To change material type of node, use ISceneNode function setMaterialType(video::E_MATERIAL_TYPE newType).
So your code will look something like:
Code: Select all
yournode->setMaterialType(EMT_TRANSPARENT_ALPHA_CHANNEL);
For fade in/ out effect EMT_TRANSPARENT_VERTEX_ALPHA might be more useful. In this material type vertex transparency is used to make node transparent. You need to get mesh buffer out of node then acces vertices and change their transparency one by one.
- -
i did t mean this
(1) i want to use 1 texture in my node 3d and use fadein fadeout texture
(2) i mean this
(in 2d graphic ) i can set transpent in SColor(this,255,255,255)
variable this i can control transpent
but now i want control node transpent it myself
sorry i bad english thank you everyone
________
Toyota avalon (concept)
i did t mean this
(1) i want to use 1 texture in my node 3d and use fadein fadeout texture
(2) i mean this
Code: Select all
driver->draw2DImage(SPscreen, core::position2d<s32>(256,280),
rect<s32>(0,0,512,128), 0,
SColor(255,255,255,255), true);
variable this i can control transpent
but now i want control node transpent it myself
sorry i bad english thank you everyone
________
Toyota avalon (concept)
Last edited by koller202 on Thu Feb 17, 2011 1:09 am, edited 1 time in total.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Yes, but you have to change to the vertex alpha material first. Then you can use the setVertexColorAlpha meshmanipulator to change the alpha values of all vertices to the desired value. You can also use alpha_channel material and change the textures accordingly, but the former is usually faster.
The fastest version should be the shader based version, though. Search the snippets forum for it.
The fastest version should be the shader based version, though. Search the snippets forum for it.
Last edited by koller202 on Thu Feb 17, 2011 1:09 am, edited 1 time in total.
i can do it
thx
________
Marijuana indica
Code: Select all
scene::IMesh * mesh=smgr->getMesh("../../media/sydney.md2")->getMesh(0);
smgr->getMeshManipulator()->setVertexColors( mesh, video::SColor( 0, 20, 20, 20 ) );
scene::ISceneNode *Aqua = smgr->addMeshSceneNode(mesh);
Aqua->setMaterialFlag(video::EMF_LIGHTING, false);
// Aqua->setAutomaticCulling(false);
Aqua->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
Aqua->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA );
Aqua->setMaterialTexture(0, driver->getTexture("../../media/sydney.bmp"));
________
Marijuana indica
Last edited by koller202 on Thu Feb 17, 2011 1:09 am, edited 1 time in total.
u mean fade in fade out in mesh ?
smgr->getMeshManipulator()->setVertexColors( mesh, video::SColor( ****, *****, *****, ***** ) );
change in 255 is 100 % transparent 0 is 0 % transparent
________
Diets advice
smgr->getMeshManipulator()->setVertexColors( mesh, video::SColor( ****, *****, *****, ***** ) );
change in 255 is 100 % transparent 0 is 0 % transparent
________
Diets advice