Auto exposure stubs
This commit is contained in:
Binary file not shown.
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user