Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/collada/collada_utils.cpp
| Context not available. | |||||
| COLLADASW::ColorOrTexture cot = bc_get_cot_from_shader(shader, "Emission", default_color); | COLLADASW::ColorOrTexture cot = bc_get_cot_from_shader(shader, "Emission", default_color); | ||||
| /* Multiply in emission strength. If using texture, emission strength is not | /* If using texture, emission strength is not supported. */ | ||||
| * supported. */ | |||||
| COLLADASW::Color col = cot.getColor(); | COLLADASW::Color col = cot.getColor(); | ||||
| cot.getColor().set(emission_strength * col.getRed(), | /* Retrieve color */ | ||||
| emission_strength * col.getGreen(), | double final_color[3]{col.getRed(), col.getGreen(), col.getBlue()}; | ||||
| emission_strength * col.getBlue(), | /* Collada does not support HDR color, scale to SDR */ | ||||
| col.getAlpha()); | double color_bias = (1.0 / | ||||
| fmax(fmax(final_color[0], final_color[1]), fmax(final_color[2], 1.0))) * | |||||
| fmin(emission_strength, 1.0); /* Multiply clamped emission strength.*/ | |||||
| final_color[0] *= color_bias; | |||||
| final_color[1] *= color_bias; | |||||
| final_color[2] *= color_bias; | |||||
| /* Apply final color */ | |||||
| cot.getColor().set(final_color[0], final_color[1], final_color[2], col.getAlpha()); | |||||
| return cot; | return cot; | ||||
| } | } | ||||
| Context not available. | |||||