Changeset 861


Ignore:
Timestamp:
04/28/06 19:49:56 (18 years ago)
Author:
igarcia
Message:
 
Location:
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE
Files:
269 added
15 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/Readme.txt

    r701 r861  
    22------------------------------ 
    33 
    4 OGRE_PATH: points to directory where ogre.sln is located (i.e., the directory OGRE/trunk/ogrenew) 
    5 Set preprocessor flag /D "TIXML_USE_STL" should be used in order to use the correct tinyXML STL version 
     4Run-time hardware Requeriments: 
     5=============================== 
     6 
     7Recommended configuration: 
     8  -Pentium 4 or equivalent AMD at 2GHz or more. 
     9  -Graphic card Vertex Shader 3.0/Pixel Shader 3.0 Compatible 
     10  -RAM 1GB  
     11  -DirectX 9c / OpenGL 
     12 
     13Required configuration: 
     14  -Pentium 4 or equivalent AMD at 1GHz or more. 
     15  -Graphic card Vertex Shader 2.0/Pixel Shader 2.0 Compatible 
     16  -RAM 512MB  
     17  -DirectX 9c / OpenGL 
     18 
     19- The IBR Billboard Cloud Tree Generator has been tested succesfully with this configurations: 
     20 
     21OpenGL   - GLSL  ---- ATI 9700 Mobility 
     22OpenGL   - Cg    ---- ATI 9700 Mobility 
     23Direct3D - Cg    ---- ATI 9700 Mobility 
     24Direct3D - HLSL  ---- ATI 9700 Mobility 
     25 
     26OpenGL   - GLSL  ---- NVIDIA Quadro FX 4500 / NVIDIA 7800 GT 
     27OpenGL   - Cg    ---- NVIDIA Quadro FX 4500 / NVIDIA 7800 GT 
     28Direct3D - Cg    ---- NVIDIA Quadro FX 4500 / NVIDIA 7800 GT 
     29Direct3D - HLSL  ---- NVIDIA Quadro FX 4500 / NVIDIA 7800 GT 
     30 
     31Required dependencies: 
     32====================== 
     33 
     34The IBR Billboard Cloud Tree Generator core depends on several other 
     35libraries that you will need install, if they're not already present 
     36on your system. The most typical libraries you may need to install 
     37are: 
     38 
     39   * Ogre3D 
     40   * Boost 
     41 
     42Optionally: 
     43 
     44   * OpenEXR 
     45   * ImageDebugger 
     46 
     47 
     48Folders Structure: 
     49================== 
     50 
     51Runtime folders: 
     52 
     53  /bin/Release 
     54  /bin/Debug 
     55 
     56  - These folders contain the release / debug IBRBillboardCloudTreeGenerator.  
     57  You should use the realease version. Only if you find out a bug use the debug 
     58  version to report it. 
     59 
     60Documentation folders: 
     61 
     62  /doc/userManual   
     63  /doc/devManual 
     64 
     65  - The user manual cover all the features available in the IBR Billboard Cloud Tree Generator. 
     66  - The developer manual it is basically a doxygen documentationn of the IBR Billboard Cloud  
     67  Tree Generator Core, this documentation will useful if you want to extend the application 
     68  in some specific ways. 
     69 
     70Media folders: 
     71 
     72  /media 
     73  /media/general 
     74  /media/chestnut/leaves 
     75 
     76  - The media folder is the default folder where you will find the media used by the  
     77  IBR Billboard Cloud Tree Generator. This include the shaders, textures, Ogre3D materials, ... 
     78  - The default shaders used are placed in media/general. 
     79  - There is a sample tree placed in media/chestnut. The more important file from this sample 
     80  tree is the configuration file (sampleChestnutLeaves.cfg) placed in /media/chestnut/leaves. This  
     81  configuration file must be used when you run the IBR Billboard Cloud Tree Generator, for this sample. 
     82 
     83Source code folders: 
     84 
     85  /include   
     86  /src 
     87  /scripts 
     88 
     89Temporary folders: 
     90   
     91  /misc 
     92  /obj 
     93   
     94   
     95Compilation instructions: 
     96========================= 
     97 
     98Note: There is a preprocessor flag /D "TIXML_USE_STL" used in order to use the correct tinyXML STL version 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IBRBillboardCloudTreeFrameListener.h

    r721 r861  
    1111 
    1212public: 
    13         IBRBillboardCloudTreeFrameListener(Ogre::RenderWindow *win, bool useBufferedInputKeys = false, bool useBufferedInputMouse = false) 
    14         : OgreFrameListener(win, useBufferedInputKeys, useBufferedInputMouse) 
    15     { 
    16     } 
     13        IBRBillboardCloudTreeFrameListener(Ogre::RenderWindow *win, bool useBufferedInputKeys = false, bool useBufferedInputMouse = false); 
    1714 
    18         ~IBRBillboardCloudTreeFrameListener()         
    19     { 
    20     } 
     15        ~IBRBillboardCloudTreeFrameListener();         
    2116 
    22         bool frameStarted(const Ogre::FrameEvent& evt) 
    23     { 
    24         // Call default 
    25         return OgreFrameListener::frameStarted(evt);         
    26     } 
     17        bool frameStarted(const Ogre::FrameEvent& evt); 
     18 
     19        bool processUnbufferedKeyInput(const Ogre::FrameEvent& evt); 
    2720 
    2821}; 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCBillboardViewMode.h

    r821 r861  
    1616                        epsilonX = 0.0; 
    1717                        epsilonY = 0.0; 
    18                         factor = 1.0 / 255.0; 
     18                        factor = 0.125; 
    1919                } 
    2020 
     
    3535                virtual bool processUnbufferedKeyInput(const Ogre::FrameEvent& evt) 
    3636                {                        
    37                         if (mInputDevice->isKeyDown(Ogre::KC_1)) 
    38                         { 
    39                                 epsilonX = epsilonX + factor;                            
    40                         } 
    41  
    42                         if (mInputDevice->isKeyDown(Ogre::KC_2)) 
    43                         { 
    44                                 epsilonX = epsilonX - factor; 
    45                         } 
    46  
    47                         if (mInputDevice->isKeyDown(Ogre::KC_3)) 
    48                         { 
    49                                 epsilonY = epsilonY + factor; 
     37                        if (mInputDevice->isKeyDown(Ogre::KC_RIGHT)) 
     38                        { 
     39                                epsilonX = epsilonX + (factor * evt.timeSinceLastFrame);                                 
     40                        } 
     41 
     42                        if (mInputDevice->isKeyDown(Ogre::KC_LEFT)) 
     43                        { 
     44                                epsilonX = epsilonX - (factor * evt.timeSinceLastFrame); 
     45                        } 
     46 
     47                        if (mInputDevice->isKeyDown(Ogre::KC_UP)) 
     48                        { 
     49                                epsilonY = epsilonY + (factor * evt.timeSinceLastFrame); 
    5050                        } 
    5151                         
    52                         if (mInputDevice->isKeyDown(Ogre::KC_4)) 
    53                         { 
    54                                 epsilonY = epsilonY - factor; 
     52                        if (mInputDevice->isKeyDown(Ogre::KC_DOWN)) 
     53                        { 
     54                                epsilonY = epsilonY - (factor * evt.timeSinceLastFrame); 
    5555                        } 
    5656 
    5757                        mFragParams = mBillboardCloudEntity->getSubEntity(0)->getMaterial()->getBestTechnique()->getPass(0)->getFragmentProgramParameters(); 
     58 
    5859                        mFragParams->setNamedConstant("epsilonX", epsilonX); 
    5960                        mFragParams->setNamedConstant("epsilonY", epsilonY); 
     
    7172                        } 
    7273 
     74                        ///* Move camera forward by keypress. */ 
     75                        //if (mInputDevice->isKeyDown(Ogre::KC_UP) || mInputDevice->isKeyDown(Ogre::KC_W) ) 
     76                        //{ 
     77                        //      mTranslateVector.z = -mMoveScale; 
     78                        //} 
     79 
     80                        ///* Move camera backward by keypress. */ 
     81                        //if (mInputDevice->isKeyDown(Ogre::KC_DOWN) || mInputDevice->isKeyDown(Ogre::KC_S) ) 
     82                        //{ 
     83                        //      mTranslateVector.z = mMoveScale; 
     84                        //} 
     85 
    7386                        /* Move camera forward by keypress. */ 
    74                         if (mInputDevice->isKeyDown(Ogre::KC_UP) || mInputDevice->isKeyDown(Ogre::KC_W) ) 
     87                        if (mInputDevice->isKeyDown(Ogre::KC_W) ) 
    7588                        { 
    7689                                mTranslateVector.z = -mMoveScale; 
     
    7891 
    7992                        /* Move camera backward by keypress. */ 
    80                         if (mInputDevice->isKeyDown(Ogre::KC_DOWN) || mInputDevice->isKeyDown(Ogre::KC_S) ) 
     93                        if (mInputDevice->isKeyDown(Ogre::KC_S) ) 
    8194                        { 
    8295                                mTranslateVector.z = mMoveScale; 
     
    95108                        } 
    96109 
    97                         if (mInputDevice->isKeyDown(Ogre::KC_RIGHT)) 
    98                         { 
    99                                 mCamera->yaw(-mRotScale); 
    100                         } 
    101                          
    102                         if (mInputDevice->isKeyDown(Ogre::KC_LEFT)) 
    103                         { 
    104                                 mCamera->yaw(mRotScale); 
    105                         } 
     110                        //if (mInputDevice->isKeyDown(Ogre::KC_RIGHT)) 
     111                        //{ 
     112                        //      mCamera->yaw(-mRotScale); 
     113                        //} 
     114                        // 
     115                        //if (mInputDevice->isKeyDown(Ogre::KC_LEFT)) 
     116                        //{ 
     117                        //      mCamera->yaw(mRotScale); 
     118                        //} 
    106119 
    107120                        // see if switching is on, and you want to toggle  
     
    186199                                mWindow->setDebugText("P: " + Ogre::StringConverter::toString(mCamera->getDerivedPosition()) + " " +  
    187200                                        "O: " + Ogre::StringConverter::toString(mCamera->getDerivedOrientation())); 
    188                         } 
     201                        }                        
    189202 
    190203                        // Return true to continue rendering 
     
    201214 
    202215                        Ogre::SceneNode* sNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); 
    203                         //mBillboardCloudEntity = mSceneMgr->createEntity(mBillboardCloudMeshName, mBillboardCloudMeshName);             
    204                         mBillboardCloudEntity = mSceneMgr->createEntity("chestnutLeavesBillboardCloudGrouped.mesh", "chestnutLeavesBillboardCloudGrouped.mesh"); 
     216                        mBillboardCloudEntity = mSceneMgr->createEntity(mBillboardCloudMeshName, mBillboardCloudMeshName);               
     217                        //mBillboardCloudEntity = mSceneMgr->createEntity("chestnutLeavesBillboardCloudGrouped.mesh", "chestnutLeavesBillboardCloudGrouped.mesh"); 
    205218                        //mBillboardCloudEntity = mSceneMgr->createEntity("mapleLeavesBillboardCloudGrouped.mesh", "mapleLeavesBillboardCloudGrouped.mesh");             
    206219                        //mBillboardCloudEntity = mSceneMgr->createEntity("prunusLeavesBillboardCloudGrouped.mesh", "prunusLeavesBillboardCloudGrouped.mesh");           
    207220                        sNode->attachObject(mBillboardCloudEntity); 
    208                         sNode->rotate(Ogre::Vector3::UNIT_X, Ogre::Radian(Ogre::Degree(-90.0))); 
     221                        //sNode->rotate(Ogre::Vector3::UNIT_X, Ogre::Radian(Ogre::Degree(-90.0))); 
    209222                } 
    210223 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCClusterViewMode.h

    r821 r861  
    3838 
    3939                        Ogre::SceneNode* sNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); 
    40                         //Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity(mEntityClustersMeshName, mEntityClustersMeshName);                                        
    41                         Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity("chestnutLeafClustersGrouped.mesh", "chestnutLeafClustersGrouped.mesh");                                                            
     40                        Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity(mEntityClustersMeshName, mEntityClustersMeshName);                                  
     41                        //Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity("chestnutLeafClustersGrouped.mesh", "chestnutLeafClustersGrouped.mesh");                                                          
    4242                        //Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity("mapleLeafClustersGrouped.mesh", "mapleLeafClustersGrouped.mesh");                                                                
    4343                        //Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity("prunusLeafClustersGrouped.mesh", "prunusLeafClustersGrouped.mesh");                                                              
    4444                        sNode->attachObject(eLeafClustersGrouped);                       
    45                         sNode->rotate(Ogre::Vector3::UNIT_X, Ogre::Radian(Ogre::Degree(-90.0))); 
     45                        //sNode->rotate(Ogre::Vector3::UNIT_X, Ogre::Radian(Ogre::Degree(-90.0))); 
    4646                } 
    4747        protected: 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingDefault_FP20.cg

    r821 r861  
    66             uniform float epsilonY, 
    77             uniform float sourceTextureSize, 
     8             uniform float numSamples, 
     9             uniform float sqrtNumSamples, 
    810             out float4 ocolor: COLOR) 
    911{ 
    1012   ocolor = float4(0.0, 0.0, 0.0, 0.0); 
    1113   float2 epsilon = float2(epsilonX, epsilonY); 
     14   float4 value = tex2D(indirectTexture, subTexCoord).xyzw; 
     15   float2 coords = float2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) ); 
    1216 
    13    float2 coords = float2(0.0, 1.0) - abs(texCoord - ( tex2D(indirectTexture, subTexCoord).xy - epsilon ) ); 
    14  
    15    if (tex2D(indirectTexture, subTexCoord).z != 0.0)  
    16    {        
    17         ocolor = float4(tex2D(sourceTexture, coords * sourceTextureSize).xyzw); 
     17   if (value.z != 0.0)  
     18   {     
     19        float2 newcoord = value.zw + ((coords * sourceTextureSize) / sqrtNumSamples); 
     20        ocolor = float4(tex2D(sourceTexture, newcoord).xyzw); 
    1821   } 
    1922} 
    20  
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingDefault_glsl_FP20.shd

    r821 r861  
    44uniform float epsilonY; 
    55uniform float sourceTextureSize; 
     6uniform float numSamples; 
     7uniform float sqrtNumSamples; 
    68 
    79void main(void) 
     
    1113   vec2 texCoord = gl_TexCoord[0].xy; 
    1214   vec2 subTexCoord = gl_TexCoord[1].xy;    
    13    vec2 coords = vec2(0.0, 1.0) - abs(texCoord - ( texture2D(indirectTexture, subTexCoord ).xy - epsilon ) ); 
     15   vec4 value = texture2D(indirectTexture, subTexCoord).xyzw; 
     16   vec2 coords = vec2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) ); 
    1417 
    15    if (texture2D(indirectTexture, subTexCoord).z != 0.0)  
     18   if (value.z != 0.0)  
    1619   {        
    17         ocolor = texture2D(sourceTexture, coords * sourceTextureSize).xyzw; 
     20        vec2 newcoord = value.zw + ((coords * sourceTextureSize) / sqrtNumSamples); 
     21        ocolor = vec4(texture2D(sourceTexture, newcoord).xyzw); 
    1822   } 
    19  
    2023   gl_FragColor = ocolor;  
    2124}    
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingDefault_hlsl_FP20.shd

    r821 r861  
    55uniform float epsilonY; 
    66uniform float sourceTextureSize; 
     7uniform float numSamples; 
     8uniform float sqrtNumSamples; 
    79 
    810float4 main_fp(float2 texCoord: TEXCOORD0,  
     
    1113   float4 ocolor = float4(0.0, 0.0, 0.0, 0.0); 
    1214   float2 epsilon = float2(epsilonX, epsilonY); 
     15   float4 value = tex2D(indirectTexture, subTexCoord).xyzw; 
     16   float2 coords = float2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) ); 
    1317 
    14    float2 coords = float2(0.0, 1.0) - abs(texCoord - ( tex2D(indirectTexture, subTexCoord).xy - epsilon ) ); 
    15  
    16    if (tex2D(indirectTexture, subTexCoord).z != 0.0)  
    17    {        
    18         ocolor = float4(tex2D(sourceTexture, coords * sourceTextureSize).xyzw); 
     18   if (value.w != 0.0)  
     19   {     
     20        float2 newcoord = value.zw + ((coords * sourceTextureSize) / sqrtNumSamples); 
     21        ocolor = float4(tex2D(sourceTexture, newcoord).xyzw); 
    1922   } 
    2023 
    2124   return  ocolor; 
    2225} 
    23  
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingPointBasedGeneration_FP20.cg

    r786 r861  
    11void main(float4 colour: COLOR0, 
    2           uniform float textureSize, 
     2          float4 texCoord: TEXCOORD0, 
    33          out float4 ocolor: COLOR) 
    44{ 
    5         ocolor = float4(0.0, 0.0, 1.0 - (1.0/textureSize), 1.0 - (1.0/textureSize)); 
     5        ocolor = float4(0.0, 0.0, texCoord.xy); 
    66} 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/scripts/IBRBillboardCloudTreeGenerator.vcproj

    r778 r861  
    2222                                AdditionalOptions="/D "TIXML_USE_STL" /D "OBA_LIB_BUILD"  /D "IMG_LIB_BUILD"" 
    2323                                Optimization="0" 
    24                                 AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Samples/Common/include";"$(OGRE_PATH)/Tools/XMLConverter/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA;D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include" 
     24                                AdditionalIncludeDirectories="../../../../../../../OGRE/trunk/ogrenew/OgreMain/include;../../../../../../../OGRE/trunk/ogrenew/Samples/Common/include;../../../../../../../OGRE/trunk/ogrenew/Tools/XMLConverter/include;../include/IMG;../include/BBC;../include/LBBC;../include/OBA;../../../../../../../NonGTP\Boost;../../../../../../../NonGTP\ImageDebugger\include" 
    2525                                PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;_MT" 
    2626                                MinimalRebuild="TRUE" 
     
    4444                                LinkIncremental="2" 
    4545                                SuppressStartupBanner="TRUE" 
    46                                 AdditionalLibraryDirectories=""$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";"$(OGRE_PATH)/OgreMain/lib/Release";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib" 
     46                                AdditionalLibraryDirectories=""../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/$(ConfigurationName)";../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/Release;../../../../../../../NonGTP\ImageDebugger\lib" 
    4747                                IgnoreDefaultLibraryNames="LIBCD;LIBCMTD" 
    4848                                GenerateDebugInformation="TRUE" 
     
    8181                                Name="VCCLCompilerTool" 
    8282                                AdditionalOptions="/D "TIXML_USE_STL" /D "TIXML_USE_STL" /D "OBA_LIB_BUILD"  /D "IMG_LIB_BUILD"" 
    83                                 AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";"$(OGRE_PATH)/Samples/Common/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA;D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include" 
     83                                AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";"$(OGRE_PATH)/Samples/Common/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA;../../../../../../../NonGTP\Boost;../../../../../../../NonGTP\ImageDebugger\include" 
    8484                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB" 
    8585                                RuntimeLibrary="2" 
     
    9797                                LinkIncremental="1" 
    9898                                SuppressStartupBanner="TRUE" 
    99                                 AdditionalLibraryDirectories=""$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib" 
     99                                AdditionalLibraryDirectories=""../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/$(ConfigurationName)";../../../../../../../NonGTP\ImageDebugger\lib" 
    100100                                SubSystem="1" 
    101101                                OptimizeReferences="2" 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/scripts/IBRBillboardCloudTreeGeneratorCommandLine.vcproj

    r751 r861  
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories="../include;../include/BBC;../include/IMG;../include/OBA;../include/LBBC;"$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include" 
     22                                AdditionalIncludeDirectories="../include;../include/BBC;../include/IMG;../include/OBA;../include/LBBC;../../../../../../../OGRE/trunk/ogrenew/OgreMain/include;../../../../../../../OGRE/trunk/ogrenew/Tools/XMLConverter/include;../../../../../../../NonGTP/Boost;../../../../../../../NonGTP/ImageDebugger\include" 
    2323                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" 
    2424                                MinimalRebuild="TRUE" 
     
    3737                                OutputFile="$(OutDir)/IBRBillboardCloudTreeGeneratorCmd_d.exe" 
    3838                                LinkIncremental="2" 
    39                                 AdditionalLibraryDirectories=""../bin/$(ConfigurationName)";"$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";"$(OGRE_PATH)/OgreMain/lib/Release";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib" 
     39                                AdditionalLibraryDirectories=""../bin/$(ConfigurationName)";"../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/$(ConfigurationName)";../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/Release;../../../../../../../NonGTP\ImageDebugger\lib" 
    4040                                GenerateDebugInformation="TRUE" 
    4141                                ProgramDatabaseFile="$(OutDir)/scripts.pdb" 
     
    7171                        <Tool 
    7272                                Name="VCCLCompilerTool" 
    73                                 AdditionalIncludeDirectories="../include;../include/OBA;../include/BBC;../include/IMG;../include/LBBC;&quot;$(OGRE_PATH)/OgreMain/include&quot;;&quot;$(OGRE_PATH)/Tools/XMLConverter/include&quot;;D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include" 
     73                                AdditionalIncludeDirectories="../include;../include/OBA;../include/BBC;../include/IMG;../include/LBBC;../../../../../../../OGRE/trunk/ogrenew/OgreMain/include;../../../../../../../OGRE/trunk/ogrenew/Tools/XMLConverter/include;../../../../../../../NonGTP\Boost;../../../../../../../NonGTP\ImageDebugger\include" 
    7474                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" 
    7575                                RuntimeLibrary="0" 
     
    8686                                OutputFile="$(OutDir)/IBRBillboardCloudTreeGeneratorCmd.exe" 
    8787                                LinkIncremental="1" 
    88                                 AdditionalLibraryDirectories="&quot;../bin/$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)&quot;;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib" 
     88                                AdditionalLibraryDirectories="&quot;../bin/$(ConfigurationName)&quot;;&quot;../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/$(ConfigurationName)&quot;;../../../../../../../NonGTP\ImageDebugger\lib" 
    8989                                GenerateDebugInformation="TRUE" 
    9090                                SubSystem="1" 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IBRBillboardCloudTreeApplication.cpp

    r778 r861  
    206206 
    207207        { 
     208                LBBC::EntityTextureAtlasViewMode *textureAtlasFrameListenerMode; 
     209                textureAtlasFrameListenerMode = new LBBC::EntityTextureAtlasViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); 
     210                textureAtlasFrameListenerMode->chooseSceneManager(); 
     211                textureAtlasFrameListenerMode->createCamera(); 
     212                textureAtlasFrameListenerMode->createViewports(); 
     213                textureAtlasFrameListenerMode->setTextureAtlasSize(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasSize()); 
     214                textureAtlasFrameListenerMode->setTextureAtlasBitRange(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasBitRange()); 
     215                textureAtlasFrameListenerMode->setTextureAtlasNumSamples(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasNumSamples()); 
     216                textureAtlasFrameListenerMode->setTextureName(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureName()); 
     217                textureAtlasFrameListenerMode->setTextureAtlasName(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasName()); 
     218                textureAtlasFrameListenerMode->setTextureAtlasFolder(mSampleConfigFile->getBillboardCloudFolder()); 
     219 
     220                mFrameListener->addFrameListenerMode(textureAtlasFrameListenerMode); 
     221                textureAtlasFrameListenerMode->createScene(); 
     222        } 
     223 
     224        { 
    208225                LBBC::BillboardViewMode *anotherFrameListenerMode; 
    209226                anotherFrameListenerMode = new LBBC::BillboardViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); 
     
    211228                anotherFrameListenerMode->createCamera(); 
    212229                anotherFrameListenerMode->createViewports(); 
    213                 //anotherFrameListenerMode->setBillboardCloudMeshName(mSampleConfigFile->getBillboardCloudGroupedMeshName()); 
     230                anotherFrameListenerMode->setBillboardCloudMeshName(mSampleConfigFile->getBillboardCloudGroupedMeshName()); 
    214231                anotherFrameListenerMode->createScene(); 
    215232                mFrameListener->addFrameListenerMode(anotherFrameListenerMode); 
     
    222239                anotherFrameListenerMode->createCamera(); 
    223240                anotherFrameListenerMode->createViewports(); 
    224                 //anotherFrameListenerMode->setEntityClustersMeshName(mSampleConfigFile->getEntityClustersGroupedMeshName()); 
     241                anotherFrameListenerMode->setEntityClustersMeshName(mSampleConfigFile->getEntityClustersGroupedMeshName()); 
    225242                anotherFrameListenerMode->createScene(); 
    226243                mFrameListener->addFrameListenerMode(anotherFrameListenerMode); 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IBRBillboardCloudTreeFrameListener.cpp

    r721 r861  
    22#include "IBRBillboardCloudTreeFrameListener.h" 
    33 
     4IBRBillboardCloudTreeFrameListener::IBRBillboardCloudTreeFrameListener(Ogre::RenderWindow *win, bool useBufferedInputKeys, bool useBufferedInputMouse) 
     5    : OgreFrameListener(win, useBufferedInputKeys, useBufferedInputMouse) 
     6{ 
     7} 
     8 
     9IBRBillboardCloudTreeFrameListener::~IBRBillboardCloudTreeFrameListener()         
     10{ 
     11} 
     12 
     13bool IBRBillboardCloudTreeFrameListener::frameStarted(const Ogre::FrameEvent& evt) 
     14{            
     15        if (!mInputTypeSwitchingOn) 
     16        { 
     17                mInputDevice->capture(); 
     18        } 
     19 
     20        if ( !mUseBufferedInputMouse || !mUseBufferedInputKeys) 
     21        { 
     22                // one of the input modes is immediate, so setup what is needed for immediate mouse/key movement 
     23                if (mTimeUntilNextToggle >= 0)  
     24                { 
     25                        mTimeUntilNextToggle -= evt.timeSinceLastFrame; 
     26                } 
     27        } 
     28 
     29        if (mUseBufferedInputKeys) 
     30        { 
     31                // no need to do any processing here, it is handled by event processor and  
     32                // you get the results as KeyEvents 
     33        } 
     34        else 
     35        { 
     36                if (processUnbufferedKeyInput(evt) == false) 
     37                { 
     38                        return false; 
     39                } 
     40        } 
     41 
     42        //mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName() + " -- " + Ogre::StringConverter::toString(mTimeUntilNextToggle)); 
     43 
     44        return mDefaultOgreFrameListenerMode->frameStarted(evt,mInputDevice); 
     45} 
     46 
     47bool IBRBillboardCloudTreeFrameListener::processUnbufferedKeyInput(const Ogre::FrameEvent& evt) 
     48{ 
     49        if( mInputDevice->isKeyDown(Ogre::KC_ESCAPE) ) 
     50        {             
     51                return false; 
     52        } 
     53 
     54        if (mInputDevice->isKeyDown(Ogre::KC_F1)) 
     55        {                
     56                mCurrentOgreFrameListenerMode = 0;               
     57                this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 
     58                mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 
     59 
     60                //mTimeUntilNextToggle = 0.25;           
     61        } 
     62 
     63        if (mInputDevice->isKeyDown(Ogre::KC_F2)) 
     64        {                
     65                mCurrentOgreFrameListenerMode = 1;               
     66                this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 
     67                mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 
     68 
     69                //mTimeUntilNextToggle = 0.25;           
     70        } 
     71 
     72        if (mInputDevice->isKeyDown(Ogre::KC_F3)) 
     73        {                
     74                mCurrentOgreFrameListenerMode = 2; 
     75                this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 
     76                mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 
     77 
     78                //mTimeUntilNextToggle = 0.25;           
     79        } 
     80 
     81        if (mInputDevice->isKeyDown(Ogre::KC_F4)) 
     82        {                
     83                mCurrentOgreFrameListenerMode = 3; 
     84                this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 
     85                mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 
     86 
     87                //mTimeUntilNextToggle = 0.25;           
     88        } 
     89 
     90        if (mInputDevice->isKeyDown(Ogre::KC_F5)) 
     91        {                
     92                mCurrentOgreFrameListenerMode = 4; 
     93                this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 
     94                mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 
     95 
     96                //mTimeUntilNextToggle = 0.25;           
     97        } 
     98 
     99        // Return true to continue rendering 
     100        return true; 
     101} 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCBillboardCloudIndirectTextureViewMode.cpp

    r821 r861  
    164164        Ogre::GpuProgramParametersSharedPtr fragParams; 
    165165         
    166         fragParams = mBillboardCloudPointClusters->getSubEntity(mCurrentTexture % mBillboardCloudPointClusters->getNumSubEntities())->getMaterial()->getTechnique(0)->getPass(0)->getFragmentProgramParameters(); 
    167         fragParams->setNamedConstant("textureSize", (Ogre::Real)mTextureSize); 
    168         mBillboardCloudPointClusters->getSubEntity(mCurrentTexture % mBillboardCloudPointClusters->getNumSubEntities())->getMaterial()->reload(); 
    169          
    170166        if (mDebugTextureAtlasGeneration) 
    171167        { 
     
    403399 
    404400        mTextureAtlas = IMG::TextureAtlasPtr( new IMG::TextureAtlas() ); 
    405         mTextureAtlas->create("IndirectTextureAtlas", mTextureAtlasSize, mTextureAtlasSize, mSrcPixelFormat, mCamera, Ogre::ColourValue(0.0, 0.0, 0.0)); 
     401        mTextureAtlas->create("IndirectTextureAtlas", mTextureAtlasSize, mTextureAtlasSize, mSrcPixelFormat, mCamera, Ogre::ColourValue(0.0, 0.0, 0.0, 0.0)); 
    406402        mTextureAtlas->setTextureAtlasSceneNode(mBillboardCloudPointClustersSceneNode); 
    407403        Ogre::MaterialPtr materialPtr1 = Ogre::MaterialManager::getSingleton().create("IndirectTextureAtlasMaterial", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);          
     
    415411 
    416412        mClusterTexture = IMG::TexturePtr( new IMG::Texture() ); 
    417         mClusterTexture->create("ClusterIndirectTexture", mTextureSize, mTextureSize, mSrcPixelFormat, mCamera, Ogre::ColourValue(0.0, 0.0, 0.0)); 
     413        mClusterTexture->create("ClusterIndirectTexture", mTextureSize, mTextureSize, mSrcPixelFormat, mCamera, Ogre::ColourValue(0.0, 0.0, 0.0, 0.0)); 
    418414        Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().create("IndirectTextureMaterial", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);                        
    419415        if (!mDebugTextureAtlasGeneration) 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCManager.cpp

    r778 r861  
    192192void LBBCManager::generateEntityDistribution() 
    193193{ 
    194         if (mSampleConfigFile->getEntityDistributionGeneration()) 
    195         { 
    196                 createEntityDistribution(); 
    197                 saveEntityDistributionSplitted(); 
    198                 saveEntityDistributionXML(); 
    199         } 
     194        createEntityDistribution(); 
     195        saveEntityDistributionSplitted(); 
     196        saveEntityDistributionXML(); 
    200197} 
    201198 
     
    552549 
    553550                                //vertex.uv[0] = Ogre::Vector3(wDistance / width, hDistance / height, 0.0); 
    554                                 vertex.uv[0] = Ogre::Vector3(1.0 - (hDistance / height), 1.0 - (wDistance / width), 0.0); 
     551                                //vertex.uv[0] = Ogre::Vector3(1.0 - (hDistance / height), 1.0 - (wDistance / width), 0.0); 
     552                                Ogre::Real numSamples = mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasNumSamples(); 
     553                                Ogre::Real randomInt = Ogre::Math::Ceil(Ogre::Math::RangeRandom(0.5,numSamples)); 
     554 
     555                                Ogre::Vector2 topLeftCorner[16]; 
     556                                topLeftCorner[0] = Ogre::Vector2(0.0,  0.0); 
     557                                topLeftCorner[1] = Ogre::Vector2(0.25, 0.0); 
     558                                topLeftCorner[2] = Ogre::Vector2(0.5,  0.0); 
     559                                topLeftCorner[3] = Ogre::Vector2(0.75, 0.0); 
     560                                topLeftCorner[4] = Ogre::Vector2(0.0,  0.25); 
     561                                topLeftCorner[5] = Ogre::Vector2(0.25, 0.25); 
     562                                topLeftCorner[6] = Ogre::Vector2(0.5,  0.25); 
     563                                topLeftCorner[7] = Ogre::Vector2(0.75, 0.25); 
     564                                topLeftCorner[8] = Ogre::Vector2(0.0,  0.5); 
     565                                topLeftCorner[9] = Ogre::Vector2(0.25, 0.5); 
     566                                topLeftCorner[10] = Ogre::Vector2(0.5,  0.5); 
     567                                topLeftCorner[11] = Ogre::Vector2(0.75, 0.5); 
     568                                topLeftCorner[12] = Ogre::Vector2(0.0,  0.75); 
     569                                topLeftCorner[13] = Ogre::Vector2(0.25, 0.75); 
     570                                topLeftCorner[14] = Ogre::Vector2(0.5,  0.75); 
     571                                topLeftCorner[15] = Ogre::Vector2(0.75, 0.75); 
     572 
     573                                //vertex.uv[0] = Ogre::Vector3(randomInt / numSamples, 0.0, 0.0); 
     574                                 
     575                                vertex.uv[0] = Ogre::Vector3(1.0 - topLeftCorner[(unsigned int)randomInt-1][0], 1.0 - topLeftCorner[(unsigned int)randomInt-1][1], 0.0); 
    555576                                vertex.colour = Ogre::ColourValue(Ogre::Math::RangeRandom(0.0, 1.0), Ogre::Math::RangeRandom(0.0, 1.0), Ogre::Math::RangeRandom(0.0, 1.0), 1.0).getAsRGBA();  
    556577                                entity->getSubEntity(numSubEntities)->addUniqueVertex(vertex); 
Note: See TracChangeset for help on using the changeset viewer.