Changeset 3066 for GTP


Ignore:
Timestamp:
10/24/08 13:17:03 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r3065 r3066  
    44assumedVisibleFrames=10 
    55maxBatchSize=50 
    6 #trianglesPerVirtualLeaf=300 
    7 trianglesPerVirtualLeaf=30000 
     6trianglesPerVirtualLeaf=300 
     7#trianglesPerVirtualLeaf=30000 
    88keyForwardMotion=20.0f 
    99keyRotation=1.5f 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp

    r3065 r3066  
    200200         
    201201        // nodes are tested using the subnodes from 3 levels below 
    202         mMaxDepthForTestingChildren = 0;//3; 
     202        mMaxDepthForTestingChildren = 3; 
    203203        //mMaxDepthForTestingChildren = 4; 
    204204 
     
    11091109 
    11101110 
     1111static Technique GetVizTechnique() 
     1112{ 
     1113        Technique tech; 
     1114        tech.Init(); 
     1115 
     1116        //tech.SetLightingEnabled(false); 
     1117        //tech.SetDepthWriteEnabled(false); 
     1118 
     1119        tech.SetEmmisive(RgbaColor(1.0f, 1.0f, 1.0f, 1.0f)); 
     1120        tech.SetDiffuse(RgbaColor(1.0f, 1.0f, 1.0f, 1.0f)); 
     1121        tech.SetAmbient(RgbaColor(1.0f, 1.0f, 1.0f, 1.0f)); 
     1122 
     1123        return tech; 
     1124} 
     1125 
     1126 
    11111127void Bvh::RenderBoundsForViz(BvhNode *node,  
    11121128                                                         RenderState *state,  
    11131129                                                         bool useTightBounds) 
    11141130{ 
    1115         glColor3f(1, 1, 1); 
    1116  
    1117         // hack: for deferred shading we have to define a material 
    1118         static Technique boxMat; 
    1119         boxMat.SetLightingEnabled(false); 
    1120  
    1121         boxMat.SetEmmisive(RgbaColor(1.0f, 1.0f, 1.0f, 1.0f)); 
    1122  
     1131        Technique *oldTech = state->GetState(); 
     1132        // we set a simple material 
     1133        static Technique boxMat = GetVizTechnique(); 
    11231134        boxMat.Render(state); 
    11241135 
    11251136        if (!useTightBounds) 
    11261137        { 
    1127                 //RenderBoxForViz(node->GetBox()); 
    1128                 glPolygonMode(GL_FRONT, GL_LINE); 
     1138                RenderBoxForViz(node->GetBox()); 
     1139                /*glPolygonMode(GL_FRONT, GL_LINE); 
    11291140                RenderBoundingBoxImmediate(node->GetBox()); 
    1130                 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 
     1141                glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);*/ 
    11311142        } 
    11321143        else 
     
    11371148                } 
    11381149        } 
     1150 
     1151        if (oldTech) oldTech->Render(state); 
    11391152} 
    11401153 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.cpp

    r3065 r3066  
    129129                /// the query box material 
    130130                static Technique queryTech = GetQueryTechnique(); 
    131                 static Technique dummyTech = GetDummyTechnique(); 
    132  
    133                 //if ((float)rand() / RAND_MAX < 0.2) 
    134                 //      SetState(&dummyTech); 
    135                 //else  
    136                         SetState(&queryTech); 
     131                SetState(&queryTech); 
    137132        } 
    138133 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.h

    r3065 r3066  
    4444        */ 
    4545        void SetState(Technique *tech); 
     46        /** Returns the current render state. 
     47        */ 
     48        Technique *GetState() { return mCurrentTechnique; } 
    4649        /** Returns either query or render mode 
    4750        */ 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.cpp

    r3038 r3066  
    8383        else  
    8484        { 
    85                 // for non leafs this renders only the bounding volume (if the flag is set) 
    8685                BvhInterior *interior = static_cast<BvhInterior *>(node); 
    8786 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp

    r3063 r3066  
    598598        glViewport(0, 0, mSize, mSize); 
    599599 
    600         glDisable(GL_LIGHTING); 
    601         glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
     600        //glDisable(GL_LIGHTING); 
     601        //glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
    602602 
    603603        glShadeModel(GL_FLAT); 
     
    612612         
    613613        glShadeModel(GL_SMOOTH); 
    614         glEnable(GL_LIGHTING); 
    615         glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     614        //glEnable(GL_LIGHTING); 
     615        //glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    616616 
    617617#if 0 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3065 r3066  
    5656#include "ShaderManager.h" 
    5757 
     58 
     59 
    5860using namespace std; 
    5961using namespace CHCDemoEngine; 
     
    513515 
    514516        // this fbo basicly stores the scene information we get from standard rendering of a frame 
    515         // we store colors, normals, positions (for the ssao) 
     517        // we store diffuse colors, eye space depth and normals 
    516518        fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_32); 
    517519        //fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_24); 
     
    521523        // the normals buffer 
    522524        fbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 
    523         // the positions buffer 
    524         //fbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 
     525        // a rgb buffer which could hold material properties 
    525526        fbo->AddColorBuffer(ColorBufferObject::RGB_UBYTE, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 
    526527        // another color buffer 
     
    669670        RenderTraverser *tr; 
    670671         
    671         bvh->ResetNodeClassifications(); 
    672  
    673672        switch (renderMode) 
    674673        { 
     
    703702        tr->SetUseDepthPass((renderMethod == RENDER_DEPTH_PASS) || (renderMethod == RENDER_DEPTH_PASS_DEFERRED)); 
    704703        tr->SetRenderQueue(renderQueue); 
     704        tr->SetShowBounds(showBoundingVolumes); 
     705 
     706        bvh->ResetNodeClassifications(); 
     707 
    705708 
    706709        return tr; 
     
    920923                // the scene is rendered withouth any shading    
    921924                glShadeModel(GL_FLAT); 
    922                 glDisable(GL_LIGHTING); 
    923                 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
     925                //glDisable(GL_LIGHTING); 
     926                //glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
    924927 
    925928 
     
    937940         
    938941                glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    939                 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
     942                //glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
    940943 
    941944 
     
    18961899        // draw all objects that have exactly the same depth as the current sample 
    18971900        glDepthFunc(GL_LEQUAL); 
    1898         glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     1901        //glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    18991902 
    19001903        glClear(GL_COLOR_BUFFER_BIT); 
Note: See TracChangeset for help on using the changeset viewer.