- Timestamp:
- 11/11/08 00:46:01 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShaderManager.cpp
r3114 r3116 48 48 printf("Cg error, exiting...\n"); 49 49 50 Debug << "\n" << cgGetErrorString(lastError) << endl;51 Debug << "\n" << cgGetLastListing(sCgContext) << endl;50 //Debug << "\n" << cgGetErrorString(lastError) << endl; 51 //Debug << "\n" << cgGetLastListing(sCgContext) << endl; 52 52 53 53 printf("%s\n\n", cgGetErrorString(lastError)); … … 123 123 treeAnimProgMrt->AddParameter("minMaxPos", 3); 124 124 treeAnimProgMrt->AddParameter("frequency", 4); 125 treeAnimProgMrt->AddParameter("oldTimer", 5); 125 126 126 127 cout << "cg initialization successful" << endl; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShaderProgram.cpp
r3115 r3116 30 30 31 31 GPUProgramParameters::GPUProgramParameters(ShaderProgram *p): 32 mProgram(p), 33 mTimerParam(-1), 34 mViewDirParam(-1), 35 mViewMatrixParam(-1), 36 mLightDirParam(-1), 37 mModelMatrixParam(-1), 38 mOldModelMatrixParam(-1) 39 { 32 mProgram(p) 33 { 34 Reset(); 40 35 } 41 36 42 37 43 38 GPUProgramParameters::GPUProgramParameters(): 44 mProgram(NULL), 45 mTimerParam(-1), 46 mViewDirParam(-1), 47 mViewMatrixParam(-1), 48 mLightDirParam(-1), 49 mModelMatrixParam(-1), 50 mOldModelMatrixParam(-1) 51 { 39 mProgram(NULL) 40 { 41 Reset(); 52 42 } 53 43 … … 62 52 63 53 mTimerParam = -1; 54 mOldTimerParam = -1; 64 55 mViewDirParam = -1; 65 56 mLightDirParam = -1; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/treeanimation.cg
r3115 r3116 85 85 86 86 const float pos = (minMaxPos.x - IN.position.z) / (minMaxPos.x - minMaxPos.y); 87 87 88 float factor = pos * pos * windStrength * sin(timer * frequency); 89 const float4 offs = float4(factor * windDir, 0); 88 90 89 const float4 offs = float4(factor * windDir, 0); 91 float oldFactor = pos * pos * windStrength * sin(oldTimer * frequency); 92 const float4 oldOffs = float4(oldFactor * windDir, 0); 90 93 91 94 // transform the vertex position into post projection space … … 101 104 102 105 // hack: no translational component anyway 103 OUT.oldWorldPos = float4(.0f);106 OUT.oldWorldPos = oldOffs; 104 107 OUT.worldPos = offs; 105 108
Note: See TracChangeset
for help on using the changeset viewer.