Image tex0 = ResourceImage::New( imgUrl );
if( tex0 )
{
- size_t index = mMaterial.AddTexture( tex0, "sDiffuse" );
- mMaterial.SetTextureAffectsTransparency(index, false );
+ mMaterial.AddTexture( tex0, "sDiffuse" );
}
}
Image tex1 = ResourceImage::New( imgUrl );
if (tex1)
{
- size_t index = mMaterial.AddTexture( tex1, "sNormal" );
- mMaterial.SetTextureAffectsTransparency(index, false );
+ mMaterial.AddTexture( tex1, "sNormal" );
}
}
Image tex2 = ResourceImage::New( imgUrl );
if( tex2 )
{
- size_t index = mMaterial.AddTexture( tex2, "sGloss" );
- mMaterial.SetTextureAffectsTransparency(index, false );
+ mMaterial.AddTexture( tex2, "sGloss" );
}
}
}
}
surface.SetRequiresDepthTesting(true);
- //surface.SetProperty(Geometry::Property::GEOMETRY_HALF_EXTENTS, GetSize() * 0.5);
vertices.Clear();
verticesExt.Clear();
}
/**
- * Establish if a given texture will affect the transparency of the material ( true by default )
- * @method setTextureAffectsTransparency
- * @for Material
- * @param {integer} index The index of the texture in the array of textures
- * @param {string} affectsTransparency True if the texture affects transparency, false otherwise
- */
-void MaterialApi::SetTextureAffectsTransparency( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
- v8::Isolate* isolate = args.GetIsolate();
- v8::HandleScope handleScope( isolate );
-
- Material material = GetMaterial( isolate, args );
-
- bool found( false );
- int index = V8Utils::GetIntegerParameter( PARAMETER_0, found, isolate, args, 0 /* default */);
- if( !found )
- {
- DALI_SCRIPT_EXCEPTION( isolate, "invalid index parameter" );
- return;
- }
-
- found = false;
- bool affectsTransparency = V8Utils::GetBooleanParameter( PARAMETER_1, found, isolate, args );
- if( !found )
- {
- DALI_SCRIPT_EXCEPTION( isolate, "invalid affectsTransparency parameter" );
- }
- else
- {
- material.SetTextureAffectsTransparency(index, affectsTransparency);
- }
-}
-
-/**
* Retrive the index of a texture given its uniform name
* @method getTextureIndex
* @for Material
void SetTextureImage( const v8::FunctionCallbackInfo< v8::Value >& args );
void SetTextureSampler( const v8::FunctionCallbackInfo< v8::Value >& args );
void SetTextureUniformName( const v8::FunctionCallbackInfo< v8::Value >& args );
- void SetTextureAffectsTransparency( const v8::FunctionCallbackInfo< v8::Value >& args );
void GetTextureIndex( const v8::FunctionCallbackInfo< v8::Value >& args );
void GetNumberOfTextures( const v8::FunctionCallbackInfo< v8::Value >& args );
void SetFaceCullingMode( const v8::FunctionCallbackInfo< v8::Value >& args );
{ "SetTextureImage" , MaterialApi::SetTextureImage },
{ "SetTextureSampler" , MaterialApi::SetTextureSampler },
{ "SetTextureUniformName" , MaterialApi::SetTextureUniformName },
- { "SetTextureAffectsTransparency" , MaterialApi::SetTextureAffectsTransparency },
{ "GetTextureIndex" , MaterialApi::GetTextureIndex },
{ "GetNumberOfTextures" , MaterialApi::GetNumberOfTextures },
{ "SetFaceCullingMode" , MaterialApi::SetFaceCullingMode },