Changeset 2823


Ignore:
Timestamp:
07/08/08 13:03:12 (16 years ago)
Author:
mattausch
Message:

debug version providing not instanted geometryx

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.h

    r2795 r2823  
    1616class Geometry 
    1717{ 
     18friend class ResourceManager; 
     19 
    1820public: 
    1921        /** Constructor taking an array of triangles. 
    2022        */ 
    21         Geometry(Vector3 *vertices, Vector3 *normals, float *texcoords, int numVertices, bool delData); 
     23        Geometry(Vector3 *vertices,  
     24                     Vector3 *normals,  
     25                         float *texcoords,  
     26                         int numVertices,  
     27                         bool delData); 
    2228 
    2329        ~Geometry(); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp

    r2817 r2823  
    66#include "Texture.h" 
    77#include "gzstream.h" 
     8#include "Matrix4x4.h" 
     9#include "Vector3.h" 
    810 
    911 
     
    4143        Matrix4x4 *trafo; 
    4244         
     45        SceneEntity *sceneGeom; 
     46 
    4347        if (!hasTrafo) 
    4448        { 
    4549                trafo = NULL; 
     50                sceneGeom = new SceneEntity(geom, mat, trafo); 
    4651        } 
    4752        else 
     
    5055                str.read(reinterpret_cast<char *>(trafo->x), sizeof(Matrix4x4)); 
    5156                mTrafos.push_back(trafo); 
    52         } 
    53  
    54         SceneEntity *sceneGeom = new SceneEntity(geom, mat, trafo); 
     57#if 0 // use instancing 
     58                Vector3 *vertices = new Vector3[geom->mNumVertices]; 
     59 
     60                for (int i = 0; i < geom->mNumVertices; ++ i) 
     61                { 
     62                        Vector3 v = geom->mVertices[i]; 
     63 
     64                        v = (*trafo) * v; 
     65                        vertices[i] = v; 
     66                } 
     67 
     68                Geometry *tgeom = new Geometry(vertices, geom->mNormals, geom->mTexCoords, geom->mNumVertices, false); 
     69 
     70                sceneGeom = new SceneEntity(tgeom, mat, NULL); 
     71#else 
     72                sceneGeom = new SceneEntity(geom, mat, trafo); 
     73#endif 
     74        } 
    5575 
    5676        return sceneGeom; 
     
    175195        } 
    176196 
    177         return new Geometry(vertices, normals, texcoords, vertexCount, true); 
     197        //return new Geometry(vertices, normals, texcoords, vertexCount, true); 
     198        return new Geometry(vertices, normals, texcoords, vertexCount, false); 
    178199} 
    179200 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.cpp

    r2818 r2823  
    3030        if (mMaterial) mMaterial->Render(state); 
    3131 
     32        static Matrix4x4 identity = IdentityMatrix(); 
     33 
    3234        if (mTransform) 
    3335        { 
     
    3739                mGeometry->Render(state); 
    3840 
     41                cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)identity.x); 
    3942                //glPopMatrix(); 
    4043        } 
    4144        else 
    4245        { 
    43                 static Matrix4x4 identity = IdentityMatrix(); 
    44  
    45                 cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)identity.x); 
    4646                mGeometry->Render(state); 
    4747        } 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r2822 r2823  
    8282 
    8383/// these values get scaled with the frame rate 
    84 const static float keyForwardMotion = 50.0f; 
    85 const static float keyRotation = 2.0f; 
     84const static float keyForwardMotion = 30.0f; 
     85const static float keyRotation = 1.5f; 
    8686 
    8787/// elapsed time in seconds 
     
    503503                sColorsTexParam = cgGetNamedParameter(sCgDeferredProgram, "colors");   
    504504                sNormalsTexParam = cgGetNamedParameter(sCgDeferredProgram, "normals");   
    505                 //sNoiseTexParam = cgGetNamedParameter(sCgDeferredProgram, "noiseTexture"); 
    506  
    507                 //sSamplesParam = cgGetNamedParameter(sCgDeferredProgram, "samples"); 
    508                 //cgGLSetParameterArray2f(sSamplesParam, 0, NUM_SAMPLES, (const float *)samples); 
    509505        } 
    510506        else 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r2822 r2823  
    9696     
    9797    //sample noisetex; r stores costheta, g stores sintheta 
    98     float2 noise = tex2D(noiseTexture, IN.texCoord.xy).xy * 2.0f - 1.0f; 
     98    float2 noise = tex2D(noiseTexture, IN.texCoord.xy * 7.0f).xy * 2.0f - 1.0f; 
    9999         
    100100    // rotation 
Note: See TracChangeset for help on using the changeset viewer.