Example #1
0
void RDirNode::drawBloom(float dt){

    if(in_frustum && isVisible()) {

        float bloom_radius = dir_radius * 2.0 * gGourceSettings.bloom_multiplier;

        vec4 bloom_col = col * gGourceSettings.bloom_intensity;

        glColor4f(bloom_col.x, bloom_col.y, bloom_col.z, 1.0);

        glPushMatrix();
            glTranslatef(pos.x, pos.y, 0.0);

            glBegin(GL_QUADS);
                glTexCoord2f(1.0f, 1.0f);
                glVertex2f(bloom_radius,bloom_radius);
                glTexCoord2f(1.0f, 0.0f);
                glVertex2f(bloom_radius,-bloom_radius);
                glTexCoord2f(0.0f, 0.0f);
                glVertex2f(-bloom_radius,-bloom_radius);
                glTexCoord2f(0.0f, 1.0f);
                glVertex2f(-bloom_radius,bloom_radius);
            glEnd();
        glPopMatrix();
    }

    for(std::list<RDirNode*>::const_iterator it = children.begin(); it != children.end(); it++) {
        RDirNode* node = (*it);
        node->drawBloom(dt);
    }
}
Example #2
0
void RDirNode::drawBloom(Frustum& frustum, float dt) {

    if(isVisible() && frustum.boundsInFrustum(quadItemBounds)) {

        float bloom_radius = dir_radius * 2.0 * gGourceBloomMultiplier;

        vec4f bloom_col = col * gGourceBloomIntensity;

        glColor4f(bloom_col.x, bloom_col.y, bloom_col.z, 1.0);

        glPushMatrix();
            glTranslatef(pos.x, pos.y, 0.0);

            glBegin(GL_QUADS);
            glTexCoord2f(1.0, 1.0);
                glVertex2f(bloom_radius,bloom_radius);
                glTexCoord2f(1.0, 0.0);
                glVertex2f(bloom_radius,-bloom_radius);
                glTexCoord2f(0.0, 0.0);
                glVertex2f(-bloom_radius,-bloom_radius);
                glTexCoord2f(0.0, 1.0);
                glVertex2f(-bloom_radius,bloom_radius);
            glEnd();
        glPopMatrix();

    }

    for(std::list<RDirNode*>::iterator it = children.begin(); it != children.end(); it++) {
        RDirNode* node = (*it);
        node->drawBloom(frustum,dt);
    }
}