Changeset 3220


Ignore:
Timestamp:
12/10/08 15:57:06 (15 years ago)
Author:
mattausch
Message:

worked on video replay function

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/IrradianceMapping.vcproj

    r3037 r3220  
    4141                                Name="VCCLCompilerTool" 
    4242                                Optimization="0" 
     43                                AdditionalIncludeDirectories="libs;src;libs/GL;libs/Devil/include;libs/Zlib/include;"$(CG_INC_PATH)"" 
    4344                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" 
    4445                                MinimalRebuild="true" 
     
    6162                        <Tool 
    6263                                Name="VCLinkerTool" 
     64                                AdditionalDependencies="DemoEngine.lib glut32.lib glew32s.lib glew32.lib DevIL.lib ILUT.lib zlib.lib cg.lib cgGL.lib" 
    6365                                LinkIncremental="2" 
     66                                AdditionalLibraryDirectories="&quot;lib/$(ConfigurationName)&quot;;libs;&quot;$(CG_LIB_PATH)&quot;;libs/GL;libs/Devil/lib;libs/Zlib/lib" 
     67                                IgnoreDefaultLibraryNames="LIBCMT" 
    6468                                GenerateDebugInformation="true" 
    6569                                SubSystem="1" 
     
    121125                                OmitFramePointers="true" 
    122126                                EnableFiberSafeOptimizations="true" 
    123                                 AdditionalIncludeDirectories="libs;libs/GL;libs/Devil/include;src;libs/Zlib/include;&quot;$(CG_INC_PATH)&quot;" 
     127                                AdditionalIncludeDirectories="libs;src;libs/GL;libs/Devil/include;libs/Zlib/include;&quot;$(CG_INC_PATH)&quot;" 
    124128                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE; _CRT_SECURE_NO_WARNINGS" 
    125129                                RuntimeLibrary="2" 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/VboFormatConverter.vcproj

    r3107 r3220  
    1818                <Configuration 
    1919                        Name="Debug|Win32" 
    20                         OutputDirectory="$(SolutionDir)$(ConfigurationName)" 
    21                         IntermediateDirectory="$(ConfigurationName)" 
     20                        OutputDirectory="$(SolutionDir)$\VboFormatConverter\(ConfigurationName)" 
     21                        IntermediateDirectory="$(ConfigurationName)\VboFormatConverter" 
    2222                        ConfigurationType="1" 
    2323                        CharacterSet="1" 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r3217 r3220  
    33##################################################### 
    44 
     5 
     6################ 
     7# misc stuff 
     8 
     9useLODs=1 
     10shadowSize=4096 
     11# the filenames given to recorded frames (+ number.bmp) 
     12recordedFramesSuffix=image 
    513 
    614 
     
    1523maxDepthForTestingChildren=3 
    1624 
    17 ################ 
    18  
    19 useLODs=1 
    20 shadowSize=4096 
    2125 
    2226#################### 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp

    r3219 r3220  
    333333mSampleIntensity(0.2f), 
    334334mSunVisiblePixels(0), 
    335 mSavedFrameNumber(-1) 
     335mSavedFrameNumber(-1), 
     336mSavedFrameSuffix("") 
    336337{ 
    337338        /////////// 
     
    13261327 
    13271328        static char imageName[200]; 
    1328         sprintf(imageName, "myframe%05d.bmp", mSavedFrameNumber); 
     1329        sprintf(imageName, "%s_%05d.bmp", mSavedFrameSuffix.c_str(), mSavedFrameNumber); 
    13291330 
    13301331        ILstring fileName = ILstring(imageName); 
     
    14221423 
    14231424 
    1424 void DeferredRenderer::SetSaveFrame(int frameNumber) 
    1425 { 
     1425void DeferredRenderer::SetSaveFrame(const string &suffix, int frameNumber) 
     1426{ 
     1427        mSavedFrameSuffix = suffix; 
    14261428        mSavedFrameNumber = frameNumber; 
    14271429} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.h

    r3219 r3220  
    8686                using the specified frame number 
    8787        */ 
    88         void SetSaveFrame(int frameNumber); 
     88        void SetSaveFrame(const std::string &suffix, int frameNumber); 
    8989 
    9090 
     
    202202 
    203203        int mSavedFrameNumber; 
     204        std::string mSavedFrameSuffix; 
    204205}; 
    205206 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Environment.cpp

    r2829 r3220  
    6969 
    7070 
     71bool Environment::GetStringParam(std::string &str, string &val) const 
     72{ 
     73        map<string, string>::const_iterator it = mParams.find(str); 
     74 
     75        if (it == mParams.end()) // parameter not found 
     76                return false; 
     77         
     78        // just assign value as it is - the line break character 
     79        val = (*it).second; 
     80        val.erase(val.end() - 1); 
     81 
     82        return true; 
     83} 
     84 
     85 
    7186bool Environment::Read(const string &filename) 
    7287{ 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Environment.h

    r2828 r3220  
    1616 
    1717/** Loads startup environment for the demo 
     18        Options are stored as name / value pair 
    1819*/ 
    1920class Environment 
     
    2526        bool Read(const std::string &filename); 
    2627 
    27         bool GetFloatParam(std::string &str, float &val) const; 
    28         bool GetIntParam(std::string &str, int &val) const; 
    29         bool GetVectorParam(std::string &str, Vector3 &val) const; 
    30         bool GetBoolParam(std::string &str, bool &val) const; 
     28        bool GetFloatParam(std::string &name, float &val) const; 
     29        bool GetIntParam(std::string &name, int &val) const; 
     30        bool GetVectorParam(std::string &name, Vector3 &val) const; 
     31        bool GetBoolParam(std::string &name, bool &val) const; 
     32        bool GetStringParam(std::string &name, std::string &val) const; 
     33 
    3134 
    3235protected: 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.cpp

    r3219 r3220  
    1717 
    1818 
     19WalkThroughRecorder::~WalkThroughRecorder() 
     20{ 
     21        mFile.close(); 
     22} 
     23 
     24 
    1925void WalkThroughRecorder::WriteFrame(Camera *cam) 
    2026{ 
     
    2834{ 
    2935        ifstream file(filename.c_str()); 
    30         FrameInfo info; 
    31         int i=0; 
    3236 
    33         std::string token; 
     37        if (file.is_open()) 
     38        { 
     39                FrameInfo info; 
     40                int i=0; 
    3441 
    35         while(std::getline(file, token))  
     42                std::string token; 
     43 
     44                while(std::getline(file, token))  
     45                { 
     46                        std::stringstream line(token); 
     47 
     48                        line >> info; 
     49                        mFrameInfos.push_back(info); 
     50                } 
     51        } 
     52        else 
    3653        { 
    37                 std::stringstream line(token); 
     54                cerr << "problem: cannot open file " << filename << endl; 
     55        } 
    3856 
    39                 line >> info; 
    40                 mFrameInfos.push_back(info); 
    41         } 
     57        file.close(); 
    4258} 
    4359 
     
    4561bool WalkThroughPlayer::ReadNextFrame(Camera *cam) 
    4662{ 
     63        if (mFrameInfos.empty()) 
     64                return false; 
     65 
    4766        cam->SetDirection(mFrameInfos[mFrame].mDirection); 
    4867        cam->SetPosition(mFrameInfos[mFrame].mPosition); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.h

    r3219 r3220  
    3131 
    3232 
    33 // Overload << operator for C++-style output 
     33/// Overload << operator for C++-style output 
    3434inline std::ostream& operator<< (std::ostream &s, const FrameInfo &A) 
    3535{ 
     
    3838 
    3939 
    40 // Overload >> operator for C++-style input 
     40/// Overload >> operator for C++-style input 
    4141inline std::istream& operator>> (std::istream &s, FrameInfo &A) 
    4242{ 
    4343        return s >> A.mPosition >> A.mDirection; 
    4444} 
    45  
    4645 
    4746 
     
    5453        */ 
    5554        WalkThroughRecorder(const std::string &filename); 
     55 
     56        ~WalkThroughRecorder(); 
     57 
    5658        /** Writes current camera data. 
    5759        */ 
    5860        void WriteFrame(Camera *cam); 
    5961         
     62 
    6063protected: 
    6164 
    6265        std::ofstream mFile; 
    6366}; 
     67 
    6468 
    6569/** Replays a given walkthrough 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3219 r3220  
    122122int currentReplayFrame = -1; 
    123123 
     124string recordedFramesSuffix("frames"); 
     125 
    124126/// the walkThroughRecorder 
    125127WalkThroughRecorder *walkThroughRecorder = NULL; 
     
    416418                env.GetFloatParam(string("ssaoKernelRadius"), ssaoKernelRadius); 
    417419                env.GetFloatParam(string("ssaoSampleIntensity"), ssaoSampleIntensity); 
    418  
    419420                env.GetBoolParam(string("ssaoUseFullResolution"), ssaoUseFullResolution); 
     421 
     422                env.GetStringParam(string("recordedFramesSuffix"), recordedFramesSuffix); 
    420423 
    421424                //env.GetStringParam(string("modelPath"), model_path); 
     
    446449                cout << "kernel radius: " << ssaoKernelRadius << endl; 
    447450                cout << "ssao full resolution: " << ssaoUseFullResolution << endl; 
     451                cout << "recorded frames suffix: " << recordedFramesSuffix << endl; 
    448452 
    449453                //cout << "model path: " << model_path << endl; 
     
    511515        resourceManager = ResourceManager::GetSingleton(); 
    512516        shaderManager = ShaderManager::GetSingleton(); 
     517 
    513518 
    514519        /////////// 
     
    12611266                deferredShader->SetUseTemporalCoherence(useTemporalCoherence); 
    12621267                deferredShader->SetSortSamples(sortSamples); 
    1263                 deferredShader->SetSaveFrame((recordFrames && replayPath) ? -1 : currentReplayFrame); 
     1268                deferredShader->SetSaveFrame(recordedFramesSuffix, (recordFrames && replayPath) ? currentReplayFrame : -1); 
    12641269 
    12651270                ShadowMap *sm = showShadowMap ? shadowMap : NULL; 
     
    14901495        case 'u': 
    14911496        case 'U': 
     1497                // move light source instead of camera tilt 
    14921498                moveLight = !moveLight; 
    14931499                break; 
Note: See TracChangeset for help on using the changeset viewer.