| 48 | }; |
| 49 | |
| 50 | void GoldfeatherChannelManager::merge() { |
| 51 | |
| 52 | ProjTextureSetup setup = FixedFunction; |
| 53 | setupProjectiveTexture(setup); |
| 54 | |
| 55 | glEnable(GL_ALPHA_TEST); |
| 56 | glAlphaFunc(GL_GEQUAL, 0.5f); // accuracy issue with GL_EQUAL 1.0 on FX5600 |
| 57 | glEnable(GL_DEPTH_TEST); |
| 58 | glDepthFunc(GL_LESS); |
| 59 | glDepthMask(GL_TRUE); |
| 60 | glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); |
| 61 | |
| 62 | std::vector<Channel> channels = occupied(); |
| 63 | for (std::vector<Channel>::const_iterator c = channels.begin(); c!=channels.end(); ++c) { |
| 64 | |
| 65 | const std::vector<Primitive*> primitives = getPrimitives(*c); |
| 66 | |
| 67 | scissor->recall(*c); |
| 68 | scissor->enableScissor(); |
| 69 | |
| 70 | setupTexEnv(*c); |
| 71 | |
| 72 | if (getLayer(*c) == -1) { |
| 73 | |
| 74 | glEnable(GL_CULL_FACE); |
| 75 | for (Batch::const_iterator j = primitives.begin(); j != primitives.end(); ++j) { |
| 76 | glCullFace((*j)->getOperation() == Intersection ? GL_BACK : GL_FRONT); |
| 77 | (*j)->render(); |
| 78 | } |
| 79 | } else { |
| 80 | // shapes of interest: we need to determine the appropriate layer of |
| 81 | // the shapes, using stencil counting |
| 82 | glClearStencil(0); |
| 83 | glStencilMask(OpenGL::stencilMask); |
| 84 | glClear(GL_STENCIL_BUFFER_BIT); |
| 85 | OpenGL::renderLayer(getLayer(*c), primitives); |
| 86 | glDisable(GL_STENCIL_TEST); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | glDisable(GL_ALPHA_TEST); |
| 91 | glDisable(GL_CULL_FACE); |
| 92 | glDepthFunc(GL_LEQUAL); |
| 93 | |
| 94 | scissor->disableScissor(); |
| 95 | |
| 96 | resetProjectiveTexture(setup); |
| 97 | |
| 98 | clear(); |
| 99 | } |
| 100 | |
| 101 | |
| 102 | class GoldfeatherChannelManagerGLSLProgram : public ChannelManagerForBatches { |
nothing calls this directly
no test coverage detected