Changeset 3360 for GTP


Ignore:
Timestamp:
04/17/09 17:37:38 (15 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
1 added
10 edited

Legend:

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

    r3358 r3360  
    401401} 
    402402 
    403 #if 0 
     403#if 1 
    404404 
    405405bool ObjConverter::WriteFile(const string &filename) 
     
    450450        } 
    451451 
     452        int texId = 0; 
     453        ofile.write(reinterpret_cast<char *>(&texId), sizeof(int)); 
     454 
     455        bool alphaTestEnabled = false; 
     456        //bool cullFaceEnabled = false; 
     457        bool cullFaceEnabled = true; 
     458                 
     459        ofile.write(reinterpret_cast<char *>(&alphaTestEnabled), sizeof(bool)); 
     460        ofile.write(reinterpret_cast<char *>(&cullFaceEnabled), sizeof(bool)); 
     461 
     462        // material 
     463        bool hasMaterial = true; 
     464        ofile.write(reinterpret_cast<char *>(&hasMaterial), sizeof(bool)); 
     465         
     466        SimpleVec ambient, diffuse, spec, emm; 
     467 
     468        ambient.x = ambient.y = ambient.z = 0.2f; 
     469        diffuse.x = diffuse.y = diffuse.z = 1.0f; 
     470        spec.x = spec.y = spec.z = .0f; 
     471        emm = spec; 
     472 
     473        // only write rgb part of the material 
     474        ofile.write(reinterpret_cast<char *>(&ambient), sizeof(SimpleVec)); 
     475        ofile.write(reinterpret_cast<char *>(&diffuse), sizeof(SimpleVec)); 
     476        ofile.write(reinterpret_cast<char *>(&spec), sizeof(SimpleVec)); 
     477        ofile.write(reinterpret_cast<char *>(&emm), sizeof(SimpleVec)); 
     478 
    452479 
    453480        int entityCount = 1; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter2.cpp

    r3358 r3360  
    300300        { 
    301301                //cout << "line: " << line << endl; 
    302  
    303302                switch (str[0]) 
    304303                { 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/main.cpp

    r3357 r3360  
    1 //#include "ObjConverter.h" 
    2 #include "PlyConverter.h" 
     1#include "ObjConverter.h" 
     2//#include "PlyConverter.h" 
    33#include <iostream> 
    44#include <time.h> 
     
    1212 
    1313        //ObjConverter2 converter; 
    14         //ObjConverter converter; 
    15         PlyConverter converter; 
     14        ObjConverter converter; 
     15        //PlyConverter converter; 
    1616 
    1717        cout << "converting obj to dem format" << endl; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r3334 r3360  
    143143ssaoSampleIntensity=0.8f 
    144144# ssao temporal coherence factor 
    145 tempCohFactor=2000.0f 
     145tempCohFactor=1500.0f 
    146146 
    147147 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/sibenik.env

    r3343 r3360  
    5252keyForwardMotion=30.0f 
    5353 
    54 camPosition=53.7718 -2.29418 8.67807 
    55 camDirection=-0.994522 0.104525 -0 
     54#camPosition=53.7718 -2.29418 8.67807 
     55#camDirection=-0.994522 0.104525 -0 
    5656 
    5757#lightDirection=0.509293 0.784034 -0.35484 
    5858#lightDirection=0.360937 0.0267167 -0.932207 
    59 lightDirection=0.556361 0.559966 -0.613923 
     59#lightDirection=0.556361 0.559966 -0.613923 
    6060 
    6161##################### 
     
    113113defaultAmbient=0.4 0.4 0.4 
    114114defaultDiffuse=1.4 1.4 1.4 
     115 
     116 
     117# good view point for buddha 
     118 
     119camPosition=6.13507 5.48306 7.48809 
     120camDirection=-0.0136068 0.974275 -0.224952 
     121lightDirection=0.556361 0.559966 -0.613923 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp

    r3352 r3360  
    674674                FilterSsao(fbo); 
    675675                CombineSsao(fbo); 
     676 
    676677                break; 
    677678        case GI: 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3359 r3360  
    551551        camera = new PerspectiveCamera(winWidth / winHeight, fov); 
    552552        camera->SetNear(nearDist); 
    553         camera->SetFar(1000); 
     553        camera->SetFar(1e6f); 
    554554 
    555555        camera->SetDirection(camDir); 
     
    621621        //resourceManager->mUseNormalMapping = true; 
    622622        //resourceManager->mUseNormalMapping = false; 
    623  
    624623        resourceManager->mUseSpecialColors = true; 
    625624 
     
    632631 
    633632        if (0) LoadPompeiiFloor(); 
    634  
     633#if 1 
    635634 
    636635#if 0 
     
    647646        VertexArray positions; 
    648647         
     648        // for buddha (lowres) 
    649649        /*positions.push_back(Vector3(6.07307, 8.20723, 6.62)); 
    650650        positions.push_back(Vector3(-17.1935, 11.1687, 8.8781)); 
    651651        positions.push_back(Vector3(1.50032, 31.1943, 19.1f));*/ 
    652652 
    653         positions.push_back(Vector3(6.07307, 8.20723, 4.6f)); 
    654         positions.push_back(Vector3(-17.1935, 11.1687, 6.8f)); 
    655         positions.push_back(Vector3(1.50032, 31.1943, 17.6f)); 
     653        // for happy buddha 
     654        //positions.push_back(Vector3(6.07307, 8.20723, 4.6f)); 
     655        //positions.push_back(Vector3(-17.1935, 11.1687, 6.8f)); 
     656        //positions.push_back(Vector3(1.50032, 31.1943, 17.6f)); 
     657 
     658        // for dragon 
     659        //positions.push_back(Vector3(6.07307, 8.20723, 5.0f)); 
     660        positions.push_back(Vector3(0, 0, -0.8)); 
    656661 
    657662#endif 
     
    661666         
    662667        //LoadModel("hbuddha.dem", dynamicObjects); 
    663         //LoadModel("horse.dem", dynamicObjects); 
    664         LoadModel("happy.dem", dynamicObjects); 
     668        LoadModel("horse.dem", dynamicObjects); 
     669        //LoadModel("happy.dem", dynamicObjects); 
     670        //LoadModel("dragon.dem", dynamicObjects); 
    665671        //LoadModel("torus.dem", dynamicObjects); 
    666672        //LoadModel("venusm.dem", dynamicObjects); 
     
    680686 
    681687        // hack: second buddha 
    682         dynamicObjects[2]->GetTransform()->MultMatrix(rotMatrix); 
    683         dynamicObjects[1]->GetTransform()->MultMatrix(rotMatrix); 
    684688        dynamicObjects[0]->GetTransform()->MultMatrix(rotMatrix); 
    685689        dynamicObjects[0]->GetTransform()->MultMatrix(scaleMatrix); 
    686         dynamicObjects[1]->GetTransform()->MultMatrix(scaleMatrix); 
    687         dynamicObjects[2]->GetTransform()->MultMatrix(scaleMatrix); 
     690 
     691        //dynamicObjects[1]->GetTransform()->MultMatrix(rotMatrix); 
     692        //dynamicObjects[1]->GetTransform()->MultMatrix(scaleMatrix); 
     693 
     694        //dynamicObjects[2]->GetTransform()->MultMatrix(rotMatrix); 
     695        //dynamicObjects[2]->GetTransform()->MultMatrix(scaleMatrix); 
    688696 
    689697        cout << "dynamic objects: " << (int)dynamicObjects.size() << endl; 
     698 
     699        CreateAnimation(positions[0]); 
     700#endif 
    690701 
    691702        // hack 
     
    722733 
    723734        // set far plane based on scene extent 
    724         farDist = 10.0f * Magnitude(bvh->GetBox().Diagonal()); 
     735        //farDist = 10.0f * Magnitude(bvh->GetBox().Diagonal()); 
     736        farDist = 1000.0f; 
    725737        camera->SetFar(farDist); 
    726738 
     
    739751        /// the turbitity of the sky (from clear to hazy, use <3 for clear sky) 
    740752        preetham = new SkyPreetham(turbitity, skyDome); 
    741  
    742         CreateAnimation(positions[0]); 
    743753 
    744754 
     
    16061616                break; 
    16071617        case '9': 
    1608                 ssaoKernelRadius *= 0.8f; 
     1618                ssaoKernelRadius *= .8f; 
    16091619                cout << "new ssao kernel radius: " << ssaoKernelRadius << endl; 
    16101620                if (deferredShader) deferredShader->SetKernelRadius(ssaoKernelRadius); 
    16111621                break; 
    16121622        case '0': 
    1613                 ssaoKernelRadius *= 1.0f / 0.8f; 
     1623                ssaoKernelRadius *= 1.0f / .8f; 
    16141624                if (deferredShader) deferredShader->SetKernelRadius(ssaoKernelRadius); 
    16151625                cout << "new ssao kernel radius: " << ssaoKernelRadius << endl; 
    16161626                break; 
    16171627        case 'n': 
    1618                 ssaoSampleIntensity *= 0.9f; 
     1628                ssaoSampleIntensity *= .9f; 
    16191629                if (deferredShader) deferredShader->SetSampleIntensity(ssaoSampleIntensity); 
    16201630                cout << "new ssao sample intensity: " << ssaoSampleIntensity << endl; 
    16211631                break; 
    16221632        case 'N': 
    1623                 ssaoSampleIntensity *= 1.0f / 0.9f; 
     1633                ssaoSampleIntensity *= 1.0f / .9f; 
    16241634                if (deferredShader) deferredShader->SetSampleIntensity(ssaoSampleIntensity); 
    16251635                cout << "new ssao sample intensity: " << ssaoSampleIntensity << endl; 
     
    16711681        case 'T': 
    16721682                useTemporalCoherence = !useTemporalCoherence; 
     1683                cout << "using temporal coherence " << useTemporalCoherence << endl; 
    16731684                break; 
    16741685        case 'a': 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3356 r3360  
    66//-- ssao + gi parameters 
    77 
    8 #define NUM_PRECOMPUTED_SAMPLES 8124 
     8//#define NUM_PRECOMPUTED_SAMPLES 8124 
     9#define NUM_PRECOMPUTED_SAMPLES 4096 
     10//#define NUM_PRECOMPUTED_SAMPLES 2048 
    911 
    1012//#define NUM_SAMPLES 8 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r3353 r3360  
    4040 
    4141        // hack: prevent to shade the sky 
    42 #if 0 
     42#if 1 
    4343        if (color.w > DEPTH_THRESHOLD) 
    4444        { 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg

    r3168 r3360  
    102102        //pix.id = glstate.fog.color.xyz; 
    103103        // the offset to the world pos from old frame 
     104        //pix.offsVec = float3(0,0,0); 
    104105        pix.offsVec = IN.oldWorldPos.xyz - IN.worldPos.xyz; 
    105106 
     
    124125        // the offset to the world pos from old frame 
    125126        pix.offsVec = IN.oldWorldPos.xyz - IN.worldPos.xyz; 
     127        //pix.offsVec = float3(0,0,0); 
    126128 
    127129        return pix; 
Note: See TracChangeset for help on using the changeset viewer.