Page 1 of 1

scenenode debug render colors

Posted: Mon Feb 19, 2018 3:00 am
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));
            }
        }
 

Re: scenenode debug render colors

Posted: Mon Feb 19, 2018 11:16 am
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).

Re: scenenode debug render colors

Posted: Mon Feb 19, 2018 4:04 pm
by MartinVee
I always wondered myself why it isn't done with bitfields..?

Re: scenenode debug render colors

Posted: Mon Feb 19, 2018 11:32 pm
by CuteAlien
The debug-checks are done with bitfields.