Changeset 2965


Ignore:
Timestamp:
09/23/08 12:11:29 (16 years ago)
Author:
mattausch
Message:

removed dirttexture stuff. started tonemapping stuff

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
2 added
15 edited

Legend:

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

    r2963 r2965  
    3232        vector<int> nIndices; 
    3333        vector<int> tIndices; 
    34  
    35         //cout << "number of vertices=" << (int)vertices.size() << endl; 
    3634 
    3735        for (size_t i = 0; i < substrings.size(); ++ i) 
     
    142140                geom->mNormals[i].z = faceNormals[i].y; 
    143141 
    144                 if (i <= geom->mTexcoordCount) 
     142                if (i < geom->mTexcoordCount) 
    145143                { 
    146144                        geom->mTexcoords[i].first = faceTexcoords[i].first; 
     
    244242                                                faceVertices, faceNormals, faceTexcoords); 
    245243 
    246                                 if (((line % 100) == 99) &&  
     244                                if (((line % 1000) == 999) &&  
    247245                                        !faceVertices.empty()) 
    248246                                { 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.vcproj

    r2961 r2965  
    283283                                > 
    284284                        </File> 
     285                        <File 
     286                                RelativePath=".\src\ToneMapper.cpp" 
     287                                > 
     288                        </File> 
     289                        <File 
     290                                RelativePath=".\src\ToneMapper.h" 
     291                                > 
     292                        </File> 
    285293                        <Filter 
    286294                                Name="timer" 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp

    r2952 r2965  
    229229        CreateNoiseTex2D(w, h); 
    230230 
     231 
    231232        /////////// 
    232233        //-- the flip-flop fbos 
     
    234235        mFbo = new FrameBufferObject(w, h, FrameBufferObject::DEPTH_NONE); 
    235236 
    236         mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false); 
    237         mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false); 
    238         mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false); 
    239         mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false); 
     237        mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
     238        mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
     239        mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
     240        mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
    240241} 
    241242 
     
    10541055} 
    10551056 
     1057 
     1058 
     1059 
     1060 
    10561061} // namespace 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.h

    r2957 r2965  
    8282        */ 
    8383        void ComputeViewVectors(Vector3 &tl, Vector3 &tr, Vector3 &bl, Vector3 &br); 
    84  
    85  
     84         
    8685 
    8786        //////////// 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp

    r2899 r2965  
    4545 
    4646ColorBufferObject::ColorBufferObject(int w, int h,  
     47                                                                         int attachment_idx, 
    4748                                                                         FORMAT format,  
    4849                                                                         WRAP_TYPE wrapType,  
    4950                                                                         FILTER_TYPE filterType,  
    50                                                                          bool useMipMap,  
    51                                                                          int attachment_idx) 
    52 { 
    53         GLuint glformat, internalFormat; 
    54  
     51                                                                         FILTER_TYPE filterTypeMipMap  
     52                                                                         ) 
     53{ 
     54        Init(w, h, attachment_idx, format, wrapType, filterType, true, filterTypeMipMap); 
     55} 
     56 
     57 
     58ColorBufferObject::ColorBufferObject(int w, int h,  
     59                                                                         int attachment_idx, 
     60                                                                         FORMAT format,  
     61                                                                         WRAP_TYPE wrapType,  
     62                                                                         FILTER_TYPE filterType 
     63                                                                         ) 
     64{ 
     65        Init(w, h, attachment_idx, format, wrapType, filterType, false, FILTER_NEAREST); 
     66} 
     67 
     68 
     69ColorBufferObject::~ColorBufferObject() 
     70{ 
     71        glDeleteRenderbuffersEXT(1, &mId); 
     72        glDeleteTextures(1, &mTexId); 
     73} 
     74 
     75 
     76void ColorBufferObject::Init(int w, int h,  
     77                                                         int attachment_idx, 
     78                                                         FORMAT format,  
     79                                                         WRAP_TYPE wrapType,  
     80                                                         FILTER_TYPE filterType,  
     81                                                         bool useMipMap,  
     82                                                         FILTER_TYPE filterTypeMipMap 
     83                                                         ) 
     84{ 
     85        mWidth = w; 
     86        mHeight = h; 
    5587 
    5688        switch (format) 
    5789        { 
    5890        case BUFFER_UBYTE: 
    59                 glformat = GL_UNSIGNED_BYTE; internalFormat = GL_RGBA8; break; 
     91                mGlFormat = GL_UNSIGNED_BYTE; mInternalFormat = GL_RGBA8; break; 
    6092        case BUFFER_FLOAT_16: 
    61                 glformat = GL_FLOAT; internalFormat = GL_RGBA16F_ARB; break; 
     93                mGlFormat = GL_FLOAT; mInternalFormat = GL_RGBA16F_ARB; break; 
    6294        case BUFFER_FLOAT_32:  
    63                 glformat = GL_FLOAT; internalFormat = GL_RGBA32F_ARB; break; 
     95                mGlFormat = GL_FLOAT; mInternalFormat = GL_RGBA32F_ARB; break; 
    6496        default: 
    65                 glformat = GL_UNSIGNED_BYTE; internalFormat = GL_RGBA8; 
     97                mGlFormat = GL_UNSIGNED_BYTE; mInternalFormat = GL_RGBA8; 
    6698                cerr << "should not come here" << endl; 
    6799        } 
     
    71103        glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mId); 
    72104         
    73         glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, internalFormat, w, h); 
     105        glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, mInternalFormat, w, h); 
    74106        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, mrt[attachment_idx], GL_RENDERBUFFER_EXT, mId); 
    75107 
     
    77109        glGenTextures(1, &mTexId); 
    78110        glBindTexture(GL_TEXTURE_2D, mTexId); 
    79         glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, w, h, 0, GL_RGBA, glformat, NULL); 
     111        glTexImage2D(GL_TEXTURE_2D, 0, mInternalFormat, w, h, 0, GL_RGBA, mGlFormat, NULL); 
    80112 
    81113        glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, mrt[attachment_idx], GL_TEXTURE_2D, mTexId, 0); 
     
    84116        GLuint magfilterParam; 
    85117 
    86         switch (filterType) 
    87         { 
    88         case FILTER_NEAREST: 
    89                 minfilterParam = GL_NEAREST; 
    90                 magfilterParam = GL_NEAREST; break; 
    91         case FILTER_LINEAR: 
    92                 minfilterParam = GL_LINEAR; 
    93                 magfilterParam = GL_LINEAR; break; 
    94         case FILTER_MIPMAP_LINEAR:  
    95                 minfilterParam = GL_NEAREST_MIPMAP_NEAREST; 
    96                 magfilterParam = GL_NEAREST;  
    97  
    98                 //minfilterParam = GL_LINEAR_MIPMAP_NEAREST; 
    99                 //magfilterParam = GL_LINEAR;  
    100                 break; 
    101         default: 
    102                 minfilterParam = GL_NEAREST; 
     118        if (filterType == FILTER_NEAREST) 
    103119                magfilterParam = GL_NEAREST; 
    104  
    105                 cerr << "should not come here" << endl; 
    106         } 
    107  
    108          
     120        else // FILTER_LINEAR 
     121                magfilterParam = GL_LINEAR;  
     122 
     123        if (!useMipMap) 
     124        { 
     125                if (filterType == FILTER_NEAREST) 
     126                        minfilterParam = GL_NEAREST; 
     127                else // FILTER_LINEAR 
     128                        minfilterParam = GL_LINEAR; 
     129        } 
     130        else 
     131        { 
     132                if (filterType == FILTER_NEAREST) 
     133                { 
     134                        if (filterTypeMipMap == FILTER_NEAREST) 
     135                                minfilterParam = GL_NEAREST_MIPMAP_NEAREST; 
     136                        else // FILTER_LINEAR 
     137                                minfilterParam = GL_NEAREST_MIPMAP_LINEAR; 
     138                } 
     139                else // FILTER_LINEAR 
     140                { 
     141                        if (filterTypeMipMap == FILTER_NEAREST) 
     142                                minfilterParam = GL_LINEAR_MIPMAP_NEAREST; 
     143                        else // FILTER_LINEAR 
     144                                minfilterParam = GL_LINEAR_MIPMAP_LINEAR; 
     145                } 
     146        } 
     147 
    109148        GLuint wrapParam; 
    110149 
     
    130169 
    131170 
    132 ColorBufferObject::~ColorBufferObject() 
    133 { 
    134         glDeleteRenderbuffersEXT(1, &mId); 
    135         glDeleteTextures(1, &mTexId); 
    136 } 
     171 
     172void *ColorBufferObject::ReadTexture() const 
     173{ 
     174        int bytes = 0; 
     175 
     176        switch (mInternalFormat) 
     177        { 
     178        case GL_RGBA8: 
     179                bytes = 8; break; 
     180        case GL_RGBA16F_ARB: 
     181                bytes = 16; break; 
     182        case GL_RGBA32F_ARB:  
     183                bytes = 32; break; 
     184        default: 
     185                cerr << "should not come here" << endl; 
     186        } 
     187 
     188        unsigned char *data = new unsigned char[bytes * 4 * mWidth * mHeight]; 
     189 
     190        glEnable(GL_TEXTURE_2D); 
     191        glBindTexture(GL_TEXTURE_2D, mTexId); 
     192 
     193        glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, mGlFormat, data); 
     194 
     195        glBindTexture(GL_TEXTURE_2D, 0); 
     196        glDisable(GL_TEXTURE_2D); 
     197 
     198        return data; 
     199} 
     200 
     201 
     202/*****************************************************************/ 
     203/*                 FrameBufferObject implementation              */ 
     204/*****************************************************************/ 
    137205 
    138206 
     
    143211         
    144212        Bind(); 
    145  
    146213        /////////// 
    147214        //-- create depth buffer 
     
    181248                        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 
    182249                        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 
     250 
    183251                        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 
    184252 
     
    207275                                                                          ColorBufferObject::WRAP_TYPE wrapType,  
    208276                                                                          ColorBufferObject::FILTER_TYPE filterType,  
    209                                                                           bool useMipMap) 
     277                                                                          ColorBufferObject::FILTER_TYPE filterTypeMipMap) 
    210278{ 
    211279        Bind(); 
     
    214282 
    215283        ColorBufferObject *colorBuf =  
    216                 new ColorBufferObject(mWidth, mHeight, col, wrapType, filterType, useMipMap, idx); 
     284                new ColorBufferObject(mWidth, mHeight, idx, col, wrapType, filterType, filterTypeMipMap); 
    217285 
    218286        mColorBuffers.push_back(colorBuf); 
     
    224292 
    225293 
     294 
     295int FrameBufferObject::AddColorBuffer(ColorBufferObject::FORMAT col,  
     296                                                                          ColorBufferObject::WRAP_TYPE wrapType,  
     297                                                                          ColorBufferObject::FILTER_TYPE filterType) 
     298{ 
     299        Bind(); 
     300 
     301        const int idx = (int)mColorBuffers.size(); 
     302 
     303        ColorBufferObject *colorBuf =  
     304                new ColorBufferObject(mWidth, mHeight, idx, col, wrapType, filterType); 
     305 
     306        mColorBuffers.push_back(colorBuf); 
     307 
     308        Release(); 
     309 
     310        return idx; 
     311} 
     312 
     313 
    226314void FrameBufferObject::Bind() const 
    227315{ 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.h

    r2957 r2965  
    1616 
    1717        enum FORMAT { BUFFER_UBYTE, BUFFER_FLOAT_16, BUFFER_FLOAT_32 }; 
    18         enum WRAP_TYPE{ WRAP_REPEAT, WRAP_CLAMP_TO_EDGE }; 
    19         enum FILTER_TYPE { FILTER_NEAREST, FILTER_LINEAR, FILTER_MIPMAP_LINEAR }; 
     18        enum WRAP_TYPE { WRAP_REPEAT, WRAP_CLAMP_TO_EDGE }; 
     19        enum FILTER_TYPE { FILTER_NEAREST, FILTER_LINEAR }; 
    2020 
     21 
     22        /** Creates color buffer without mipmap. attachment_idx describes 
     23                the number of the render target the buffer is attached to 
     24        */ 
    2125        ColorBufferObject(int w, int h,  
    22                               FORMAT c,  
     26                              int attachment_idx  ,            
     27                                          FORMAT c,  
     28                                          WRAP_TYPE wrapType,  
     29                                          FILTER_TYPE filterType); 
     30 
     31        /** Same as above, with mipmapping enabled. 
     32        */ 
     33        ColorBufferObject(int w, int h,  
     34                              int attachment_idx,         
     35                                          FORMAT c,  
    2336                                          WRAP_TYPE wrapType,  
    2437                                          FILTER_TYPE filterType,  
    25                                           bool useMipMap,  
    26                                           int attachment_idx); 
     38                                          FILTER_TYPE filterTypeMipMap 
     39                                          ); 
    2740 
    2841        ~ColorBufferObject(); 
    2942 
    30         unsigned int GetTexture() const {return mTexId;} 
     43        unsigned int GetTexture() const { return mTexId; } 
     44 
     45        /** Returns texture data. 
     46        */ 
     47        void *ReadTexture() const; 
     48 
    3149 
    3250protected: 
    3351 
     52        void Init(int w, int h,  
     53                      int attachment_idx, 
     54                      FORMAT format,  
     55                          WRAP_TYPE wrapType,  
     56                          FILTER_TYPE filterType,  
     57                          bool useMipMap,  
     58                          FILTER_TYPE filterTypeMipMap 
     59                          ); 
     60 
     61 
     62 
     63        /////////// 
     64 
     65        int mGlFormat; 
     66        int mInternalFormat; 
    3467        unsigned int mId; 
    3568        unsigned int mTexId; 
     69 
     70        int mWidth; 
     71        int mHeight; 
    3672}; 
    3773 
     
    4379public: 
    4480 
    45         enum DEPTH_FORMAT { DEPTH_NONE, DEPTH_16, DEPTH_24, DEPTH_32 }; 
     81        enum DEPTH_FORMAT {DEPTH_NONE, DEPTH_16, DEPTH_24, DEPTH_32}; 
    4682 
    4783        /** constructor requesting an opengl occlusion query. 
     
    5591        int AddColorBuffer(ColorBufferObject::FORMAT col,  
    5692                               ColorBufferObject::WRAP_TYPE wrapType,  
    57                                            ColorBufferObject::FILTER_TYPE filterType,  
    58                                            bool useMipMap); 
     93                                           ColorBufferObject::FILTER_TYPE filterType); 
     94 
     95        /** Same as above, but enables mipmapping using the specified filter. 
     96        */ 
     97        int AddColorBuffer(ColorBufferObject::FORMAT col,  
     98                               ColorBufferObject::WRAP_TYPE wrapType,  
     99                                           ColorBufferObject::FILTER_TYPE filterType, 
     100                                           ColorBufferObject::FILTER_TYPE filterTypeMipMap); 
    59101 
    60102        /** Returns the color buffer object on position i. 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Material.cpp

    r2964 r2965  
    6565                        cgGLSetTextureParameter(RenderState::sTexParam, mTexture->GetId()); 
    6666                        cgGLEnableTextureParameter(RenderState::sTexParam); 
    67                         cgGLEnableTextureParameter(RenderState::sDirtTexParamTex); 
    6867                } 
    6968                else 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.cpp

    r2964 r2965  
    1414CGprogram RenderState::sCgMrtFragmentTexProgram = NULL; 
    1515CGparameter RenderState::sTexParam; 
    16 CGparameter RenderState::sDirtTexParamTex; 
    1716 
    1817 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.h

    r2964 r2965  
    8383        static CGparameter sTexParam; 
    8484 
    85         static CGparameter sDirtTexParamTex; 
    86  
    8785protected: 
    8886 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.cpp

    r2957 r2965  
    1111 
    1212 
    13  
    14  
    1513using namespace std; 
    1614 
    1715const static int texWidth = 2048; 
    1816const static int texHeight = 2048; 
    19  
    20  
    2117 
    2218 
     
    143139 
    144140        FrameBufferObject *fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_32, true); 
    145         fbo->AddColorBuffer(ColorBufferObject::BUFFER_UBYTE, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false); 
     141        fbo->AddColorBuffer(ColorBufferObject::BUFFER_UBYTE,  
     142                                ColorBufferObject::WRAP_CLAMP_TO_EDGE,  
     143                                                ColorBufferObject::FILTER_NEAREST, 
     144                                                ColorBufferObject::FILTER_NEAREST); 
    146145 
    147146 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp

    r2963 r2965  
    141141{ 
    142142        mFbo = new FrameBufferObject(size, size, FrameBufferObject::DEPTH_32, true); 
     143 
    143144        // need a color buffer to keep opengl happy 
    144         mFbo->AddColorBuffer(ColorBufferObject::BUFFER_UBYTE, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false); 
     145        mFbo->AddColorBuffer(ColorBufferObject::BUFFER_UBYTE, 
     146                                 ColorBufferObject::WRAP_CLAMP_TO_EDGE,  
     147                                                 ColorBufferObject::FILTER_NEAREST); 
     148 
    145149 
    146150        mShadowCam = new Camera(mSize, mSize); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.h

    r2963 r2965  
    33 
    44#include "common.h" 
    5 #include "glInterface.h" 
    65#include "AxisAlignedBox3.h" 
    76#include "Matrix4x4.h" 
    8  
    9 #include <Cg/cg.h> 
    10 #include <Cg/cgGL.h> 
    117 
    128 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r2964 r2965  
    168168PerfTimer frameTimer, algTimer; 
    169169 
    170 Texture *dirtTexture = NULL; 
    171170 
    172171 
     
    458457        camera->SetFar(Magnitude(bvh->GetBox().Diagonal())); 
    459458         
    460         dirtTexture = new Texture(model_path + "waterstain.jpg"); 
    461         //dirtTexture = new Texture(model_path + "dirt.jpg"); 
    462         dirtTexture->Create(); 
    463  
    464459        InitCg(); 
    465460 
     
    580575 
    581576                sMaxDepthParamTex = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "maxDepth"); 
    582                 RenderState::sDirtTexParamTex = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "dirtTex"); 
    583577                RenderState::sTexParam = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "tex"); 
    584  
    585                 cgGLEnableTextureParameter(RenderState::sDirtTexParamTex); 
    586                 cgGLSetTextureParameter(RenderState::sDirtTexParamTex, dirtTexture->GetId()); 
    587578 
    588579                cgGLSetParameter1f(sMaxDepthParamTex, MAX_DEPTH_CONST / farDist); 
     
    625616 
    626617        // the diffuse color buffer 
    627         fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_MIPMAP_LINEAR, true); 
     618        fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, ColorBufferObject::FILTER_NEAREST); 
    628619        //fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false); 
    629620 
    630621        // the positions buffer 
    631         fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_MIPMAP_LINEAR, true); 
     622        fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, ColorBufferObject::FILTER_NEAREST); 
    632623        //fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false); 
    633624 
    634625        // the normals buffer 
    635         fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false); 
     626        fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, ColorBufferObject::FILTER_NEAREST); 
    636627 
    637628        // another color buffer 
    638         fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false); 
     629        fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, ColorBufferObject::FILTER_NEAREST); 
    639630 
    640631        PrintGLerror("fbo"); 
     
    659650void InitGLstate()  
    660651{ 
    661         glClearColor(1.4f, 0.4f, 0.4f, 1.0f); 
     652        glClearColor(0.4f, 0.4f, 0.4f, 1.0f); 
    662653         
    663654        glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r2959 r2965  
    186186        return OUT; 
    187187} 
     188 
     189 
     190/*float4 FinalPass( SkyboxVS_Output Input ) : COLOR 
     191{ 
     192        float4 vColor = tex2D( s0, Input.Tex ); 
     193        float3 vBloom = tex2D( s1, Input.Tex ); 
     194 
     195        float vLum = g_fImageKey; 
     196        vColor.rgb = vColor;  
     197          
     198    // Tone mapping 
     199    vColor.rgb *= g_fMiddleGray /(vLum + 0.001f); 
     200    vColor.rgb *= (1.0f + vColor/LUM_WHITE); 
     201        vColor.rgb /= (1.0f + vColor); 
     202         
     203        vColor.rgb += 0.6f * vBloom; 
     204        vColor.a = 1.0f; 
     205         
     206        return vColor; 
     207}*/ 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg

    r2964 r2965  
    7272        pixel pix; 
    7373 
    74         //float4 dirtTexColor = tex2D(dirtTex, IN.texCoord.xy); 
    7574        float4 texColor = tex2D(tex, IN.texCoord.xy); 
    7675 
    7776        // save color in first render target 
    7877        // hack: use comination of emmisive + diffuse (emmisive used as constant ambient term) 
    79         //pix.col = (glstate.material.emission + glstate.material.diffuse) * texColor * dirtTexColor;  
    8078        pix.col = (glstate.material.emission + glstate.material.diffuse) * texColor;  
    8179         
Note: See TracChangeset for help on using the changeset viewer.