Changeset View
Changeset View
Standalone View
Standalone View
source/blender/collada/EffectExporter.cpp
| Context not available. | |||||
| ep.setSpecular(cot, false, "specular"); | ep.setSpecular(cot, false, "specular"); | ||||
| } | } | ||||
| void EffectsExporter::writeConstant(COLLADASW::EffectProfile &ep, Material *ma) { | |||||
| COLLADASW::ColorOrTexture cot; | |||||
| ep.setShaderType(COLLADASW::EffectProfile::CONSTANT); | |||||
| } | |||||
| void EffectsExporter::writeTextures(COLLADASW::EffectProfile &ep, | void EffectsExporter::writeTextures(COLLADASW::EffectProfile &ep, | ||||
| std::string &key, | std::string &key, | ||||
| COLLADASW::Sampler *sampler, | COLLADASW::Sampler *sampler, | ||||
| Context not available. | |||||
| COLLADASW::EffectProfile ep(mSW); | COLLADASW::EffectProfile ep(mSW); | ||||
| ep.setProfileType(COLLADASW::EffectProfile::COMMON); | ep.setProfileType(COLLADASW::EffectProfile::COMMON); | ||||
| ep.openProfile(); | ep.openProfile(); | ||||
| if (ma->mode &= MA_SHLESS) { | |||||
sergey: Seems you're unintentionally modifying material bitflags here. | |||||
| writeConstant(ep, ma); | |||||
| } | |||||
| else { | |||||
Not Done Inline Actionsno need to call this function here. line 195 below already does the trick. gaiaclary: no need to call this function here. line 195 below already does the trick. | |||||
| // set shader type - one of three blinn, phong or lambert | // set shader type - one of three blinn, phong or lambert | ||||
| if (ma->spec > 0.0f) { | if (ma->spec > 0.0f) { | ||||
| if (ma->spec_shader == MA_SPEC_BLINN) { | if (ma->spec_shader == MA_SPEC_BLINN) { | ||||
Not Done Inline Actionssomething wrong with indentation here? gaiaclary: something wrong with indentation here? | |||||
| Context not available. | |||||
| writePhong(ep, ma); | writePhong(ep, ma); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| // index of refraction | // index of refraction | ||||
| if (ma->mode & MA_RAYTRANSP) { | if (ma->mode & MA_RAYTRANSP) { | ||||
| Context not available. | |||||
| } | } | ||||
| // emission | // emission | ||||
| if(!(ma->mode &= MA_SHLESS)) { | |||||
sergeyUnsubmitted Not Done Inline ActionsSame as above. sergey: Same as above. | |||||
| cot = getcol(ma->emit, ma->emit, ma->emit, 1.0f); | cot = getcol(ma->emit, ma->emit, ma->emit, 1.0f); | ||||
| ep.setEmission(cot, false, "emission"); | ep.setEmission(cot, false, "emission"); | ||||
| } | |||||
Not Done Inline ActionsHaving double negation sounds not right to me. I would rather use: if(is_shadeless) {...} else {...}or maybe: instead of is_shadeless, use boolean has_shade... gaiaclary: Having double negation sounds not right to me. I would rather use:
if(is_shadeless) {...}… | |||||
| else { | |||||
| cot = getcol(ma->r, ma->g, ma->b, 1.0f); | |||||
| ep.setEmission(cot,false,"emission"); | |||||
| } | |||||
| // diffuse multiplied by diffuse intensity | // diffuse multiplied by diffuse intensity | ||||
Not Done Inline Actionsyou could move line 241 and line 245 below the if/else block. gaiaclary: you could move line 241 and line 245 below the if/else block. | |||||
| cot = getcol(ma->r * ma->ref, ma->g * ma->ref, ma->b * ma->ref, 1.0f); | cot = getcol(ma->r * ma->ref, ma->g * ma->ref, ma->b * ma->ref, 1.0f); | ||||
| Context not available. | |||||
Not Done Inline Actionsadd a line break and indent here gaiaclary: add a line break and indent here | |||||
Seems you're unintentionally modifying material bitflags here.