Auto exposure stubs

This commit is contained in:
luboslenco
2019-12-12 23:50:43 +01:00
parent a455d07e8e
commit 7ee0ea7741
5 changed files with 47 additions and 0 deletions
Binary file not shown.
+17
View File
@@ -0,0 +1,17 @@
#version 450
uniform sampler2D tex;
in vec2 texCoord;
out vec4 fragColor;
void main() {
const float autoExposureSpeed = 1.0;
fragColor.a = 0.01 * autoExposureSpeed;
fragColor.rgb = textureLod(tex, vec2(0.5, 0.5), 0.0).rgb +
textureLod(tex, vec2(0.2, 0.2), 0.0).rgb +
textureLod(tex, vec2(0.8, 0.2), 0.0).rgb +
textureLod(tex, vec2(0.2, 0.8), 0.0).rgb +
textureLod(tex, vec2(0.8, 0.8), 0.0).rgb;
fragColor.rgb /= 5.0;
}
+25
View File
@@ -471,9 +471,34 @@ class RenderPathDeferred {
}
#end
// Begin compositor
#if rp_autoexposure
{
{
var t = new RenderTargetRaw();
t.name = "histogram";
t.width = 1;
t.height = 1;
t.format = "RGBA64";
path.createRenderTarget(t);
path.loadShader("shader_datas/histogram_pass/histogram_pass");
}
path.setTarget("histogram");
path.bindTarget("taa", "tex");
path.drawShader("shader_datas/histogram_pass/histogram_pass");
}
#end
path.setTarget("buf");
path.bindTarget("tex", "tex");
#if rp_autoexposure
{
path.bindTarget("histogram", "histogram");
}
#end
path.drawShader("shader_datas/compositor_pass/compositor_pass");
// End compositor
path.setTarget("buf");
var currentG = path.currentG;
+4
View File
@@ -182,6 +182,10 @@ class BoxPreferences {
UITrait.inst.vignetteStrength = ui.slider(h, "Vignette", 0.0, 1.0, true);
if (h.changed) Context.ddirty = 2;
// var h = Id.handle({value: UITrait.inst.autoExposureStrength});
// UITrait.inst.autoExposureStrength = ui.slider(h, "Auto Exposure", 0.0, 2.0, true);
// if (h.changed) Context.ddirty = 2;
#if arm_creator
var h = Id.handle({value: UITrait.inst.vxaoExt});
UITrait.inst.vxaoExt = ui.slider(h, "VXAO Ext", 1.0, 10.0);
+1
View File
@@ -245,6 +245,7 @@ class UITrait {
public var vxaoOffset = 1.5;
public var vxaoAperture = 1.2;
public var vignetteStrength = 0.4;
// public var autoExposureStrength = 1.0;
public var textureExportPath = "";
public var headerHandle = new Handle({layout: Horizontal});
public var toolbarHandle = new Handle();