Auto-exposure speed
This commit is contained in:
parent
6be8d83cfc
commit
d05641b4a3
|
@ -284,12 +284,12 @@ void main() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _CExposure
|
#ifdef _CExposure
|
||||||
fragColor.rgb *= compoExposureStrength;
|
fragColor.rgb += fragColor.rgb * compoExposureStrength;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _AutoExposure
|
#ifdef _AutoExposure
|
||||||
float expo = 2.0 - clamp(length(textureLod(histogram, vec2(0.5, 0.5), 0).rgb), 0.0, 1.0);
|
float expo = 2.0 - clamp(length(textureLod(histogram, vec2(0.5, 0.5), 0).rgb), 0.0, 1.0);
|
||||||
fragColor.rgb *= pow(expo, autoExposureStrength);
|
fragColor.rgb *= pow(expo, autoExposureStrength * 2.0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _CToneFilmic
|
#ifdef _CToneFilmic
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
|
#include "compiled.inc"
|
||||||
|
|
||||||
uniform sampler2D tex;
|
uniform sampler2D tex;
|
||||||
|
|
||||||
in vec2 texCoord;
|
in vec2 texCoord;
|
||||||
out vec4 fragColor;
|
out vec4 fragColor;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
const float speed = 0.01;
|
fragColor.a = 0.01 * autoExposureSpeed;
|
||||||
fragColor.a = speed;
|
|
||||||
fragColor.rgb = textureLod(tex, vec2(0.5, 0.5), 0.0).rgb +
|
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.2, 0.2), 0.0).rgb +
|
||||||
textureLod(tex, vec2(0.8, 0.2), 0.0).rgb +
|
textureLod(tex, vec2(0.8, 0.2), 0.0).rgb +
|
||||||
|
|
|
@ -157,7 +157,7 @@ def build():
|
||||||
wrd.compo_defs += '_CGrain'
|
wrd.compo_defs += '_CGrain'
|
||||||
if rpdat.arm_sharpen:
|
if rpdat.arm_sharpen:
|
||||||
wrd.compo_defs += '_CSharpen'
|
wrd.compo_defs += '_CSharpen'
|
||||||
if bpy.data.scenes[0].cycles.film_exposure != 1.0:
|
if bpy.data.scenes[0].view_settings.exposure != 0.0:
|
||||||
wrd.compo_defs += '_CExposure'
|
wrd.compo_defs += '_CExposure'
|
||||||
if rpdat.arm_fog:
|
if rpdat.arm_fog:
|
||||||
wrd.compo_defs += '_CFog'
|
wrd.compo_defs += '_CFog'
|
||||||
|
|
|
@ -33,7 +33,7 @@ def update_preset(self, context):
|
||||||
rpdat.rp_ssgi = 'SSAO'
|
rpdat.rp_ssgi = 'SSAO'
|
||||||
rpdat.rp_ssr = False
|
rpdat.rp_ssr = False
|
||||||
rpdat.rp_bloom = False
|
rpdat.rp_bloom = False
|
||||||
rpdat.rp_eyeadapt = False
|
rpdat.rp_autoexposure = False
|
||||||
rpdat.rp_motionblur = 'Off'
|
rpdat.rp_motionblur = 'Off'
|
||||||
rpdat.arm_rp_resolution = 'Display'
|
rpdat.arm_rp_resolution = 'Display'
|
||||||
rpdat.arm_texture_filter = 'Anisotropic'
|
rpdat.arm_texture_filter = 'Anisotropic'
|
||||||
|
@ -65,7 +65,7 @@ def update_preset(self, context):
|
||||||
rpdat.rp_ssgi = 'Off'
|
rpdat.rp_ssgi = 'Off'
|
||||||
rpdat.rp_ssr = False
|
rpdat.rp_ssr = False
|
||||||
rpdat.rp_bloom = False
|
rpdat.rp_bloom = False
|
||||||
rpdat.rp_eyeadapt = False
|
rpdat.rp_autoexposure = False
|
||||||
rpdat.rp_motionblur = 'Off'
|
rpdat.rp_motionblur = 'Off'
|
||||||
rpdat.arm_rp_resolution = 'Display'
|
rpdat.arm_rp_resolution = 'Display'
|
||||||
rpdat.arm_texture_filter = 'Linear'
|
rpdat.arm_texture_filter = 'Linear'
|
||||||
|
@ -100,7 +100,7 @@ def update_preset(self, context):
|
||||||
rpdat.rp_ssr = True
|
rpdat.rp_ssr = True
|
||||||
rpdat.arm_ssr_half_res = False
|
rpdat.arm_ssr_half_res = False
|
||||||
rpdat.rp_bloom = True
|
rpdat.rp_bloom = True
|
||||||
rpdat.rp_eyeadapt = False
|
rpdat.rp_autoexposure = False
|
||||||
rpdat.rp_motionblur = 'Off'
|
rpdat.rp_motionblur = 'Off'
|
||||||
rpdat.arm_rp_resolution = 'Display'
|
rpdat.arm_rp_resolution = 'Display'
|
||||||
rpdat.arm_material_model = 'Full'
|
rpdat.arm_material_model = 'Full'
|
||||||
|
@ -133,7 +133,7 @@ def update_preset(self, context):
|
||||||
rpdat.rp_ssgi = 'Off'
|
rpdat.rp_ssgi = 'Off'
|
||||||
rpdat.rp_ssr = False
|
rpdat.rp_ssr = False
|
||||||
rpdat.rp_bloom = False
|
rpdat.rp_bloom = False
|
||||||
rpdat.rp_eyeadapt = False
|
rpdat.rp_autoexposure = False
|
||||||
rpdat.rp_motionblur = 'Off'
|
rpdat.rp_motionblur = 'Off'
|
||||||
rpdat.arm_rp_resolution = 'Display'
|
rpdat.arm_rp_resolution = 'Display'
|
||||||
rpdat.arm_texture_filter = 'Linear'
|
rpdat.arm_texture_filter = 'Linear'
|
||||||
|
@ -277,7 +277,6 @@ class ArmRPListItem(bpy.types.PropertyGroup):
|
||||||
],
|
],
|
||||||
name="SSGI", description="Screen space global illumination", default='SSAO', update=update_renderpath)
|
name="SSGI", description="Screen space global illumination", default='SSAO', update=update_renderpath)
|
||||||
rp_bloom: BoolProperty(name="Bloom", description="Bloom processing", default=False, update=update_renderpath)
|
rp_bloom: BoolProperty(name="Bloom", description="Bloom processing", default=False, update=update_renderpath)
|
||||||
rp_eyeadapt: BoolProperty(name="Eye Adaptation", description="Auto-exposure based on histogram", default=False, update=update_renderpath)
|
|
||||||
rp_motionblur: EnumProperty(
|
rp_motionblur: EnumProperty(
|
||||||
items=[('Off', 'Off', 'Off'),
|
items=[('Off', 'Off', 'Off'),
|
||||||
('Camera', 'Camera', 'Camera'),
|
('Camera', 'Camera', 'Camera'),
|
||||||
|
@ -438,6 +437,7 @@ class ArmRPListItem(bpy.types.PropertyGroup):
|
||||||
arm_shadowmap_split: FloatProperty(name="Cascade Split", description="Split factor for cascaded shadow maps, higher factor favors detail on close surfaces", default=0.8, update=assets.invalidate_shader_cache)
|
arm_shadowmap_split: FloatProperty(name="Cascade Split", description="Split factor for cascaded shadow maps, higher factor favors detail on close surfaces", default=0.8, update=assets.invalidate_shader_cache)
|
||||||
arm_shadowmap_bounds: FloatProperty(name="Cascade Bounds", description="Multiply cascade bounds to capture bigger area", default=1.0, update=assets.invalidate_compiled_data)
|
arm_shadowmap_bounds: FloatProperty(name="Cascade Bounds", description="Multiply cascade bounds to capture bigger area", default=1.0, update=assets.invalidate_compiled_data)
|
||||||
arm_autoexposure_strength: FloatProperty(name="Auto Exposure Strength", default=1.0, update=assets.invalidate_shader_cache)
|
arm_autoexposure_strength: FloatProperty(name="Auto Exposure Strength", default=1.0, update=assets.invalidate_shader_cache)
|
||||||
|
arm_autoexposure_speed: FloatProperty(name="Auto Exposure Speed", default=1.0, update=assets.invalidate_shader_cache)
|
||||||
arm_ssrs_ray_step: FloatProperty(name="Step", default=0.01, update=assets.invalidate_shader_cache)
|
arm_ssrs_ray_step: FloatProperty(name="Step", default=0.01, update=assets.invalidate_shader_cache)
|
||||||
# Compositor
|
# Compositor
|
||||||
arm_letterbox: BoolProperty(name="Letterbox", default=False, update=assets.invalidate_shader_cache)
|
arm_letterbox: BoolProperty(name="Letterbox", default=False, update=assets.invalidate_shader_cache)
|
||||||
|
|
|
@ -1031,6 +1031,7 @@ class ARM_PT_RenderPathCompositorPanel(bpy.types.Panel):
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.enabled = rpdat.rp_autoexposure
|
col.enabled = rpdat.rp_autoexposure
|
||||||
col.prop(rpdat, 'arm_autoexposure_strength', text='Strength')
|
col.prop(rpdat, 'arm_autoexposure_strength', text='Strength')
|
||||||
|
col.prop(rpdat, 'arm_autoexposure_speed', text='Speed')
|
||||||
layout.prop(rpdat, 'arm_lens_texture')
|
layout.prop(rpdat, 'arm_lens_texture')
|
||||||
layout.prop(rpdat, 'arm_lut_texture')
|
layout.prop(rpdat, 'arm_lut_texture')
|
||||||
|
|
||||||
|
|
|
@ -521,6 +521,7 @@ const int volumSteps = """ + str(rpdat.arm_volumetric_light_steps) + """;
|
||||||
if rpdat.rp_autoexposure:
|
if rpdat.rp_autoexposure:
|
||||||
f.write(
|
f.write(
|
||||||
"""const float autoExposureStrength = """ + str(rpdat.arm_autoexposure_strength) + """;
|
"""const float autoExposureStrength = """ + str(rpdat.arm_autoexposure_strength) + """;
|
||||||
|
const float autoExposureSpeed = """ + str(rpdat.arm_autoexposure_speed) + """;
|
||||||
""")
|
""")
|
||||||
|
|
||||||
# Compositor
|
# Compositor
|
||||||
|
@ -544,9 +545,9 @@ const int volumSteps = """ + str(rpdat.arm_volumetric_light_steps) + """;
|
||||||
"""const float compoSharpenStrength = """ + str(round(rpdat.arm_sharpen_strength * 100) / 100) + """;
|
"""const float compoSharpenStrength = """ + str(round(rpdat.arm_sharpen_strength * 100) / 100) + """;
|
||||||
""")
|
""")
|
||||||
|
|
||||||
if bpy.data.scenes[0].cycles.film_exposure != 1.0:
|
if bpy.data.scenes[0].view_settings.exposure != 0.0:
|
||||||
f.write(
|
f.write(
|
||||||
"""const float compoExposureStrength = """ + str(round(bpy.data.scenes[0].cycles.film_exposure * 100) / 100) + """;
|
"""const float compoExposureStrength = """ + str(round(bpy.data.scenes[0].view_settings.exposure * 100) / 100) + """;
|
||||||
""")
|
""")
|
||||||
|
|
||||||
if rpdat.arm_fog:
|
if rpdat.arm_fog:
|
||||||
|
|
Loading…
Reference in a new issue