vxgi relight option
This commit is contained in:
parent
09db2a4d01
commit
663332c7a1
|
@ -388,15 +388,14 @@ class Inc {
|
|||
bounce_tb = bounce_sh.getTextureUnit("voxelsFrom");
|
||||
bounce_tc = bounce_sh.getTextureUnit("voxelsTo");
|
||||
}
|
||||
// path.clearImage("voxelsOpac", 0x00000000);
|
||||
// path.currentG;
|
||||
// path.clearImage("voxelsBounce", 0x00000000);
|
||||
kha.compute.Compute.setShader(bounce_sh);
|
||||
kha.compute.Compute.setTexture(bounce_ta, rts.get("voxelsNor").image, kha.compute.Access.Read);
|
||||
kha.compute.Compute.setTexture3DParameters(bounce_tb, kha.graphics4.TextureAddressing.Clamp, kha.graphics4.TextureAddressing.Clamp, kha.graphics4.TextureAddressing.Clamp, kha.graphics4.TextureFilter.LinearFilter, kha.graphics4.TextureFilter.PointFilter, kha.graphics4.MipMapFilter.LinearMipFilter);
|
||||
kha.compute.Compute.setSampledTexture(bounce_tb, rts.get("voxels").image);
|
||||
kha.compute.Compute.setTexture(bounce_tc, rts.get("voxelsOpac").image, kha.compute.Access.Write);
|
||||
kha.compute.Compute.setTexture(bounce_tc, rts.get("voxelsBounce").image, kha.compute.Access.Write);
|
||||
kha.compute.Compute.compute(res, res, res);
|
||||
path.generateMipmaps("voxelsOpac");
|
||||
path.generateMipmaps("voxelsBounce");
|
||||
#end
|
||||
}
|
||||
#end
|
||||
|
|
|
@ -45,6 +45,9 @@ class RenderPathDeferred {
|
|||
{
|
||||
Inc.initGI("voxelsOpac");
|
||||
Inc.initGI("voxelsNor");
|
||||
#if (rp_gi_bounces)
|
||||
Inc.initGI("voxelsBounce");
|
||||
#end
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
@ -470,6 +473,7 @@ class RenderPathDeferred {
|
|||
}
|
||||
#end
|
||||
|
||||
var relight = false;
|
||||
if (voxelize) {
|
||||
var res = Inc.getVoxelRes();
|
||||
|
||||
|
@ -485,13 +489,24 @@ class RenderPathDeferred {
|
|||
path.bindTarget(voxtex, "voxels");
|
||||
path.drawMeshes("voxel");
|
||||
|
||||
relight = true;
|
||||
}
|
||||
|
||||
#if ((rp_gi == "Voxel GI") && (rp_voxelgi_relight))
|
||||
// Relight if lamp was moved
|
||||
for (lamp in iron.Scene.active.lamps) {
|
||||
if (lamp.transform.diff()) { relight = true; break; }
|
||||
}
|
||||
#end
|
||||
|
||||
if (relight) {
|
||||
#if (rp_gi == "Voxel GI")
|
||||
Inc.computeVoxels();
|
||||
#if (rp_gi_bounces)
|
||||
voxels = "voxelsOpac";
|
||||
voxels = "voxelsBounce";
|
||||
#end
|
||||
#else
|
||||
path.generateMipmaps(voxels);
|
||||
path.generateMipmaps(voxels); // AO
|
||||
#end
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,6 +93,9 @@ class RenderPathForward {
|
|||
{
|
||||
Inc.initGI("voxelsOpac");
|
||||
Inc.initGI("voxelsNor");
|
||||
#if (rp_gi_bounces)
|
||||
Inc.initGI("voxelsBounce");
|
||||
#end
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
@ -218,6 +221,7 @@ class RenderPathForward {
|
|||
}
|
||||
#end
|
||||
|
||||
var relight = false;
|
||||
if (voxelize) {
|
||||
var res = Inc.getVoxelRes();
|
||||
|
||||
|
@ -233,13 +237,24 @@ class RenderPathForward {
|
|||
path.bindTarget(voxtex, "voxels");
|
||||
path.drawMeshes("voxel");
|
||||
|
||||
relight = true;
|
||||
}
|
||||
|
||||
#if ((rp_gi == "Voxel GI") && (rp_voxelgi_relight))
|
||||
// Relight if lamp was moved
|
||||
for (lamp in iron.Scene.active.lamps) {
|
||||
if (lamp.transform.diff()) { relight = true; break; }
|
||||
}
|
||||
#end
|
||||
|
||||
if (relight) {
|
||||
#if (rp_gi == "Voxel GI")
|
||||
Inc.computeVoxels();
|
||||
#if (rp_gi_bounces)
|
||||
voxels = "voxelsOpac";
|
||||
voxels = "voxelsBounce";
|
||||
#end
|
||||
#else
|
||||
path.generateMipmaps(voxels);
|
||||
path.generateMipmaps(voxels); // AO
|
||||
#end
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,6 +102,8 @@ def add_world_defs():
|
|||
wrd.world_defs += '_VoxelGIRefract'
|
||||
if rpdat.arm_voxelgi_emission:
|
||||
wrd.world_defs += '_VoxelGIEmission'
|
||||
if rpdat.rp_voxelgi_relight:
|
||||
assets.add_khafile_def('rp_voxelgi_relight')
|
||||
elif voxelao:
|
||||
wrd.world_defs += '_VoxelAO'
|
||||
|
||||
|
|
|
@ -499,6 +499,7 @@ class ArmRPListItem(bpy.types.PropertyGroup):
|
|||
arm_ssr_half_res = BoolProperty(name="Half Res", description="Trace in half resolution", default=True, update=update_renderpath)
|
||||
rp_ssr_z_only = BoolProperty(name="Z Only", description="Trace in Z axis only", default=False, update=update_renderpath)
|
||||
rp_voxelgi_hdr = BoolProperty(name="HDR Voxels", description="Store voxels in RGBA64 instead of RGBA32", default=False, update=update_renderpath)
|
||||
rp_voxelgi_relight = BoolProperty(name="Relight", description="Relight voxels when lamp is moved", default=True, update=update_renderpath)
|
||||
arm_voxelgi_dimensions = FloatProperty(name="Dimensions", description="Voxelization bounds",default=16, update=assets.invalidate_shader_cache)
|
||||
arm_voxelgi_revoxelize = BoolProperty(name="Revoxelize", description="Revoxelize scene each frame", default=False, update=assets.invalidate_shader_cache)
|
||||
arm_voxelgi_temporal = BoolProperty(name="Temporal Filter", description="Use temporal filtering to stabilize voxels", default=False, update=assets.invalidate_shader_cache)
|
||||
|
|
|
@ -1003,9 +1003,11 @@ class ArmRenderPathPanel(bpy.types.Panel):
|
|||
col2.enabled = rpdat.rp_gi == 'Voxel GI'
|
||||
col2.prop(rpdat, 'arm_voxelgi_bounces')
|
||||
row2 = col2.row()
|
||||
row2.prop(rpdat, 'rp_voxelgi_relight')
|
||||
row2.prop(rpdat, 'rp_voxelgi_hdr', text='HDR')
|
||||
row2 = col2.row()
|
||||
row2.prop(rpdat, 'arm_voxelgi_refraction', text='Refraction')
|
||||
row2.prop(rpdat, 'arm_voxelgi_shadows', text='Shadows')
|
||||
row2.prop(rpdat, 'rp_voxelgi_hdr', text='HDR')
|
||||
col.prop(rpdat, 'arm_voxelgi_cones')
|
||||
col.prop(rpdat, 'rp_voxelgi_resolution')
|
||||
col.prop(rpdat, 'rp_voxelgi_resolution_z')
|
||||
|
@ -1018,6 +1020,7 @@ class ArmRenderPathPanel(bpy.types.Panel):
|
|||
col.label("Light")
|
||||
row = col.row(align=True)
|
||||
row.alignment = 'EXPAND'
|
||||
row.enabled = rpdat.rp_gi == 'Voxel GI'
|
||||
row.prop(rpdat, 'arm_voxelgi_diff')
|
||||
row.prop(rpdat, 'arm_voxelgi_spec')
|
||||
row = col.row(align=True)
|
||||
|
|
Loading…
Reference in a new issue