This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 9818 for ps


Ignore:
Timestamp:
07/13/11 15:51:40 (13 years ago)
Author:
philip
Message:

Disable culling of transparent objects in shadows/reflections, to fix trees

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/renderer/Renderer.cpp

    r9814 r9818  
    944944
    945945
    946     // Render all closed models (i.e. models where rendering back faces will produce
    947     // the correct result)
    948     glCullFace(GL_FRONT);
    949 
    950946    {
    951947        PROFILE("render patches");
    952948        m->terrainRenderer->RenderPatches();
    953949    }
    954 
    955     glCullFace(GL_BACK);
    956 
    957     // Render models that aren't closed
    958     glDisable(GL_CULL_FACE);
    959950
    960951    {
     
    966957    {
    967958        PROFILE("render transparent models");
     959        // disable face-culling for two-sided models
     960        glDisable(GL_CULL_FACE);
    968961        m->Model.Transp->Render(transparentShadows, MODELFLAG_CASTSHADOWS);
    969     }
    970 
    971     glEnable(GL_CULL_FACE);
     962        glEnable(GL_CULL_FACE);
     963    }
    972964
    973965    glColor3f(1.0, 1.0, 1.0);
     
    11021094        glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
    11031095    }
     1096
     1097    // disable face culling for two-sided models in sub-renders
     1098    if (flags)
     1099        glDisable(GL_CULL_FACE);
    11041100
    11051101    if (transparentMode == TRANSPARENT_OPAQUE)
     
    11091105    else
    11101106        m->Model.Transp->Render(m->Model.ModTransparent, flags);
     1107
     1108    if (flags)
     1109        glEnable(GL_CULL_FACE);
    11111110
    11121111    if (m_ModelRenderMode == WIREFRAME)
Note: See TracChangeset for help on using the changeset viewer.