Changeset 3147 for GTP/trunk/App/Demos
- Timestamp:
- 11/20/08 12:56:59 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.h
r3102 r3147 22 22 public: 23 23 24 enum {LEFT_PLANE, RIGHT_PLANE, BOTTOM_PLANE, TOP_PLANE, NEAR_PLANE, FAR_PLANE}; 25 24 26 Frustum() {}; 25 27 26 28 Frustum(const Matrix4x4 &trafo); 27 28 enum { LEFT_PLANE, RIGHT_PLANE, BOTTOM_PLANE, TOP_PLANE, NEAR_PLANE, FAR_PLANE};29 29 30 30 /** Resizes the current frustum so that it fully encloses the given polyhedron -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.h
r3117 r3147 15 15 public: 16 16 17 enum FORMAT { RGB_UBYTE, RGBA_UBYTE, RGB_FLOAT_16, RGBA_FLOAT_16, RGB_FLOAT_32, RGBA_FLOAT_32 }; 18 19 enum WRAP_TYPE { WRAP_REPEAT, WRAP_CLAMP_TO_EDGE }; 20 enum FILTER_TYPE { FILTER_NEAREST, FILTER_LINEAR }; 17 enum FORMAT {RGB_UBYTE, RGBA_UBYTE, RGB_FLOAT_16, RGBA_FLOAT_16, RGB_FLOAT_32, RGBA_FLOAT_32}; 18 enum WRAP_TYPE {WRAP_REPEAT, WRAP_CLAMP_TO_EDGE}; 19 enum FILTER_TYPE {FILTER_NEAREST, FILTER_LINEAR}; 21 20 22 21 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Material.cpp
r3114 r3147 74 74 void Technique::SetFragmentProgram(ShaderProgram *p) 75 75 { 76 if (p->GetProgramType() == ShaderProgram::VERTEX_PROGRAM) 77 cerr << "warning: assigning a vertex program as fragment program!" << endl; 78 76 79 mFragmentProgram = p; 77 80 mFragmentProgramParameters.Reset(); … … 82 85 void Technique::SetVertexProgram(ShaderProgram *p) 83 86 { 84 mVertexProgram = p; 87 if (p->GetProgramType() == ShaderProgram::FRAGMENT_PROGRAM) 88 cerr << "warning: assigning a fragment program as vertex program!" << endl; 89 90 mVertexProgram = p; 85 91 mVertexProgramParameters.Reset(); 86 92 mVertexProgramParameters.SetProgram(p); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.h
r3102 r3147 52 52 public: 53 53 54 /// types of traversers 55 enum {CULL_FRUSTUM, STOP_AND_WAIT, CHC, CHCPLUSPLUS, NUM_TRAVERSAL_TYPES}; 56 54 57 /** Default constructor. 55 58 */ … … 62 65 void RenderScene(); 63 66 64 enum {CULL_FRUSTUM, STOP_AND_WAIT, CHC, CHCPLUSPLUS, NUM_TRAVERSAL_TYPES};65 67 /** Returns the type of the traversal. 66 68 The type is one of -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShaderManager.cpp
r3146 r3147 207 207 const string fullName = "src/shaders/" + filename + ".cg"; 208 208 209 ShaderProgram *p = 210 new ShaderProgram(sCgContext, fullName, 211 isFragment ? sCgFragmentProfile : sCgVertexProfile, funcName); 209 ShaderProgram *p; 210 211 if (isFragment) 212 { 213 p = new ShaderProgram(sCgContext, fullName, sCgFragmentProfile, funcName, ShaderProgram::FRAGMENT_PROGRAM); 214 } 215 else 216 { 217 p = new ShaderProgram(sCgContext, fullName, sCgVertexProfile, funcName, ShaderProgram::VERTEX_PROGRAM); 218 } 212 219 213 220 if (GetShaderProgram(name)) -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShaderProgram.cpp
r3116 r3147 360 360 const std::string &filename, 361 361 CGprofile profile, 362 const std::string &functionName) 362 const std::string &functionName, 363 PROGRAM_TYPE programType): 364 mProgramType(programType) 363 365 { 364 366 mProgram = cgCreateProgramFromFile(context, -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShaderProgram.h
r3115 r3147 220 220 public: 221 221 222 enum PROGRAM_TYPE {FRAGMENT_PROGRAM, VERTEX_PROGRAM}; 223 224 222 225 ShaderProgram(CGprogram program): mProgram(program) {} 223 226 … … 225 228 const std::string &filename, 226 229 CGprofile profile, 227 const std::string &functionName); 230 const std::string &functionName, 231 PROGRAM_TYPE type); 228 232 229 233 ~ShaderProgram() { if (mProgram != NULL) cgDestroyProgram(mProgram); } … … 276 280 */ 277 281 void Bind(); 282 /** Releases all texture resources. 283 */ 284 void Release(); 285 278 286 /** Returns true if this program is valid. 279 287 */ 280 inline bool IsValid() const { return mProgram != NULL; } 281 /** Releases all texture resources. 282 */ 283 void Release(); 288 inline bool IsValid() const {return mProgram != NULL;} 289 290 291 /** Returns type of program (fragment program or vertex program} 292 */ 293 inline PROGRAM_TYPE GetProgramType() const {return mProgramType;} 294 /** See get 295 */ 296 inline void SetProgramType(PROGRAM_TYPE type) {mProgramType = type;} 284 297 285 298 … … 301 314 CGParameterArray mTextureParams; 302 315 CGParameterArray mParameters; 316 317 PROGRAM_TYPE mProgramType; 303 318 }; 304 319 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.h
r2964 r3147 15 15 { 16 16 public: 17 18 enum {FORMAT_INVALID, FORMAT_RGB, FORMAT_RGBA}; 19 20 enum {CLAMP, REPEAT}; 21 22 17 23 /** Constructor loading texture from file 18 24 */ … … 24 30 */ 25 31 void *GetImage() const; 26 27 enum { FORMAT_INVALID, FORMAT_RGB, FORMAT_RGBA };28 29 enum { CLAMP, REPEAT };30 31 32 /** Returns width of texture. 32 33 */ … … 41 42 */ 42 43 std::string GetName() const; 43 44 /** Returns byte size of a row of the image. 45 */ 44 46 int GetRowLength() const; 45 47 /** Returns byte size of one pixel 48 */ 46 49 int GetPixelSize() const; 47 50 /** Returns byte size of the image 51 */ 48 52 inline int GetByteSize() const; 49 53 /** Bind the texture. 50 54 */ 51 55 void Bind() const; 52 56 /** Sets the boundary mode for the s texture coordinate parameter. 57 */ 53 58 void SetBoundaryModeS(int mode) { mBoundaryModeS = mode; } 59 /** Sets the boundary mode for the T texture coordinate parameter. 60 */ 54 61 void SetBoundaryModeT(int mode) { mBoundaryModeT = mode; } 55 56 //void SetUseMipMap(bool useMipMap) { mUseMipMap = useMipMap; }57 62 58 63 int GetBoundaryModeS() const { return mBoundaryModeS; } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/antialiasing.cg
r3146 r3147 98 98 //float4 col = float4(centerNormal * 0.5f + float3(0.5f), 0); 99 99 //float4 col = float4(centerNormal, 0); 100 100 101 // push through the current depth 101 102 col.w = centerDepth.x;
Note: See TracChangeset
for help on using the changeset viewer.