MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / getOpacity

Method getOpacity

COLLADAMax/src/COLLADAMaxEffectExporter.cpp:1165–1182  ·  view source on GitHub ↗

---------------------------------------------------------------

Source from the content-addressed store, hash-verified

1163
1164 //---------------------------------------------------------------
1165 COLLADASW::EffectProfile::Opaque EffectExporter::getOpacity ( Texmap *texMap )
1166 {
1167 // Only one transparency factor is supported, so retrieve only the first texture from this bucket.
1168
1169 if ( texMap == NULL )
1170 return COLLADASW::EffectProfile::A_ONE;
1171
1172 BitmapTex* bmap = GetIBitmapTextInterface ( texMap );
1173
1174 BOOL isAlphaTransparency = true;
1175
1176 if ( bmap != NULL )
1177 isAlphaTransparency = bmap->GetAlphaAsMono ( TRUE );
1178
1179 // As far as my tests are concerned, the only real way to get alpha-transparency is through
1180 // the mono-channel output as Alpha.
1181 return isAlphaTransparency ? COLLADASW::EffectProfile::A_ONE : COLLADASW::EffectProfile::RGB_ZERO;
1182 }
1183
1184 //---------------------------------------------------------------
1185 COLLADASW::EffectProfile::ShaderType EffectExporter::maxShaderToShaderType ( Class_ID id )

Callers 6

getMaterialIdentifierFunction · 0.45
calculateOpacityMethod · 0.45
_writeMaterial_lib3dsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected