MCPcopy Index your code
hub / github.com/ad-si/LuaCAD / renderDepthComplexitySamplingGoldfeather

Function renderDepthComplexitySamplingGoldfeather

OpenCSG/src/renderGoldfeather.cpp:566–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564 }
565
566 static void renderDepthComplexitySamplingGoldfeather(const std::vector<Primitive*>& primitives)
567 {
568 scissor = new ScissorMemo;
569
570 scissor->setIntersected(primitives);
571 scissor->setCurrent(primitives);
572 scissor->enableScissor();
573
574 unsigned int depthComplexity = OpenGL::calcMaxDepthComplexity(primitives, scissor->getIntersectedArea());
575
576 scissor->disableScissor();
577
578 for (unsigned int layer = 0; layer < depthComplexity; ++layer) {
579 if (channelMgr->request() == NoChannel) {
580 channelMgr->free();
581 channelMgr->request();
582 }
583
584 scissor->store(channelMgr->current());
585 scissor->enableScissor();
586
587 channelMgr->renderToChannel(true);
588
589 glStencilMask(OpenGL::stencilMask);
590 glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
591
592 glDepthFunc(GL_ALWAYS);
593 glDepthMask(GL_TRUE);
594 glColor4ub(255, 255, 255, 255);
595 OpenGL::renderLayer(layer, primitives);
596
597 glClear(GL_STENCIL_BUFFER_BIT);
598
599 parityTestAndDiscard(primitives, primitives, true, OpenGL::stencilMax);
600
601 channelMgr->store(channelMgr->current(), primitives, layer);
602
603 scissor->disableScissor();
604 }
605
606 channelMgr->free();
607
608 delete scissor;
609 }
610
611 static ChannelManagerForBatches* getChannelManager() {
612

Callers 1

renderGoldfeatherFunction · 0.85

Calls 12

calcMaxDepthComplexityFunction · 0.85
renderLayerFunction · 0.85
parityTestAndDiscardFunction · 0.85
setIntersectedMethod · 0.80
setCurrentMethod · 0.80
enableScissorMethod · 0.80
disableScissorMethod · 0.80
freeMethod · 0.80
currentMethod · 0.80
renderToChannelMethod · 0.80
requestMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected