Merge branch 'blender-v5.0-release'
This commit is contained in:
@@ -93,7 +93,10 @@ void FallbackGPUShaderBinder::construct_scene_linear_shader(
|
||||
|
||||
const std::string fragment_source = generate_scene_linear_fragment_source(display_shader);
|
||||
|
||||
if (!create_gpu_shader(display_shader, fragment_source, {{"USE_TO_SCENE_LINEAR_ONLY", ""}})) {
|
||||
if (!create_gpu_shader(display_shader,
|
||||
fragment_source,
|
||||
{{"USE_TO_SCENE_LINEAR_ONLY", ""}, {"OUTPUT_PREMULTIPLIED", ""}}))
|
||||
{
|
||||
display_shader.is_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +261,10 @@ void LibOCIOGPUShaderBinder::construct_scene_linear_shader(
|
||||
}
|
||||
|
||||
construct_shader_for_processors(
|
||||
display_shader, processor_to_scene_linear, nullptr, {{"USE_TO_SCENE_LINEAR_ONLY", ""}});
|
||||
display_shader,
|
||||
processor_to_scene_linear,
|
||||
nullptr,
|
||||
{{"USE_TO_SCENE_LINEAR_ONLY", ""}, {"OUTPUT_PREMULTIPLIED", ""}});
|
||||
}
|
||||
|
||||
} // namespace blender::ocio
|
||||
|
||||
@@ -243,6 +243,12 @@ float4 OCIO_ProcessColor(float4 col, float4 col_overlay)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OUTPUT_PREMULTIPLIED
|
||||
if (col.a > 0.0 && col.a < 1.0) {
|
||||
col.rgb *= col.a;
|
||||
}
|
||||
#endif
|
||||
|
||||
return col;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user