semi transparent water

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
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

semi transparent water

Post by pera »

i know how to make water scene node, but i would like it to be semi transparent.
if i do like this, I lose reflection effect:

ISceneNode* node = m_EditorManager->getSceneMngr()->addWaterSurfaceSceneNode(mesh->getMesh(0), 0.5f, 400.0f, 10.0f, 0, m_EditorManager->m_ID);
node->setMaterialTexture(0, m_EditorManager->getDriver()->getTexture("media/stones.jpg"));
node->setMaterialTexture(1, m_EditorManager->getDriver()->getTexture("media/water.jpg"));
node->setMaterialType(video::EMT_REFLECTION_2_LAYER);
node->setMaterialType(EMT_TRANSPARENT_ADD_COLOR);
node->setName("Water Surface");

also, how to set transparency level?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: semi transparent water

Post by hybrid »

You cannot set two material types 'on top' of each other. If you need a different effect, you either have to create multiple meshes or define your own material, which needs low-level implementations, though.
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Re: semi transparent water

Post by pera »

and how to set transparency level?

and don't you think its good idea to have transparent water surface?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: semi transparent water

Post by hendu »

If you need more complex things than the base materials provide, you should use a shader.
Post Reply