Changeset 3295 for GTP


Ignore:
Timestamp:
02/06/09 17:34:25 (15 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter.cpp

    r3263 r3295  
    403403 
    404404#if 0 
     405 
    405406bool ObjConverter::WriteFile(const string &filename) 
    406407{ 
     
    480481        return true; 
    481482} 
     483 
    482484#else 
     485 
    483486bool ObjConverter::WriteFile(const string &filename) 
    484487{ 
     
    562565 
    563566 
    564         int entityCount = 1; 
     567        //int entityCount = 1; 
     568        int entityCount = mNumShapes; 
    565569        ofile.write(reinterpret_cast<char *>(&entityCount), sizeof(int)); 
    566570 
    567571 
    568572        ////////// 
    569         //-- write single scene entity 
    570  
    571         // no transformation 
    572         bool hasTrafo = false; 
    573         ofile.write(reinterpret_cast<char *>(&hasTrafo), sizeof(bool)); 
    574  
    575         // a dummy lod 
    576         int numLODs = 1; 
    577         ofile.write(reinterpret_cast<char *>(&numLODs), sizeof(int)); 
    578  
    579         float dist = 0; 
    580         ofile.write(reinterpret_cast<char *>(&dist), sizeof(float)); 
    581  
    582         ofile.write(reinterpret_cast<char *>(&mNumShapes), sizeof(int)); 
     573        //-- q: write single scene entity with all shapes or many entities with one shape 
    583574 
    584575        // all shapes belong to this scene entity 
    585576        for (int i = 0; i < mNumShapes; ++ i) 
    586577        { 
     578                // no transformation 
     579                bool hasTrafo = false; 
     580                ofile.write(reinterpret_cast<char *>(&hasTrafo), sizeof(bool)); 
     581 
     582                // a dummy lod 
     583                int numLODs = 1; 
     584                ofile.write(reinterpret_cast<char *>(&numLODs), sizeof(int)); 
     585 
     586                float dist = 0; 
     587                ofile.write(reinterpret_cast<char *>(&dist), sizeof(float)); 
     588 
     589                //ofile.write(reinterpret_cast<char *>(&mNumShapes), sizeof(int)); 
     590                int one = 1; 
     591                ofile.write(reinterpret_cast<char *>(&one), sizeof(int)); 
     592 
    587593                int shapeId = i; 
    588594                ofile.write(reinterpret_cast<char *>(&shapeId), sizeof(int)); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/main.cpp

    r3275 r3295  
    1 #include "ObjConverter2.h" 
     1#include "ObjConverter.h" 
    22#include <iostream> 
    33#include <time.h> 
     
    1010        int returnCode = 0; 
    1111 
    12         ObjConverter2 converter; 
     12        //ObjConverter2 converter; 
     13        ObjConverter converter; 
    1314 
    1415        cout << "converting obj to dem format" << endl; 
    15 #if 0    
     16#if 1 
    1617        if (!converter.LoadMaterials(model_path + argv[3])) 
    1718        { 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhConstructor.cpp

    r3280 r3295  
    110110        int bestAxis = 0; 
    111111 
    112         //  cout<<"Evaluating axis..."<<endl<<flush; 
    113  
    114112        const int initialPlanes = 3; 
    115113 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp

    r3291 r3295  
    294294        // downscale ambient color 
    295295        if (scaleToRange) 
     296        { 
    296297                ambient *= 8e-6f; 
     298        } 
    297299        else 
    298300        { 
     
    342344        // calculate final sun diffuse color. 
    343345        if (scaleToRange) 
     346        { 
    344347                diffuse = color * 3e-5f; 
     348        } 
    345349        else 
     350        { 
    346351                diffuse = color * 3e-1f; 
     352        } 
    347353 
    348354        // diffuse component should be more saturated (and less blueish) for high sun positions 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3294 r3295  
    160160int visibilitySolutionInitialState = 0; 
    161161 
     162Vector3 defaultAmbient(0.2f); 
     163Vector3 defaultDiffuse(1.0f); 
     164 
    162165 
    163166/// the technique used for rendering 
     
    462465                env.GetVectorParam(string("camDirection"), camDir); 
    463466                env.GetVectorParam(string("lightDirection"), lightDir); 
     467                env.GetVectorParam(string("defaultAmbient"), defaultAmbient); 
     468                env.GetVectorParam(string("defaultDiffuse"), defaultDiffuse); 
    464469 
    465470                env.GetBoolParam(string("useFullScreen"), useFullScreen); 
     
    617622        //LoadModel("toyplane2.dem", dynamicObjects); 
    618623        //LoadModel("elephal.dem", dynamicObjects); 
    619         //LoadModel("sibenik.dem", dynamicObjects); 
    620624 
    621625        if (0) LoadPompeiiFloor(); 
     
    971975} 
    972976 
    973 /** Setup sunlight 
     977/** Setup lighting conditions 
    974978*/ 
    975979void SetupLighting() 
     
    10111015        else 
    10121016        { 
    1013  
    1014                 ambient[0] = .2f; 
    1015                 ambient[1] = .2f; 
    1016                 ambient[2] = .2f; 
    1017  
    1018                 diffuse[0] = 1.0f; 
    1019                 diffuse[1] = 1.0f; 
    1020                 diffuse[2] = 1.0f; 
     1017                ambient[0] = defaultAmbient.x; 
     1018                ambient[1] = defaultAmbient.y; 
     1019                ambient[2] = defaultAmbient.z; 
     1020 
     1021                diffuse[0] = defaultDiffuse.x; 
     1022                diffuse[1] = defaultDiffuse.y; 
     1023                diffuse[2] = defaultDiffuse.z; 
    10211024        } 
    10221025 
     
    12961299 
    12971300                if (showShadowMap && !renderLightView) 
     1301                { 
    12981302                        RenderShadowMap(camera->GetFar()); 
     1303                } 
    12991304 
    13001305                //glPushAttrib(GL_VIEWPORT_BIT); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3290 r3295  
    6262#define NUM_DOF_TABS 16 
    6363 
    64  
    6564#define USE_GTX 
    6665 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg

    r3230 r3295  
    191191        //-- compute color bleeding + ao 
    192192 
    193         GiStruct gi = globIllum(IN, colors, noiseTex, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(IN.view), sampleIntensity); 
     193        GiStruct gi = globIllum(IN, colors, noiseTex, samples, normal, eyeSpacePos,  
     194                                    w, bl, br, tl, tr, normalize(IN.view), sampleIntensity); 
    194195         
    195196 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt

    r3280 r3295  
    196196 
    197197find out ssao artifacts on edges (near edge no ambient occlusion) 
     198 
     199 
     200/////////// 
     201 
     202shadows not working proberly with chc!!! (too many triangles, slow!!) 
     203 
     204sibenik: textures dissappear!! 
Note: See TracChangeset for help on using the changeset viewer.