Im a little bit lost, why is that the driver->drawMeshBuffer(mb);
takes place only in transparent pass, My inquiry is Where is the
draw method for the solid pass. since whether it is solid or
transparent pass both pass call the render of a scenenode.
Tnx.
Where is the draw method for the solid pass?
-
- Posts: 44
- Joined: Tue Jan 17, 2006 4:04 am
Where is the draw method for the solid pass?
Just part of irrlicht related project| CLEAR CODE NOTATIONS IS LARGELY SELF CODUMENTING!
There is a method that you can call on the scene manager to find out what pass is currently being rendered. See ISceneManager::getSceneNodeRenderPass().
Of course your scene node render method will only be called once for each render pass that it is registered. If you only register for rendering with the transparent pass, your scene node will only be rendered in the transparent pass. If you want to render as part of the solid pass and the transparent pass, you must call registerNodeForRendering() twice, once for each pass that you wish to register with.
Travis
Of course your scene node render method will only be called once for each render pass that it is registered. If you only register for rendering with the transparent pass, your scene node will only be rendered in the transparent pass. If you want to render as part of the solid pass and the transparent pass, you must call registerNodeForRendering() twice, once for each pass that you wish to register with.
Travis
-
- Posts: 44
- Joined: Tue Jan 17, 2006 4:04 am
Tnx vitek,
But "Where is the driver drawing method for the solid pass"
But "Where is the driver drawing method for the solid pass"
Code: Select all
//| THIS IS THE THE DRIVER DRAWING METHOD FOR
//| TRANSPARENT PASS e.g for Animatedmesh
//|
//| WHERE IS THE DRIVER DRAWING METHOD FOR SOLID PASS ?
//|
if( transparent == isTransparentPass )
{
scene::IMeshBuffer* mb = m->getMeshBuffer(i);
driver->setMaterial(Materials[i]);
driver->drawMeshBuffer(mb);
}
Just part of irrlicht related project| CLEAR CODE NOTATIONS IS LARGELY SELF CODUMENTING!
Yeah. You left out the most important lines in that function...
If the material renderer for that material type matches the pass type then it will be rendered. i.e. if this is the solid render pass and the material is a solid material type, or this is the transparent render pass and the material is a transparent type the buffer is rendered.
Code: Select all
bool isTransparentPass =
SceneManager->getSceneNodeRenderPass() == scene::ESNRP_TRANSPARENT;
for (s32 i=0; i<Mesh->getMeshBufferCount(); ++i)
{
video::IMaterialRenderer* rnd = driver->getMaterialRenderer(Materials[i].MaterialType);
bool transparent = (rnd && rnd->isTransparent());
// only render transparent buffer if this is the transparent render pass
// and solid only in solid pass
if (transparent == isTransparentPass)
{
scene::IMeshBuffer* mb = Mesh->getMeshBuffer(i);
driver->setMaterial(Materials[i]);
driver->drawMeshBuffer(mb);
}
}
-
- Posts: 44
- Joined: Tue Jan 17, 2006 4:04 am
I get it! from a piece of paper, lols .T.=.T. and .F.=.F.
it used by both passes. hehe for 5 yrs in xbase programming
this c++ fragments of codes gaves me a boolean mind bugs
it is always arise specially when your analizing the codes of other.
Thanks from both ov u guys, hybrid & vitek.
it used by both passes. hehe for 5 yrs in xbase programming
this c++ fragments of codes gaves me a boolean mind bugs
it is always arise specially when your analizing the codes of other.
Thanks from both ov u guys, hybrid & vitek.
Just part of irrlicht related project| CLEAR CODE NOTATIONS IS LARGELY SELF CODUMENTING!