deleted tone mapping mirrored slf and slp since they auto generate

This commit is contained in:
Anna 2019-07-11 17:10:08 -07:00
parent b59d967b6c
commit e129f88723
3 changed files with 0 additions and 73 deletions

View file

@ -33,7 +33,6 @@ void ToneMapAndResample::init(RenderArgs* args) {
// shared_ptr to gpu::State
gpu::StatePointer blitState = gpu::StatePointer(new gpu::State());
// TODO why was this in the upsample task
blitState->setDepthTest(gpu::State::DepthTest(false, false));
blitState->setColorWriteMask(true, true, true, true);

View file

@ -1 +0,0 @@
VERTEX gpu::vertex::DrawViewportQuadTransformTexcoord

View file

@ -1,71 +0,0 @@
<@include gpu/Config.slh@>
<$VERSION_HEADER$>
// Generated on Sat Oct 24 09:34:37 2015
//
// toneMapping.frag
//
// Draw texture 0 fetched at texcoord.xy
//
// Created by Sam Gateau on 6/22/2015
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
<@include render-utils/ShaderConstants.h@>
struct ToneMappingParams {
vec4 _exp_2powExp_s0_s1;
ivec4 _toneCurve_s0_s1_s2;
};
const float GAMMA_22 = 2.2;
const float INV_GAMMA_22 = 1.0 / 2.2;
const int ToneCurveNone = 0;
const int ToneCurveGamma22 = 1;
const int ToneCurveReinhard = 2;
const int ToneCurveFilmic = 3;
LAYOUT(binding=RENDER_UTILS_BUFFER_TM_PARAMS) uniform toneMappingParamsBuffer {
ToneMappingParams params;
};
float getTwoPowExposure() {
return params._exp_2powExp_s0_s1.y;
}
int getToneCurve() {
return params._toneCurve_s0_s1_s2.x;
}
LAYOUT(binding=RENDER_UTILS_TEXTURE_TM_COLOR) uniform sampler2D colorMap;
layout(location=0) in vec2 varTexCoord0;
layout(location=0) out vec4 outFragColor;
void main(void) {
vec4 fragColorRaw = texture(colorMap, vec2(1 - varTexCoord0.x, varTexCoord0.y));
vec3 fragColor = fragColorRaw.xyz;
vec3 srcColor = fragColor * getTwoPowExposure();
int toneCurve = getToneCurve();
vec3 tonedColor = srcColor;
if (toneCurve == ToneCurveFilmic) {
vec3 x = max(vec3(0.0), srcColor-0.004);
tonedColor = pow((x * (6.2 * x + 0.5)) / (x * (6.2 * x + 1.7) + 0.06), vec3(GAMMA_22));
} else if (toneCurve == ToneCurveReinhard) {
tonedColor = srcColor/(1.0 + srcColor);
} else if (toneCurve == ToneCurveGamma22) {
// We use glEnable(GL_FRAMEBUFFER_SRGB), which automatically converts textures from RGB to SRGB
// when writing from an RGB framebuffer to an SRGB framebuffer (note that it doesn't do anything
// when writing from an SRGB framebuffer to an RGB framebuffer).
// Since the conversion happens automatically, we don't need to do anything in this shader
} else {
// toneCurve == ToneCurveNone
// For debugging purposes, we may want to see what the colors look like before the automatic OpenGL
// conversion mentioned above, so we undo it here
tonedColor = pow(srcColor, vec3(GAMMA_22));
}
outFragColor = vec4(tonedColor, 1.0);
}