Fix emission
This commit is contained in:
parent
8e2de33dc9
commit
5b91790265
|
@ -101,7 +101,6 @@ void main() {
|
|||
|
||||
vec3 indirectSpecular = traceSpecular(voxpos, n, v, metrough.y);
|
||||
indirectSpecular *= f0 * envBRDF.x + envBRDF.y;
|
||||
indirectSpecular = vec3(0.0);
|
||||
|
||||
fragColor.rgb = indirectDiffuse.rgb * voxelgiDiff * g1.rgb + indirectSpecular * voxelgiSpec;
|
||||
|
||||
|
|
|
@ -53,9 +53,9 @@ vec4 traceCone(const vec3 origin, vec3 dir, float aperture, const float maxDist,
|
|||
float mip = max(log2(diam * voxelgiResolution), 0);
|
||||
// vec4 mipSample = sampleVoxel(samplePos, dir, indices, mip);
|
||||
vec4 mipSample = textureLod(voxels, samplePos * 0.5 + vec3(0.5), mip);
|
||||
// #ifdef _Cycles
|
||||
// mipSample.rgb = min(mipSample.rgb * 0.9, vec3(0.9)) + max((mipSample.rgb - 0.9) * 200.0, 0.0); // Higher range to allow emission
|
||||
// #endif
|
||||
#ifdef _VoxelGIEmission
|
||||
mipSample.rgb = min(mipSample.rgb * 0.9, vec3(0.9)) + max((mipSample.rgb - 0.9) * 200.0, 0.0); // Higher range to allow emission
|
||||
#endif
|
||||
// Blend mip sample with current sample color
|
||||
sampleCol += ((1 - sampleCol.a) * mipSample) * (1.0 / max(voxelgiOcc, 0.1));
|
||||
dist += max(diam / 2, VOXEL_SIZE); // Step size
|
||||
|
|
|
@ -133,6 +133,7 @@ def set_preset(self, context, preset):
|
|||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_gi = 'Voxel GI'
|
||||
rpdat.rp_voxelgi_resolution = '256'
|
||||
rpdat.rp_voxelgi_emission = True
|
||||
rpdat.rp_render_to_texture = True
|
||||
rpdat.rp_supersampling = '2'
|
||||
rpdat.rp_antialiasing = 'TAA'
|
||||
|
@ -275,6 +276,42 @@ def set_preset(self, context, preset):
|
|||
rpdat.arm_rp_resolution = 'Display'
|
||||
rpdat.arm_texture_filter = 'Anisotropic'
|
||||
rpdat.arm_diffuse_model = 'Lambert'
|
||||
elif preset == 'Max':
|
||||
rpdat.rp_renderer = 'Deferred'
|
||||
rpdat.rp_shadowmap = '8192'
|
||||
rpdat.rp_translucency_state = 'Auto'
|
||||
rpdat.rp_overlays_state = 'Auto'
|
||||
rpdat.rp_decals_state = 'Auto'
|
||||
rpdat.rp_sss_state = 'Auto'
|
||||
rpdat.rp_blending_state = 'Off'
|
||||
rpdat.rp_hdr = True
|
||||
rpdat.rp_background = 'World'
|
||||
rpdat.rp_stereo = False
|
||||
rpdat.rp_greasepencil = False
|
||||
rpdat.rp_gi = 'Voxel GI'
|
||||
rpdat.rp_voxelgi_resolution = '128'
|
||||
rpdat.arm_voxelgi_revoxelize = True
|
||||
rpdat.arm_voxelgi_camera = True
|
||||
rpdat.rp_voxelgi_emission = False
|
||||
rpdat.rp_render_to_texture = True
|
||||
rpdat.rp_supersampling = '1'
|
||||
rpdat.rp_antialiasing = 'TAA'
|
||||
rpdat.rp_compositornodes = True
|
||||
rpdat.rp_volumetriclight = False
|
||||
rpdat.rp_ssao = True
|
||||
rpdat.rp_ssr = True
|
||||
rpdat.rp_dfrs = False
|
||||
rpdat.rp_dfao = False
|
||||
rpdat.rp_dfgi = False
|
||||
rpdat.rp_bloom = False
|
||||
rpdat.rp_eyeadapt = False
|
||||
rpdat.rp_rendercapture = True
|
||||
rpdat.rp_motionblur = 'None'
|
||||
rpdat.arm_rp_resolution = 'Display'
|
||||
rpdat.arm_material_model = 'Full'
|
||||
rpdat.arm_pcss_state = 'On'
|
||||
rpdat.arm_texture_filter = 'Anisotropic'
|
||||
rpdat.arm_diffuse_model = 'OrenNayar'
|
||||
|
||||
updating_preset = False
|
||||
set_renderpath(self, context)
|
||||
|
|
|
@ -140,6 +140,7 @@ def build_node_tree(world):
|
|||
wrd.world_defs += '_VoxelGICone5'
|
||||
wrd.world_defs += '_Rad' # Always do radiance for voxels
|
||||
wrd.world_defs += '_Irr'
|
||||
|
||||
if voxelgi:
|
||||
assets.add_khafile_def('arm_voxelgi')
|
||||
if rpdat.arm_voxelgi_shadows:
|
||||
|
@ -148,8 +149,9 @@ def build_node_tree(world):
|
|||
if rpdat.arm_voxelgi_refraction:
|
||||
wrd.world_defs += '_VoxelGIDirect'
|
||||
wrd.world_defs += '_VoxelGIRefract'
|
||||
if rpdat.arm_voxelgi_emission:
|
||||
wrd.world_defs += '_VoxelGIEmission'
|
||||
wrd.world_defs += '_VoxelGI'
|
||||
|
||||
elif voxelao:
|
||||
wrd.world_defs += '_VoxelAO'
|
||||
|
||||
|
|
|
@ -198,8 +198,8 @@ def make_gi(context_id):
|
|||
frag.write('vec3 color = basecol * visibility * lightColor * dotNL;')
|
||||
frag.write('vec3 voxel = voxposition * 0.5 + 0.5;')
|
||||
|
||||
# if rpdat.arm_material_model == 'Cycles':
|
||||
# frag.write('color = min(color * 0.9, vec3(0.9)) + min(color / 200.0, 0.1);') # Higher range to allow emission
|
||||
if rpdat.arm_voxelgi_emission:
|
||||
frag.write('color = min(color * 0.9, vec3(0.9)) + min(color / 200.0, 0.1);') # Higher range to allow emission
|
||||
|
||||
# if rpdat.rp_voxelgi_hdr:
|
||||
# frag.write('imageStore(voxels, ivec3(voxelgiResolution * voxel), vec4(color, 1.0));')
|
||||
|
|
|
@ -171,6 +171,7 @@ def init_properties():
|
|||
('Deferred Plus', 'Deferred Plus (experimental)', 'Deferred Plus'),
|
||||
('Grease Pencil', 'Grease Pencil', 'Grease Pencil'),
|
||||
('Render Capture', 'Render Capture', 'Render Capture'),
|
||||
('Max', 'Max', 'Max'),
|
||||
],
|
||||
name="Preset", description="Render path preset", default='Deferred', update=update_preset)
|
||||
bpy.types.World.arm_voxelgi_diff = bpy.props.FloatProperty(name="Diffuse", description="", default=1.0, update=assets.invalidate_shader_cache)
|
||||
|
|
|
@ -202,6 +202,7 @@ class ArmRPListItem(bpy.types.PropertyGroup):
|
|||
# arm_voxelgi_anisotropic = bpy.props.BoolProperty(name="Anisotropic", description="Use anisotropic voxels", default=False, update=update_renderpath)
|
||||
arm_voxelgi_shadows = bpy.props.BoolProperty(name="Trace Shadows", description="Use voxels to render shadows", default=False, update=update_renderpath)
|
||||
arm_voxelgi_refraction = bpy.props.BoolProperty(name="Trace Refraction", description="Use voxels to render refraction", default=False, update=update_renderpath)
|
||||
arm_voxelgi_emission = bpy.props.BoolProperty(name="Emission", description="Encode emission into voxelized data", default=False, update=update_renderpath)
|
||||
arm_samples_per_pixel = EnumProperty(
|
||||
items=[('1', '1X', '1X'),
|
||||
('2', '2X', '2X'),
|
||||
|
|
|
@ -984,6 +984,8 @@ class ArmRenderPathPanel(bpy.types.Panel):
|
|||
layout.prop(rpdat, 'arm_voxelgi_shadows')
|
||||
layout.prop(rpdat, 'arm_voxelgi_refraction')
|
||||
# layout.prop(rpdat, 'rp_voxelgi_hdr')
|
||||
if rpdat.rp_gi == 'Voxel GI':
|
||||
layout.prop(rpdat, 'arm_voxelgi_emission')
|
||||
|
||||
layout.separator()
|
||||
layout.prop(rpdat, "rp_render_to_texture")
|
||||
|
|
Loading…
Reference in a new issue