Changeset 3047
- Timestamp:
- 10/20/08 02:06:33 (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/Material.cpp
r3045 r3047 18 18 19 19 20 void Technique::Init Material()20 void Technique::Init() 21 21 { 22 22 mTexture = NULL; … … 29 29 mVertexProgram = NULL; 30 30 mFragmentProgram = NULL; 31 32 /// if this material can write colors 33 mColorWriteEnabled = true; 34 /// if lighting is used 35 bool mLightingEnabled = true; 31 36 } 32 37 … … 38 43 mEmmisiveColor(RgbaColor(.0f, .0f, .0f, 1.0f)) 39 44 { 40 Init Material();45 Init(); 41 46 } 42 47 … … 48 53 mTexture(NULL) 49 54 { 50 Init Material();55 Init(); 51 56 } 52 57 53 54 Technique::Technique(const Technique &tech)55 {56 mAmbientColor = tech.mAmbientColor;57 mDiffuseColor = tech.mDiffuseColor;58 mSpecularColor = tech.mSpecularColor;59 mEmmisiveColor = tech.mEmmisiveColor;60 61 mVertexProgram = tech.mVertexProgram;62 mFragmentProgram = tech.mFragmentProgram;63 64 mAlphaTestEnabled = tech.mAlphaTestEnabled;65 mCullFaceEnabled =tech.mCullFaceEnabled;66 67 mTexture = tech.mTexture;68 69 mVertexProgramParameters = tech.mVertexProgramParameters;70 mFragmentProgramParameters = tech.mFragmentProgramParameters;71 }72 58 73 59 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Material.h
r3045 r3047 55 55 Technique(); 56 56 57 Technique(const Technique &tech);58 59 57 ~Technique(); 60 58 /** Sets ambient and diffuse color to color 61 59 */ 62 60 Technique(const RgbaColor &color); 61 /** Renders this technique. 62 */ 63 void Render(RenderState *state); 64 /** Initialize this technique material with default values 65 */ 66 void Init(); 63 67 64 68 inline Texture *GetTexture() const { return mTexture; } … … 81 85 inline bool IsAlphaTestEnabled() const { return mAlphaTestEnabled; } 82 86 inline bool IsCullFaceEnabled() const { return mCullFaceEnabled; } 83 /** Renders this technique. 84 */85 void Render(RenderState *state);86 /** Initialize the material with default values 87 */88 void InitMaterial();87 88 inline void SetLightingEnabled(bool l) { mLightingEnabled = l; } 89 inline void SetColorWriteEnabled(bool c) { mColorWriteEnabled = c; } 90 91 inline bool IsLightingEnabled() const { return mLightingEnabled; } 92 inline bool IsColorWriteEnabled() const { return mColorWriteEnabled; } 89 93 90 94 void SetFragmentProgram(ShaderProgram *p); … … 94 98 ShaderProgram *GetVertexProgram() { return mVertexProgram; } 95 99 96 //void SetFragmentProgramParameters(const GPUProgramParameters &p) { mGPUFragmentParameters = p; } 97 //void SetVertexProgramParameters(const GPUProgramParameters &p) { mGPUVertexParameters = p; } 98 99 /** Each technique has a distict set of parameters. 100 /** Get the set of fragment parameters of this technique 100 101 */ 101 102 GPUProgramParameters * const GetFragmentProgramParameters() { return &mFragmentProgramParameters; } 103 /** Get the set of vertex parameters of this technique 104 */ 102 105 GPUProgramParameters * const GetVertexProgramParameters() { return &mVertexProgramParameters; } 103 106 … … 122 125 ShaderProgram *mFragmentProgram; 123 126 ShaderProgram *mVertexProgram; 127 /// if this material can write colors 128 bool mColorWriteEnabled; 129 /// if lighting is used 130 bool mLightingEnabled; 124 131 }; 125 132 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.cpp
r3043 r3047 199 199 } 200 200 201 ////////// 201 /////////////////// 202 202 //-- fragment and vertex programs 203 203 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.h
r3043 r3047 98 98 bool mFragmentProgramEnabled; 99 99 bool mVertexProgramEnabled; 100 101 bool mUseLighting; 102 bool mColorWriteEnabled; 100 103 }; 101 104 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp
r3046 r3047 156 156 157 157 /////////// 158 //-- hack: add tree animation 158 //-- hack: add tree animation (should be done per material script!) 159 159 160 160 if (numLODs > 1) 161 161 { 162 //for (int i = 0; i < min(numLODs, 2); ++ i) 163 for (int i = 0; i < numLODs; ++ i) 162 ShapeContainer::iterator sstart, send; 163 164 // only use shader for the first two lod levels (the non-billboards) 165 for (int i = 0; i < min(numLODs, 2); ++ i) 166 //for (int i = 0; i < numLODs; ++ i) 164 167 { 165 ShapeContainer::iterator sstart, send;166 168 sceneGeom->GetLODLevel(i, sstart, send); 167 169
Note: See TracChangeset
for help on using the changeset viewer.