Changeset 3056
- Timestamp:
- 10/21/08 17:41:14 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShaderManager.cpp
r3055 r3056 26 26 27 27 28 // only instance of the shader manager 29 ShaderManager *ShaderManager::sShaderManager = NULL; 30 28 31 ///////// 29 32 //-- cg stuff … … 34 37 static CGprofile sCgVertexProfile; 35 38 36 static ShaderProgram *sTreeAnimationProgramMrt;37 static ShaderProgram *sTreeAnimationProgram;38 static ShaderProgram *sTreeAnimation;39 40 // only instance of the shader manager41 ShaderManager *ShaderManager::sShaderManager = NULL;42 39 43 40 … … 73 70 // set textures to auto load 74 71 cgGLSetManageTextureParameters(sCgContext, false); 75 76 mMrtDefaultVertexProgram = CreateVertexProgram("mrt", "vtx", "defaultMrtVertex"); 77 mMrtDefaultFragmentProgram = CreateFragmentProgram("mrt", "frag", "defaultMrtFragment"); 78 mMrtDefaultFragmentTexProgram = CreateFragmentProgram("mrt", "fragtex", "defaultMrtFragmentTex"); 72 73 /////////////// 74 //-- load the defaul programs for mrt (used if not defined by the user) 75 76 ShaderProgram *vertexProgMrt, *fragmentProgMrt, *fragmentProgMrtTex; 77 78 vertexProgMrt = CreateVertexProgram("mrt", "vtx", "defaultVertexMrt"); 79 fragmentProgMrt = CreateFragmentProgram("mrt", "frag", "defaultFragmentMrt"); 80 fragmentProgMrtTex = CreateFragmentProgram("mrt", "fragtex", "defaultFragmentTexMrt"); 79 81 80 82 // provide the current view matrix 81 mMrtDefaultFragmentProgram->AddParameter("viewMatrix", 0); 82 mMrtDefaultFragmentTexProgram->AddParameter("viewMatrix", 0); 83 fragmentProgMrt->AddParameter("viewMatrix", 0); 84 fragmentProgMrtTex->AddParameter("viewMatrix", 0); 85 83 86 // add a texture parameter 84 mMrtDefaultFragmentTexProgram->AddParameter("tex", 1);87 fragmentProgMrtTex->AddParameter("tex", 1); 85 88 86 89 87 90 ////////////////////////// 88 //-- hack: apply hardcoded tree animation (should be provided with a material script!) 89 90 sTreeAnimationProgram = CreateVertexProgram("treeanimation", "animateVtx", "treeAnimation"); 91 sTreeAnimationProgramMrt = CreateVertexProgram("treeanimation", "animateVtxMrt", "treeAnimationMrt"); 92 93 sTreeAnimationProgram->AddParameter("timer", 0); 94 sTreeAnimationProgram->AddParameter("windDir", 1); 95 sTreeAnimationProgram->AddParameter("windStrength", 2); 96 sTreeAnimationProgram->AddParameter("minMaxPos", 3); 97 sTreeAnimationProgram->AddParameter("frequency", 4); 98 sTreeAnimationProgram->AddParameter("lightDir", 5); 99 100 sTreeAnimationProgramMrt->AddParameter("timer", 0); 101 sTreeAnimationProgramMrt->AddParameter("windDir", 1); 102 sTreeAnimationProgramMrt->AddParameter("windStrength", 2); 103 sTreeAnimationProgramMrt->AddParameter("minMaxPos", 3); 104 sTreeAnimationProgramMrt->AddParameter("frequency", 4); 91 //-- hack: use hardcoded tree animation (should be provided with a material script!) 92 93 ShaderProgram *treeAnimProg, *treeAnimProgMrt; 94 95 treeAnimProg = CreateVertexProgram("treeanimation", "animateVtx", "treeAnimation"); 96 treeAnimProgMrt = CreateVertexProgram("treeanimation", "animateVtxMrt", "treeAnimationMrt"); 97 98 treeAnimProg->AddParameter("timer", 0); 99 treeAnimProg->AddParameter("windDir", 1); 100 treeAnimProg->AddParameter("windStrength", 2); 101 treeAnimProg->AddParameter("minMaxPos", 3); 102 treeAnimProg->AddParameter("frequency", 4); 103 treeAnimProg->AddParameter("lightDir", 5); 104 105 treeAnimProgMrt->AddParameter("timer", 0); 106 treeAnimProgMrt->AddParameter("windDir", 1); 107 treeAnimProgMrt->AddParameter("windStrength", 2); 108 treeAnimProgMrt->AddParameter("minMaxPos", 3); 109 treeAnimProgMrt->AddParameter("frequency", 4); 105 110 106 111 cout << "cg initialization successful" << endl; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShaderManager.h
r3055 r3056 70 70 ShaderMap mShaderMap; 71 71 72 ////////////73 //-- default shader programs74 75 ShaderProgram *mMrtDefaultVertexProgram;76 ShaderProgram *mMrtDefaultFragmentProgram;77 ShaderProgram *mMrtDefaultFragmentTexProgram;78 79 80 72 private: 81 73
Note: See TracChangeset
for help on using the changeset viewer.