scenenode debug render colors

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

scenenode debug render colors

Post by Seven »

I suggest that we allow the scenemanager to set the debug render colors similar to the way the 'normal debug render color' is set and retrieved.

SceneManager->getParameters()->getAttributeAsColor(DEBUG_NORMAL_COLOR);

could define coors for all debug rendering

Code: Select all

 
        if (DebugDataVisible & scene::EDS_BBOX_BUFFERS)
        {
            for (u32 g=0; g< m->getMeshBufferCount(); ++g)
            {
                const IMeshBuffer* mb = m->getMeshBuffer(g);
 
                if (Mesh->getMeshType() == EAMT_SKINNED)
                    driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
 
 
change this
                driver->draw3DBox(mb->getBoundingBox(), video::SColor(255,190,128,128));
to something like this
                driver->draw3DBox(mb->getBoundingBox(), SceneManager->getParameters()->getAttributeAsColor(DEBUG_BBOX_BUFFERS_COLOR));
            }
        }
 
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: scenenode debug render colors

Post by CuteAlien »

You are right, if we have one color as attribute the others should also have one. Only problem I have with that is that I'm not particularly happy with any use of attributes near drawing functions. Idea is basically speed doesn't matter for debug-functions and maybe that is ok, but those attributes are seriously slow :-( (using string-comparisons in code which can be called thousands of time per frame).
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
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: scenenode debug render colors

Post by MartinVee »

I always wondered myself why it isn't done with bitfields..?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: scenenode debug render colors

Post by CuteAlien »

The debug-checks are done with bitfields.
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
Post Reply