void PostEffectEdgeDetection::prepare()
 {
     ResourceManager::loadShader("ppEdgedetect", "Assets/Shaders/fs_quad.vert", "Assets/Shaders/postprocess_edgeDetect.frag");
     resource::Shader* ppEdgedetect = ResourceManager::getShader("ppEdgedetect");
     
     render::RenderStates renderStates;
     render::Transform quad;
     quad.scale(math::vec3(2.0));
     renderStates.transforms.push_back(quad);
     renderStates.shader = ppEdgedetect;
     setRenderStates(renderStates);
 }
Beispiel #2
0
void Renderer::renderRenderData(RenderState& rstate, RenderData* render_data) {
    if (!(rstate.render_mask & render_data->render_mask()))
        return;

    // Set the states
    setRenderStates(render_data, rstate);
    if (render_data->mesh() != 0) {
        GL(renderMesh(rstate, render_data));
    }
    // Restoring to Default.
    // TODO: There's a lot of redundant state changes. If on every render face culling is being set there's no need to
    // restore defaults. Possibly later we could add a OpenGL state wrapper to avoid redundant api calls.
    restoreRenderStates(render_data);
}