Commit 052676a776be914d0848929f20c72e75392b80b9
1 parent
51a67042
Remove uniform mapping.
Change-Id: Ib151a33642e16d305cbc278f6ebab58820ce2a2e
Showing
7 changed files
with
18 additions
and
35 deletions
examples/line-mesh/line-mesh-example.cpp
| ... | ... | @@ -166,8 +166,7 @@ public: |
| 166 | 166 | mMeshActor.AddRenderer( mRenderer ); |
| 167 | 167 | mMeshActor.SetSize(200, 200); |
| 168 | 168 | |
| 169 | - Property::Index morphAmountIndex = mMeshActor.RegisterProperty( "morph-amount", 0.0f ); | |
| 170 | - mMeshActor.AddUniformMapping( morphAmountIndex, std::string("uMorphAmount") ); | |
| 169 | + Property::Index morphAmountIndex = mMeshActor.RegisterProperty( "uMorphAmount", 0.0f ); | |
| 171 | 170 | |
| 172 | 171 | mRenderer.SetDepthIndex(0); |
| 173 | 172 | ... | ... |
examples/mesh-morph/mesh-morph-example.cpp
| ... | ... | @@ -302,8 +302,7 @@ public: |
| 302 | 302 | mMeshActor.AddRenderer( mRenderer ); |
| 303 | 303 | mMeshActor.SetSize(400, 400); |
| 304 | 304 | |
| 305 | - Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "morph-delta", 0.f ); | |
| 306 | - mMeshActor.AddUniformMapping( morphDeltaIndex, std::string("uDelta") ); | |
| 305 | + Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "uDelta", 0.f ); | |
| 307 | 306 | |
| 308 | 307 | mRenderer.SetDepthIndex(0); |
| 309 | 308 | ... | ... |
examples/mesh-sorting/mesh-sorting-example.cpp
| ... | ... | @@ -189,8 +189,7 @@ public: |
| 189 | 189 | |
| 190 | 190 | meshActor.SetOpacity( i%2?0.7f:1.0f ); |
| 191 | 191 | |
| 192 | - Property::Index index=meshActor.RegisterProperty("hue", i/(float)NUMBER_OF_SAMPLES); | |
| 193 | - meshActor.AddUniformMapping( index, "uHue" ); | |
| 192 | + meshActor.RegisterProperty("uHue", i/(float)NUMBER_OF_SAMPLES); | |
| 194 | 193 | |
| 195 | 194 | meshActor.TouchedSignal().Connect(this, &ExampleController::OnTouched); |
| 196 | 195 | std::ostringstream oss; | ... | ... |
examples/point-mesh/point-mesh-example.cpp
| ... | ... | @@ -171,13 +171,10 @@ public: |
| 171 | 171 | mMeshActor.AddRenderer( mRenderer ); |
| 172 | 172 | mMeshActor.SetSize(400, 400); |
| 173 | 173 | |
| 174 | - Property::Index fadeColorIndex = mMeshActor.RegisterProperty( "fade-color", Color::GREEN ); | |
| 175 | - mMeshActor.AddUniformMapping( fadeColorIndex, std::string("uFadeColor") ); | |
| 174 | + mMeshActor.RegisterProperty( "uFadeColor", Color::GREEN ); | |
| 176 | 175 | |
| 177 | - fadeColorIndex = mRenderer.RegisterProperty( "fade-color", Color::MAGENTA ); | |
| 178 | - Property::Index pointSizeIndex = mRenderer.RegisterProperty( "point-size", 80.0f ); | |
| 179 | - mRenderer.AddUniformMapping( fadeColorIndex, std::string("uFadeColor" ) ); | |
| 180 | - mRenderer.AddUniformMapping( pointSizeIndex, std::string("uPointSize" ) ); | |
| 176 | + mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA ); | |
| 177 | + mRenderer.RegisterProperty( "uPointSize", 80.0f ); | |
| 181 | 178 | mRenderer.SetDepthIndex(0); |
| 182 | 179 | |
| 183 | 180 | mMeshActor.SetParentOrigin( ParentOrigin::CENTER ); | ... | ... |
examples/radial-menu/radial-sweep-view-impl.cpp
| ... | ... | @@ -357,10 +357,8 @@ void RadialSweepViewImpl::CreateStencil( Radian initialSector ) |
| 357 | 357 | mStencilActor.SetSize(1.f, 1.f); |
| 358 | 358 | |
| 359 | 359 | // register properties |
| 360 | - mStartAngleIndex = mStencilActor.RegisterProperty("start-angle", 0.f); | |
| 361 | - mStencilActor.AddUniformMapping( mStartAngleIndex, "uStartAngle " ); | |
| 362 | - mRotationAngleIndex = mStencilActor.RegisterProperty("rotation-angle", initialSector.radian); | |
| 363 | - mStencilActor.AddUniformMapping( mRotationAngleIndex, "uRotationAngle" ); | |
| 360 | + mStartAngleIndex = mStencilActor.RegisterProperty("uStartAngle", 0.f); | |
| 361 | + mRotationAngleIndex = mStencilActor.RegisterProperty("uRotationAngle", initialSector.radian); | |
| 364 | 362 | |
| 365 | 363 | mStencilActor.SetDrawMode( DrawMode::STENCIL ); |
| 366 | 364 | mStencilActor.SetPositionInheritanceMode(USE_PARENT_POSITION); | ... | ... |
examples/refraction-effect/refraction-effect-example.cpp
| ... | ... | @@ -292,23 +292,18 @@ private: |
| 292 | 292 | mShaderRefraction = Shader::New( VERTEX_SHADER_REFRACTION, FRAGMENT_SHADER_REFRACTION ); |
| 293 | 293 | |
| 294 | 294 | // register uniforms |
| 295 | - mLightXYOffsetIndex = mMeshActor.RegisterProperty( "light-XY-offset", Vector2::ZERO ); | |
| 296 | - mMeshActor.AddUniformMapping( mLightXYOffsetIndex, "uLightXYOffset" ); | |
| 295 | + mLightXYOffsetIndex = mMeshActor.RegisterProperty( "uLightXYOffset", Vector2::ZERO ); | |
| 297 | 296 | |
| 298 | - mLightIntensityIndex = mMeshActor.RegisterProperty( "light-intensity", 2.5f ); | |
| 299 | - mMeshActor.AddUniformMapping( mLightIntensityIndex, "uLightIntensity" ); | |
| 297 | + mLightIntensityIndex = mMeshActor.RegisterProperty( "uLightIntensity", 2.5f ); | |
| 300 | 298 | |
| 301 | - mEffectStrengthIndex = mMeshActor.RegisterProperty( "effect-strength", 0.f ); | |
| 302 | - mMeshActor.AddUniformMapping( mEffectStrengthIndex, "uEffectStrength" ); | |
| 299 | + mEffectStrengthIndex = mMeshActor.RegisterProperty( "uEffectStrength", 0.f ); | |
| 303 | 300 | |
| 304 | 301 | Vector3 lightPosition( -stageSize.x*0.5f, -stageSize.y*0.5f, stageSize.x*0.5f ); // top_left |
| 305 | - Property::Index lightPositionIndex = mMeshActor.RegisterProperty( "light-position", lightPosition ); | |
| 306 | - mMeshActor.AddUniformMapping( lightPositionIndex, "uLightPosition"); | |
| 302 | + mMeshActor.RegisterProperty( "uLightPosition", lightPosition ); | |
| 307 | 303 | |
| 308 | - Property::Index lightSpinOffsetIndex = mMeshActor.RegisterProperty( "light-spin-offset", Vector2::ZERO ); | |
| 309 | - mMeshActor.AddUniformMapping( lightSpinOffsetIndex, "uLightSpinOffset" ); | |
| 304 | + Property::Index lightSpinOffsetIndex = mMeshActor.RegisterProperty( "uLightSpinOffset", Vector2::ZERO ); | |
| 310 | 305 | |
| 311 | - mSpinAngleIndex = mMeshActor.RegisterProperty("spin-angle", 0.f ); | |
| 306 | + mSpinAngleIndex = mMeshActor.RegisterProperty("uSpinAngle", 0.f ); | |
| 312 | 307 | Constraint constraint = Constraint::New<Vector2>( mMeshActor, lightSpinOffsetIndex, LightOffsetConstraint(stageSize.x*0.1f) ); |
| 313 | 308 | constraint.AddSource( LocalSource(mSpinAngleIndex) ); |
| 314 | 309 | constraint.Apply(); | ... | ... |
examples/textured-mesh/textured-mesh-example.cpp
| ... | ... | @@ -165,11 +165,9 @@ public: |
| 165 | 165 | mMeshActor.AddRenderer( mRenderer ); |
| 166 | 166 | mMeshActor.SetSize(400, 400); |
| 167 | 167 | |
| 168 | - Property::Index fadeColorIndex = mMeshActor.RegisterProperty( "fade-color", Color::GREEN ); | |
| 169 | - mMeshActor.AddUniformMapping( fadeColorIndex, std::string("uFadeColor") ); | |
| 168 | + Property::Index fadeColorIndex = mMeshActor.RegisterProperty( "uFadeColor", Color::GREEN ); | |
| 170 | 169 | |
| 171 | - fadeColorIndex = mRenderer.RegisterProperty( "fade-color", Color::MAGENTA ); | |
| 172 | - mRenderer.AddUniformMapping( fadeColorIndex, std::string("uFadeColor" ) ); | |
| 170 | + fadeColorIndex = mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA ); | |
| 173 | 171 | mRenderer.SetDepthIndex(0); |
| 174 | 172 | |
| 175 | 173 | mMeshActor.SetParentOrigin( ParentOrigin::TOP_CENTER ); |
| ... | ... | @@ -183,13 +181,11 @@ public: |
| 183 | 181 | mMeshActor2.SetSize(400, 400); |
| 184 | 182 | |
| 185 | 183 | mMeshActor2.RegisterProperty( "a-n-other-property", Color::GREEN ); |
| 186 | - Property::Index fadeColorIndex2 = mMeshActor2.RegisterProperty( "another-fade-color", Color::GREEN ); | |
| 187 | - mMeshActor2.AddUniformMapping( fadeColorIndex2, std::string("uFadeColor") ); | |
| 184 | + Property::Index fadeColorIndex2 = mMeshActor2.RegisterProperty( "uFadeColor", Color::GREEN ); | |
| 188 | 185 | |
| 189 | 186 | mRenderer2.RegisterProperty( "a-n-other-property", Vector3::ZERO ); |
| 190 | 187 | mRenderer2.RegisterProperty( "a-coefficient", 0.008f ); |
| 191 | - fadeColorIndex2 = mRenderer2.RegisterProperty( "another-fade-color", Color::BLUE ); | |
| 192 | - mRenderer2.AddUniformMapping( fadeColorIndex2, std::string("uFadeColor" ) ); | |
| 188 | + fadeColorIndex2 = mRenderer2.RegisterProperty( "uFadeColor", Color::BLUE ); | |
| 193 | 189 | mRenderer2.SetDepthIndex(0); |
| 194 | 190 | |
| 195 | 191 | mMeshActor2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); | ... | ... |