Remove SetTextureAffectsTransparency as it is not needed
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / model3d-view / model3d-view-impl.cpp
index 84780be..f1f7a39 100644 (file)
@@ -447,6 +447,8 @@ Property::Value Model3dView::GetProperty( BaseObject* object, Property::Index in
 
 void Model3dView::OnStageConnection( int depth )
 {
+  Control::OnStageConnection( depth );
+
   CustomActor self = Self();
   self.AddRenderer( mRenderer );
 
@@ -627,11 +629,7 @@ void Model3dView::LoadTextures()
     Image tex0 = ResourceImage::New( imgUrl );
     if( tex0 )
     {
-      Sampler sampler = Sampler::New( tex0, "sDiffuse" );
-      sampler.SetWrapMode(Sampler::REPEAT,Sampler::REPEAT);
-      sampler.SetAffectsTransparency(false);
-
-      mMaterial.AddSampler( sampler );
+      mMaterial.AddTexture( tex0, "sDiffuse" );
     }
   }
 
@@ -643,12 +641,7 @@ void Model3dView::LoadTextures()
     Image tex1 = ResourceImage::New( imgUrl );
     if (tex1)
     {
-      Sampler sampler = Sampler::New( tex1, "sNormal" );
-      sampler.SetWrapMode(Sampler::REPEAT,Sampler::REPEAT);
-      sampler.SetAffectsTransparency(false);
-      sampler.SetFilterMode(Sampler::LINEAR,Sampler::LINEAR);
-
-      mMaterial.AddSampler( sampler );
+      mMaterial.AddTexture( tex1, "sNormal" );
     }
   }
 
@@ -660,12 +653,7 @@ void Model3dView::LoadTextures()
     Image tex2 = ResourceImage::New( imgUrl );
     if( tex2 )
     {
-      Sampler sampler = Sampler::New( tex2, "sGloss" );
-      sampler.SetWrapMode(Sampler::REPEAT,Sampler::REPEAT);
-      sampler.SetAffectsTransparency(false);
-      sampler.SetFilterMode(Sampler::LINEAR,Sampler::LINEAR);
-
-      mMaterial.AddSampler( sampler );
+      mMaterial.AddTexture( tex2, "sGloss" );
     }
   }
 }