Added flag for disable LDR to HDR for true HDR color values.

This commit is contained in:
Jonathas Costa
2019-08-15 14:46:44 -04:00
parent 312cbab3b5
commit 8a66c0d3ee
2 changed files with 8 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ struct Fragment {
float depth;
uint blend;
bool forceFboRendering;
bool disableLDR2HDR;
};
#endif

View File

@@ -36,7 +36,13 @@ layout(location = 3) out vec4 filterBuffer;
void main() {
Fragment f = getFragment();
_out_color_ = vec4((log2(vec3(1.0) - (f.color.rgb - vec3(DeltaError)))/(-exposure)), f.color.a);
if (f.disableLDR2HDR) {
_out_color_ = f.color;
} else {
_out_color_ = vec4((log2(vec3(1.0) - (f.color.rgb - vec3(DeltaError)))/(-exposure)), f.color.a);
}
_out_color_.x = isnan(_out_color_.x) ? MaxValueColorBuffer : _out_color_.x;
_out_color_.y = isnan(_out_color_.y) ? MaxValueColorBuffer : _out_color_.y;
_out_color_.z = isnan(_out_color_.z) ? MaxValueColorBuffer : _out_color_.z;