Changeset 2823 for GTP/trunk/App/Demos/Vis
- Timestamp:
- 07/08/08 13:03:12 (16 years ago)
- 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 16 16 class Geometry 17 17 { 18 friend class ResourceManager; 19 18 20 public: 19 21 /** Constructor taking an array of triangles. 20 22 */ 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); 22 28 23 29 ~Geometry(); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp
r2817 r2823 6 6 #include "Texture.h" 7 7 #include "gzstream.h" 8 #include "Matrix4x4.h" 9 #include "Vector3.h" 8 10 9 11 … … 41 43 Matrix4x4 *trafo; 42 44 45 SceneEntity *sceneGeom; 46 43 47 if (!hasTrafo) 44 48 { 45 49 trafo = NULL; 50 sceneGeom = new SceneEntity(geom, mat, trafo); 46 51 } 47 52 else … … 50 55 str.read(reinterpret_cast<char *>(trafo->x), sizeof(Matrix4x4)); 51 56 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 } 55 75 56 76 return sceneGeom; … … 175 195 } 176 196 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); 178 199 } 179 200 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.cpp
r2818 r2823 30 30 if (mMaterial) mMaterial->Render(state); 31 31 32 static Matrix4x4 identity = IdentityMatrix(); 33 32 34 if (mTransform) 33 35 { … … 37 39 mGeometry->Render(state); 38 40 41 cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)identity.x); 39 42 //glPopMatrix(); 40 43 } 41 44 else 42 45 { 43 static Matrix4x4 identity = IdentityMatrix();44 45 cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)identity.x);46 46 mGeometry->Render(state); 47 47 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2822 r2823 82 82 83 83 /// these values get scaled with the frame rate 84 const static float keyForwardMotion = 50.0f;85 const static float keyRotation = 2.0f;84 const static float keyForwardMotion = 30.0f; 85 const static float keyRotation = 1.5f; 86 86 87 87 /// elapsed time in seconds … … 503 503 sColorsTexParam = cgGetNamedParameter(sCgDeferredProgram, "colors"); 504 504 sNormalsTexParam = cgGetNamedParameter(sCgDeferredProgram, "normals"); 505 //sNoiseTexParam = cgGetNamedParameter(sCgDeferredProgram, "noiseTexture");506 507 //sSamplesParam = cgGetNamedParameter(sCgDeferredProgram, "samples");508 //cgGLSetParameterArray2f(sSamplesParam, 0, NUM_SAMPLES, (const float *)samples);509 505 } 510 506 else -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2822 r2823 96 96 97 97 //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; 99 99 100 100 // rotation
Note: See TracChangeset
for help on using the changeset viewer.