I have made a custom SceneNode (a 3 axis gizmo), and it's pretty much functional, however it's currently obscurred by the selected node that it's supposed to affect.
So, quick stupid question: How do you force a single node to be drawn on top of the whole scene (regardless of Z ordering)?
How do you draw an ISceneNode without Z information ?
Putting it into an own scenemanager (ISceneManager::createNewSceneManager) and resetting the z-buffer before drawing (IVideoDriver::clearZBuffer) that scenemanager could work.
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
Thanks for the idea. I didn't need a separate SceneManager, did this instead:
Works as intended.
Code: Select all
__AT_DRIVER->clearZBuffer();
for(u32 i = 0; i < 3; i++)
{
__AT_DRIVER->setMaterial(__AT_GIZMO->getAxis(i)->getMaterial(0));
__AT_GIZMO->getAxis(i)->render();
}
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Couldn't you just do:
Code: Select all
node->setMaterialFlag(EMF_ZBUFFER,false)
No, this would cause other objects no longer knowing about the node's depth, so every object rendered afterward would overwrite it. EMF_ZBUFFER is about writing in the z-buffer - so you rather want the opposite and fill the z-Buffer with information that this object is really in front. Could be there is also some other way to do this (using some projection matrix which puts the object closer to the camera but scales it smaller so it looks still the same might also work maybe), but I used so far always a second scenemanager for objects drawn in front of the usual scene.Lonesome Ducky wrote:Couldn't you just do:Code: Select all
node->setMaterialFlag(EMF_ZBUFFER,false)
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
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
I guess it depends if object you draw needs the z-information itself. If you can render it without z-buffer it's probably fine. But if it's the same kind of 3-axis-gizmo as in irrEdit then it might look messed up.
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