Commit 07ab57fde5eb011ecd843162afd4eeae3f7d844b
1 parent
1d35f77a
Update following the changes of Blending&Culling options
Change-Id: I390f4bd7cca141658c3a300ae742145fddf37e07
Showing
9 changed files
with
14 additions
and
13 deletions
examples/benchmark/benchmark.cpp
| @@ -227,8 +227,8 @@ Renderer CreateRenderer( unsigned int index ) | @@ -227,8 +227,8 @@ Renderer CreateRenderer( unsigned int index ) | ||
| 227 | Image image = ResourceImage::New(imagePath); | 227 | Image image = ResourceImage::New(imagePath); |
| 228 | Material material = Material::New( shader ); | 228 | Material material = Material::New( shader ); |
| 229 | material.AddTexture( image, "sTexture" ); | 229 | material.AddTexture( image, "sTexture" ); |
| 230 | - material.SetBlendMode( BlendingMode::OFF ); | ||
| 231 | renderers[index] = Renderer::New( QuadMesh(), material ); | 230 | renderers[index] = Renderer::New( QuadMesh(), material ); |
| 231 | + renderers[index].SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::OFF ); | ||
| 232 | } | 232 | } |
| 233 | return renderers[index]; | 233 | return renderers[index]; |
| 234 | } | 234 | } |
examples/item-view/item-view-example.cpp
| @@ -866,6 +866,7 @@ public: // From ItemFactory | @@ -866,6 +866,7 @@ public: // From ItemFactory | ||
| 866 | borderProperty.Insert( "rendererType", "borderRenderer" ); | 866 | borderProperty.Insert( "rendererType", "borderRenderer" ); |
| 867 | borderProperty.Insert( "borderColor", Color::WHITE ); | 867 | borderProperty.Insert( "borderColor", Color::WHITE ); |
| 868 | borderProperty.Insert( "borderSize", ITEM_BORDER_SIZE ); | 868 | borderProperty.Insert( "borderSize", ITEM_BORDER_SIZE ); |
| 869 | + borderProperty.Insert( "antiAliasing", true ); | ||
| 869 | borderActor.SetProperty( ImageView::Property::IMAGE, borderProperty ); | 870 | borderActor.SetProperty( ImageView::Property::IMAGE, borderProperty ); |
| 870 | 871 | ||
| 871 | actor.Add(borderActor); | 872 | actor.Add(borderActor); |
examples/line-mesh/line-mesh-example.cpp
| @@ -167,7 +167,7 @@ public: | @@ -167,7 +167,7 @@ public: | ||
| 167 | 167 | ||
| 168 | Property::Index morphAmountIndex = mMeshActor.RegisterProperty( "uMorphAmount", 0.0f ); | 168 | Property::Index morphAmountIndex = mMeshActor.RegisterProperty( "uMorphAmount", 0.0f ); |
| 169 | 169 | ||
| 170 | - mRenderer.SetDepthIndex(0); | 170 | + mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); |
| 171 | 171 | ||
| 172 | mMeshActor.SetParentOrigin( ParentOrigin::CENTER ); | 172 | mMeshActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 173 | mMeshActor.SetAnchorPoint( AnchorPoint::CENTER ); | 173 | mMeshActor.SetAnchorPoint( AnchorPoint::CENTER ); |
examples/mesh-morph/mesh-morph-example.cpp
| @@ -304,7 +304,7 @@ public: | @@ -304,7 +304,7 @@ public: | ||
| 304 | 304 | ||
| 305 | Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "uDelta", 0.f ); | 305 | Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "uDelta", 0.f ); |
| 306 | 306 | ||
| 307 | - mRenderer.SetDepthIndex(0); | 307 | + mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); |
| 308 | 308 | ||
| 309 | mMeshActor.SetParentOrigin( ParentOrigin::CENTER ); | 309 | mMeshActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 310 | mMeshActor.SetAnchorPoint( AnchorPoint::CENTER ); | 310 | mMeshActor.SetAnchorPoint( AnchorPoint::CENTER ); |
examples/mesh-sorting/mesh-sorting-example.cpp
| @@ -180,7 +180,7 @@ public: | @@ -180,7 +180,7 @@ public: | ||
| 180 | meshActor.SetSize(175, 175); | 180 | meshActor.SetSize(175, 175); |
| 181 | meshActor.RegisterProperty("index", (int)i); | 181 | meshActor.RegisterProperty("index", (int)i); |
| 182 | 182 | ||
| 183 | - renderer.SetDepthIndex(0); | 183 | + renderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); |
| 184 | // Test with actor alpha | 184 | // Test with actor alpha |
| 185 | meshActor.SetParentOrigin( ParentOrigin::CENTER ); | 185 | meshActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 186 | meshActor.SetAnchorPoint( AnchorPoint::CENTER ); | 186 | meshActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| @@ -240,7 +240,7 @@ public: | @@ -240,7 +240,7 @@ public: | ||
| 240 | mDepthIndices[index] = newDepthIndex; | 240 | mDepthIndices[index] = newDepthIndex; |
| 241 | 241 | ||
| 242 | Renderer renderer = actor.GetRendererAt(0); | 242 | Renderer renderer = actor.GetRendererAt(0); |
| 243 | - renderer.SetDepthIndex(newDepthIndex); | 243 | + renderer.SetProperty( Renderer::Property::DEPTH_INDEX, newDepthIndex); |
| 244 | 244 | ||
| 245 | PrintDepths(); | 245 | PrintDepths(); |
| 246 | } | 246 | } |
examples/metaball-explosion/metaball-explosion-example.cpp
| @@ -475,9 +475,6 @@ void MetaballExplosionController::CreateMetaballActors() | @@ -475,9 +475,6 @@ void MetaballExplosionController::CreateMetaballActors() | ||
| 475 | Shader shader = Shader::New( METABALL_VERTEX_SHADER, METABALL_FRAG_SHADER ); | 475 | Shader shader = Shader::New( METABALL_VERTEX_SHADER, METABALL_FRAG_SHADER ); |
| 476 | 476 | ||
| 477 | Material material = Material::New( shader ); | 477 | Material material = Material::New( shader ); |
| 478 | - material.SetBlendMode(BlendingMode::ON ); | ||
| 479 | - material.SetBlendFunc(BlendingFactor::ONE, BlendingFactor::ONE, BlendingFactor::ONE, BlendingFactor::ONE); | ||
| 480 | - | ||
| 481 | Geometry metaballGeom = CreateGeometry(); | 478 | Geometry metaballGeom = CreateGeometry(); |
| 482 | 479 | ||
| 483 | //Initialization of each of the metaballs | 480 | //Initialization of each of the metaballs |
| @@ -492,6 +489,9 @@ void MetaballExplosionController::CreateMetaballActors() | @@ -492,6 +489,9 @@ void MetaballExplosionController::CreateMetaballActors() | ||
| 492 | mMetaballs[i].actor.SetParentOrigin( ParentOrigin::CENTER ); | 489 | mMetaballs[i].actor.SetParentOrigin( ParentOrigin::CENTER ); |
| 493 | 490 | ||
| 494 | Renderer renderer = Renderer::New( metaballGeom, material ); | 491 | Renderer renderer = Renderer::New( metaballGeom, material ); |
| 492 | + renderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON ); | ||
| 493 | + renderer.SetBlendFunc(BlendingFactor::ONE, BlendingFactor::ONE, BlendingFactor::ONE, BlendingFactor::ONE); | ||
| 494 | + | ||
| 495 | mMetaballs[i].actor.AddRenderer( renderer ); | 495 | mMetaballs[i].actor.AddRenderer( renderer ); |
| 496 | 496 | ||
| 497 | mMetaballs[i].positionIndex = mMetaballs[i].actor.RegisterProperty( "uPositionMetaball", mMetaballs[i].position ); | 497 | mMetaballs[i].positionIndex = mMetaballs[i].actor.RegisterProperty( "uPositionMetaball", mMetaballs[i].position ); |
examples/metaball-refrac/metaball-refrac-example.cpp
| @@ -450,8 +450,6 @@ void MetaballRefracController::CreateMetaballActors() | @@ -450,8 +450,6 @@ void MetaballRefracController::CreateMetaballActors() | ||
| 450 | Shader shader = Shader::New( METABALL_VERTEX_SHADER, METABALL_FRAG_SHADER ); | 450 | Shader shader = Shader::New( METABALL_VERTEX_SHADER, METABALL_FRAG_SHADER ); |
| 451 | 451 | ||
| 452 | Material material = Material::New( shader ); | 452 | Material material = Material::New( shader ); |
| 453 | - material.SetBlendMode(BlendingMode::ON ); | ||
| 454 | - material.SetBlendFunc(BlendingFactor::ONE, BlendingFactor::ONE, BlendingFactor::ONE, BlendingFactor::ONE); | ||
| 455 | 453 | ||
| 456 | Geometry metaballGeom = CreateGeometry(); | 454 | Geometry metaballGeom = CreateGeometry(); |
| 457 | 455 | ||
| @@ -472,6 +470,8 @@ void MetaballRefracController::CreateMetaballActors() | @@ -472,6 +470,8 @@ void MetaballRefracController::CreateMetaballActors() | ||
| 472 | mMetaballs[i].actor.SetParentOrigin( ParentOrigin::CENTER ); | 470 | mMetaballs[i].actor.SetParentOrigin( ParentOrigin::CENTER ); |
| 473 | 471 | ||
| 474 | Renderer renderer = Renderer::New( metaballGeom, material ); | 472 | Renderer renderer = Renderer::New( metaballGeom, material ); |
| 473 | + renderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON ); | ||
| 474 | + renderer.SetBlendFunc(BlendingFactor::ONE, BlendingFactor::ONE, BlendingFactor::ONE, BlendingFactor::ONE); | ||
| 475 | mMetaballs[i].actor.AddRenderer( renderer ); | 475 | mMetaballs[i].actor.AddRenderer( renderer ); |
| 476 | 476 | ||
| 477 | mMetaballs[i].positionIndex = mMetaballs[i].actor.RegisterProperty( "uPositionMetaball", mMetaballs[i].position ); | 477 | mMetaballs[i].positionIndex = mMetaballs[i].actor.RegisterProperty( "uPositionMetaball", mMetaballs[i].position ); |
examples/point-mesh/point-mesh-example.cpp
| @@ -173,7 +173,7 @@ public: | @@ -173,7 +173,7 @@ public: | ||
| 173 | 173 | ||
| 174 | mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA ); | 174 | mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA ); |
| 175 | mRenderer.RegisterProperty( "uPointSize", 80.0f ); | 175 | mRenderer.RegisterProperty( "uPointSize", 80.0f ); |
| 176 | - mRenderer.SetDepthIndex(0); | 176 | + mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); |
| 177 | 177 | ||
| 178 | mMeshActor.SetParentOrigin( ParentOrigin::CENTER ); | 178 | mMeshActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 179 | mMeshActor.SetAnchorPoint( AnchorPoint::CENTER ); | 179 | mMeshActor.SetAnchorPoint( AnchorPoint::CENTER ); |
examples/textured-mesh/textured-mesh-example.cpp
| @@ -163,7 +163,7 @@ public: | @@ -163,7 +163,7 @@ public: | ||
| 163 | mMeshActor.SetSize(400, 400); | 163 | mMeshActor.SetSize(400, 400); |
| 164 | 164 | ||
| 165 | Property::Index fadeColorIndex = mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA ); | 165 | Property::Index fadeColorIndex = mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA ); |
| 166 | - mRenderer.SetDepthIndex(0); | 166 | + mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); |
| 167 | 167 | ||
| 168 | mMeshActor.SetParentOrigin( ParentOrigin::TOP_CENTER ); | 168 | mMeshActor.SetParentOrigin( ParentOrigin::TOP_CENTER ); |
| 169 | mMeshActor.SetAnchorPoint( AnchorPoint::TOP_CENTER ); | 169 | mMeshActor.SetAnchorPoint( AnchorPoint::TOP_CENTER ); |
| @@ -180,7 +180,7 @@ public: | @@ -180,7 +180,7 @@ public: | ||
| 180 | mRenderer2.RegisterProperty( "anotherProperty", Vector3::ZERO ); | 180 | mRenderer2.RegisterProperty( "anotherProperty", Vector3::ZERO ); |
| 181 | mRenderer2.RegisterProperty( "aCoefficient", 0.008f ); | 181 | mRenderer2.RegisterProperty( "aCoefficient", 0.008f ); |
| 182 | Property::Index fadeColorIndex2 = mRenderer2.RegisterProperty( "uFadeColor", Color::BLUE ); | 182 | Property::Index fadeColorIndex2 = mRenderer2.RegisterProperty( "uFadeColor", Color::BLUE ); |
| 183 | - mRenderer2.SetDepthIndex(0); | 183 | + mRenderer2.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); |
| 184 | 184 | ||
| 185 | mMeshActor2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); | 185 | mMeshActor2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); |
| 186 | mMeshActor2.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); | 186 | mMeshActor2.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); |