2016-09-23 00:34:42 +02:00
|
|
|
import bpy
|
2017-03-15 12:30:14 +01:00
|
|
|
import arm.assets as assets
|
|
|
|
import arm.utils
|
2017-12-05 22:00:27 +01:00
|
|
|
import arm.log as log
|
2017-12-05 23:06:24 +01:00
|
|
|
import arm.make_state as state
|
2018-01-04 16:22:16 +01:00
|
|
|
import arm.api
|
2018-01-03 15:09:55 +01:00
|
|
|
|
2018-03-07 23:37:47 +01:00
|
|
|
callback = None
|
|
|
|
|
2017-12-20 22:56:22 +01:00
|
|
|
def add_world_defs():
|
|
|
|
wrd = bpy.data.worlds['Arm']
|
|
|
|
rpdat = arm.utils.get_rp()
|
|
|
|
|
|
|
|
# Screen-space ray-traced shadows
|
|
|
|
if rpdat.arm_ssrs:
|
|
|
|
wrd.world_defs += '_SSRS'
|
|
|
|
|
2019-05-21 21:53:57 +02:00
|
|
|
if rpdat.arm_micro_shadowing:
|
|
|
|
wrd.world_defs += '_MicroShadowing'
|
|
|
|
|
2018-08-28 15:10:28 +02:00
|
|
|
if rpdat.arm_two_sided_area_light:
|
|
|
|
wrd.world_defs += '_TwoSidedAreaLight'
|
2017-12-20 22:56:22 +01:00
|
|
|
|
|
|
|
# Store contexts
|
|
|
|
if rpdat.rp_hdr == False:
|
|
|
|
wrd.world_defs += '_LDR'
|
|
|
|
|
2018-08-28 15:10:28 +02:00
|
|
|
if wrd.arm_light_ies_texture != '':
|
|
|
|
wrd.world_defs += '_LightIES'
|
2017-12-20 22:56:22 +01:00
|
|
|
assets.add_embedded_data('iestexture.png')
|
|
|
|
|
2018-08-28 15:10:28 +02:00
|
|
|
if wrd.arm_light_clouds_texture != '':
|
|
|
|
wrd.world_defs += '_LightClouds'
|
2017-12-20 22:56:22 +01:00
|
|
|
assets.add_embedded_data('cloudstexture.png')
|
|
|
|
|
|
|
|
if rpdat.rp_renderer == 'Deferred':
|
|
|
|
assets.add_khafile_def('arm_deferred')
|
2018-04-25 22:38:52 +02:00
|
|
|
wrd.world_defs += '_Deferred'
|
|
|
|
|
2018-01-28 16:16:21 +01:00
|
|
|
# Shadows
|
2018-12-10 00:02:40 +01:00
|
|
|
if rpdat.rp_shadows:
|
2018-11-22 11:08:03 +01:00
|
|
|
wrd.world_defs += '_ShadowMap'
|
2018-06-28 16:26:15 +02:00
|
|
|
if rpdat.rp_shadowmap_cascades != '1':
|
2019-04-06 18:52:21 +02:00
|
|
|
wrd.world_defs += '_CSM'
|
|
|
|
assets.add_khafile_def('arm_csm')
|
2017-12-20 22:56:22 +01:00
|
|
|
# SS
|
|
|
|
if rpdat.rp_ssgi == 'RTGI' or rpdat.rp_ssgi == 'RTAO':
|
|
|
|
if rpdat.rp_ssgi == 'RTGI':
|
|
|
|
wrd.world_defs += '_RTGI'
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_ssgi_rays == '9':
|
2017-12-20 22:56:22 +01:00
|
|
|
wrd.world_defs += '_SSGICone9'
|
|
|
|
if rpdat.rp_autoexposure:
|
|
|
|
wrd.world_defs += '_AutoExposure'
|
|
|
|
|
2019-04-06 18:52:21 +02:00
|
|
|
has_voxels = arm.utils.voxel_support()
|
|
|
|
if rpdat.rp_voxelao and has_voxels and rpdat.arm_material_model == 'Full':
|
2018-03-15 16:02:56 +01:00
|
|
|
wrd.world_defs += '_VoxelCones' + rpdat.arm_voxelgi_cones
|
2017-12-20 22:56:22 +01:00
|
|
|
if rpdat.arm_voxelgi_revoxelize:
|
|
|
|
assets.add_khafile_def('arm_voxelgi_revox')
|
|
|
|
if rpdat.arm_voxelgi_camera:
|
|
|
|
wrd.world_defs += '_VoxelGICam'
|
|
|
|
if rpdat.arm_voxelgi_temporal:
|
|
|
|
assets.add_khafile_def('arm_voxelgi_temporal')
|
|
|
|
wrd.world_defs += '_VoxelGITemporal'
|
2019-04-06 18:52:21 +02:00
|
|
|
wrd.world_defs += '_VoxelAOvar' # Write a shader variant
|
|
|
|
if rpdat.arm_voxelgi_shadows:
|
|
|
|
wrd.world_defs += '_VoxelShadow'
|
|
|
|
if rpdat.arm_voxelgi_occ == 0.0:
|
|
|
|
wrd.world_defs += '_VoxelAONoTrace'
|
2017-12-20 22:56:22 +01:00
|
|
|
|
2019-02-13 16:29:53 +01:00
|
|
|
if arm.utils.get_legacy_shaders() or 'ios' in state.target:
|
2018-06-28 16:26:15 +02:00
|
|
|
wrd.world_defs += '_Legacy'
|
2019-02-10 20:37:38 +01:00
|
|
|
assets.add_khafile_def('arm_legacy')
|
2018-06-28 16:26:15 +02:00
|
|
|
|
2018-11-22 11:08:03 +01:00
|
|
|
# Light defines
|
2018-12-10 17:25:29 +01:00
|
|
|
point_lights = 0
|
|
|
|
for bo in bpy.data.objects: # TODO: temp
|
2018-12-19 13:33:17 +01:00
|
|
|
if bo.type == 'LIGHT':
|
2018-12-10 17:25:29 +01:00
|
|
|
light = bo.data
|
|
|
|
if light.type == 'AREA' and '_LTC' not in wrd.world_defs:
|
2019-01-27 19:12:00 +01:00
|
|
|
point_lights += 1
|
2018-12-10 17:25:29 +01:00
|
|
|
wrd.world_defs += '_LTC'
|
|
|
|
assets.add_khafile_def('arm_ltc')
|
|
|
|
if light.type == 'SUN' and '_Sun' not in wrd.world_defs:
|
|
|
|
wrd.world_defs += '_Sun'
|
|
|
|
if light.type == 'POINT' or light.type == 'SPOT':
|
|
|
|
point_lights += 1
|
|
|
|
if light.type == 'SPOT' and '_Spot' not in wrd.world_defs:
|
|
|
|
wrd.world_defs += '_Spot'
|
|
|
|
assets.add_khafile_def('arm_spot')
|
|
|
|
|
|
|
|
if point_lights == 1:
|
|
|
|
wrd.world_defs += '_SinglePoint'
|
|
|
|
elif point_lights > 1:
|
|
|
|
wrd.world_defs += '_Clusters'
|
|
|
|
assets.add_khafile_def('arm_clusters')
|
2017-12-20 22:56:22 +01:00
|
|
|
|
2019-05-26 21:03:25 +02:00
|
|
|
if '_Rad' in wrd.world_defs and '_Brdf' not in wrd.world_defs:
|
2018-01-29 19:06:57 +01:00
|
|
|
wrd.world_defs += '_Brdf'
|
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
def build():
|
2018-01-04 16:22:16 +01:00
|
|
|
rpdat = arm.utils.get_rp()
|
|
|
|
if rpdat.rp_driver != 'Armory' and arm.api.drivers[rpdat.rp_driver]['make_rpath'] != None:
|
|
|
|
arm.api.drivers[rpdat.rp_driver]['make_rpath']()
|
2018-01-03 15:09:55 +01:00
|
|
|
return
|
|
|
|
|
2018-08-16 23:07:50 +02:00
|
|
|
assets_path = arm.utils.get_sdk_path() + '/armory/Assets/'
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd = bpy.data.worlds['Arm']
|
2017-08-19 12:10:06 +02:00
|
|
|
|
2017-12-20 22:56:22 +01:00
|
|
|
add_world_defs()
|
|
|
|
|
2017-10-01 19:42:47 +02:00
|
|
|
mobile_mat = rpdat.arm_material_model == 'Mobile' or rpdat.arm_material_model == 'Solid'
|
|
|
|
if not mobile_mat:
|
2017-06-18 19:20:20 +02:00
|
|
|
# Always include
|
|
|
|
assets.add(assets_path + 'brdf.png')
|
|
|
|
assets.add_embedded_data('brdf.png')
|
2016-09-23 00:34:42 +02:00
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_hdr:
|
|
|
|
assets.add_khafile_def('rp_hdr')
|
|
|
|
|
|
|
|
assets.add_khafile_def('rp_renderer={0}'.format(rpdat.rp_renderer))
|
|
|
|
if rpdat.rp_depthprepass:
|
|
|
|
assets.add_khafile_def('rp_depthprepass')
|
|
|
|
|
2018-12-10 00:02:40 +01:00
|
|
|
if rpdat.rp_shadows:
|
2017-11-22 21:17:36 +01:00
|
|
|
assets.add_khafile_def('rp_shadowmap')
|
2019-01-21 17:59:25 +01:00
|
|
|
assets.add_khafile_def('rp_shadowmap_cascade={0}'.format(arm.utils.get_cascade_size(rpdat)))
|
2018-12-10 00:02:40 +01:00
|
|
|
assets.add_khafile_def('rp_shadowmap_cube={0}'.format(rpdat.rp_shadowmap_cube))
|
2017-11-22 21:17:36 +01:00
|
|
|
|
|
|
|
assets.add_khafile_def('rp_background={0}'.format(rpdat.rp_background))
|
|
|
|
if rpdat.rp_background == 'World':
|
2017-12-20 10:19:44 +01:00
|
|
|
assets.add_shader_pass('world_pass')
|
2017-11-22 21:17:36 +01:00
|
|
|
if '_EnvClouds' in wrd.world_defs:
|
2019-04-25 22:39:08 +02:00
|
|
|
assets.add(assets_path + 'clouds_base.raw')
|
|
|
|
assets.add_embedded_data('clouds_base.raw')
|
|
|
|
assets.add(assets_path + 'clouds_detail.raw')
|
|
|
|
assets.add_embedded_data('clouds_detail.raw')
|
|
|
|
assets.add(assets_path + 'clouds_map.png')
|
|
|
|
assets.add_embedded_data('clouds_map.png')
|
2017-11-22 21:17:36 +01:00
|
|
|
|
2018-07-24 21:28:03 +02:00
|
|
|
if rpdat.rp_renderer == 'Deferred' and not rpdat.rp_compositornodes:
|
2018-11-22 11:08:03 +01:00
|
|
|
assets.add_shader_pass('copy_pass')
|
2018-06-28 16:26:15 +02:00
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_render_to_texture:
|
|
|
|
assets.add_khafile_def('rp_render_to_texture')
|
|
|
|
|
2018-12-15 19:03:11 +01:00
|
|
|
if rpdat.rp_renderer == 'Forward' and not rpdat.rp_compositornodes:
|
|
|
|
assets.add_shader_pass('copy_pass')
|
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_compositornodes:
|
|
|
|
assets.add_khafile_def('rp_compositornodes')
|
|
|
|
compo_depth = False
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_tonemap != 'Off':
|
|
|
|
wrd.compo_defs = '_CTone' + rpdat.arm_tonemap
|
2017-12-15 12:52:58 +01:00
|
|
|
if rpdat.rp_antialiasing == 'FXAA':
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CFXAA'
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_letterbox:
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CLetterbox'
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_grain:
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CGrain'
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_sharpen:
|
2018-03-02 17:02:27 +01:00
|
|
|
wrd.compo_defs += '_CSharpen'
|
2019-05-01 10:52:42 +02:00
|
|
|
if bpy.data.scenes[0].view_settings.exposure != 0.0:
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CExposure'
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_fog:
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CFog'
|
|
|
|
compo_depth = True
|
2019-05-20 14:32:48 +02:00
|
|
|
|
|
|
|
focus_distance = 0.0 # TODO: deprecated
|
|
|
|
if len(bpy.data.cameras) > 0:
|
|
|
|
cam = bpy.data.cameras[0]
|
|
|
|
focus_distance = cam.dof.focus_distance if hasattr(cam, 'dof') else cam.dof_distance
|
|
|
|
|
|
|
|
if len(bpy.data.cameras) > 0 and focus_distance > 0.0:
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CDOF'
|
|
|
|
compo_depth = True
|
|
|
|
if compo_depth:
|
|
|
|
wrd.compo_defs += '_CDepth'
|
2017-12-20 22:56:22 +01:00
|
|
|
assets.add_khafile_def('rp_compositordepth')
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_lens_texture != '':
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CLensTex'
|
|
|
|
assets.add_embedded_data('lenstexture.jpg')
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_fisheye:
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CFishEye'
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_vignette:
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CVignette'
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_lensflare:
|
2017-11-22 21:17:36 +01:00
|
|
|
wrd.compo_defs += '_CGlare'
|
2018-03-15 16:02:56 +01:00
|
|
|
if rpdat.arm_lut_texture != '':
|
2017-12-07 17:43:59 +01:00
|
|
|
wrd.compo_defs += '_CLUT'
|
2017-12-07 18:04:17 +01:00
|
|
|
assets.add_embedded_data('luttexture.jpg')
|
2018-03-02 17:02:27 +01:00
|
|
|
if '_CDOF' in wrd.compo_defs or '_CFXAA' in wrd.compo_defs or '_CSharpen' in wrd.compo_defs:
|
|
|
|
wrd.compo_defs += '_CTexStep'
|
2018-09-01 18:35:32 +02:00
|
|
|
if '_CDOF' in wrd.compo_defs or '_CFog' in wrd.compo_defs or '_CGlare' in wrd.compo_defs:
|
|
|
|
wrd.compo_defs += '_CCameraProj'
|
2017-12-13 14:21:42 +01:00
|
|
|
assets.add_shader_pass('compositor_pass')
|
2017-11-22 21:17:36 +01:00
|
|
|
|
|
|
|
assets.add_khafile_def('rp_antialiasing={0}'.format(rpdat.rp_antialiasing))
|
|
|
|
|
|
|
|
if rpdat.rp_antialiasing == 'SMAA' or rpdat.rp_antialiasing == 'TAA':
|
2017-12-13 14:21:42 +01:00
|
|
|
assets.add_shader_pass('smaa_edge_detect')
|
|
|
|
assets.add_shader_pass('smaa_blend_weight')
|
|
|
|
assets.add_shader_pass('smaa_neighborhood_blend')
|
2017-11-22 21:17:36 +01:00
|
|
|
assets.add(assets_path + 'smaa_area.png')
|
|
|
|
assets.add(assets_path + 'smaa_search.png')
|
|
|
|
assets.add_embedded_data('smaa_area.png')
|
|
|
|
assets.add_embedded_data('smaa_search.png')
|
|
|
|
wrd.world_defs += '_SMAA'
|
|
|
|
if rpdat.rp_antialiasing == 'TAA':
|
2017-12-13 14:21:42 +01:00
|
|
|
assets.add_shader_pass('taa_pass')
|
|
|
|
assets.add_shader_pass('copy_pass')
|
2017-11-22 21:17:36 +01:00
|
|
|
|
|
|
|
if rpdat.rp_antialiasing == 'TAA' or rpdat.rp_motionblur == 'Object':
|
2016-10-12 18:26:56 +02:00
|
|
|
assets.add_khafile_def('arm_veloc')
|
2017-08-21 15:36:21 +02:00
|
|
|
wrd.world_defs += '_Veloc'
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_antialiasing == 'TAA':
|
|
|
|
assets.add_khafile_def('arm_taa')
|
2016-09-23 00:34:42 +02:00
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
assets.add_khafile_def('rp_supersampling={0}'.format(rpdat.rp_supersampling))
|
|
|
|
if rpdat.rp_supersampling == '4':
|
2017-12-13 14:21:42 +01:00
|
|
|
assets.add_shader_pass('supersample_resolve')
|
2017-08-13 22:50:08 +02:00
|
|
|
|
2018-12-15 19:03:11 +01:00
|
|
|
assets.add_khafile_def('rp_ssgi={0}'.format(rpdat.rp_ssgi))
|
|
|
|
if rpdat.rp_ssgi != 'Off':
|
|
|
|
wrd.world_defs += '_SSAO'
|
|
|
|
if rpdat.rp_ssgi == 'SSAO':
|
|
|
|
assets.add_shader_pass('ssao_pass')
|
|
|
|
assets.add_shader_pass('blur_edge_pass')
|
|
|
|
else:
|
|
|
|
assets.add_shader_pass('ssgi_pass')
|
|
|
|
assets.add_shader_pass('blur_edge_pass')
|
|
|
|
if rpdat.arm_ssgi_half_res:
|
|
|
|
assets.add_khafile_def('rp_ssgi_half')
|
|
|
|
|
|
|
|
if rpdat.rp_bloom:
|
|
|
|
assets.add_khafile_def('rp_bloom')
|
|
|
|
assets.add_shader_pass('bloom_pass')
|
|
|
|
assets.add_shader_pass('blur_gaus_pass')
|
|
|
|
|
|
|
|
if rpdat.rp_ssr:
|
|
|
|
assets.add_khafile_def('rp_ssr')
|
|
|
|
assets.add_shader_pass('ssr_pass')
|
|
|
|
assets.add_shader_pass('blur_adaptive_pass')
|
|
|
|
if rpdat.arm_ssr_half_res:
|
|
|
|
assets.add_khafile_def('rp_ssr_half')
|
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_overlays:
|
|
|
|
assets.add_khafile_def('rp_overlays')
|
2017-05-23 15:01:56 +02:00
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_translucency:
|
|
|
|
assets.add_khafile_def('rp_translucency')
|
2017-12-13 14:21:42 +01:00
|
|
|
assets.add_shader_pass('translucent_resolve')
|
2016-09-23 00:34:42 +02:00
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_stereo:
|
|
|
|
assets.add_khafile_def('rp_stereo')
|
2016-10-12 18:26:56 +02:00
|
|
|
assets.add_khafile_def('arm_vr')
|
2017-08-21 15:36:21 +02:00
|
|
|
wrd.world_defs += '_VR'
|
2016-09-23 00:34:42 +02:00
|
|
|
|
2018-01-28 17:28:13 +01:00
|
|
|
has_voxels = arm.utils.voxel_support()
|
2019-04-06 18:52:21 +02:00
|
|
|
if rpdat.rp_voxelao and has_voxels and rpdat.arm_material_model == 'Full':
|
|
|
|
assets.add_khafile_def('rp_voxelao')
|
|
|
|
assets.add_khafile_def('rp_voxelgi_resolution={0}'.format(rpdat.rp_voxelgi_resolution))
|
|
|
|
assets.add_khafile_def('rp_voxelgi_resolution_z={0}'.format(rpdat.rp_voxelgi_resolution_z))
|
2017-11-22 21:17:36 +01:00
|
|
|
|
2018-04-20 00:56:54 +02:00
|
|
|
if rpdat.arm_rp_resolution == 'Custom':
|
|
|
|
assets.add_khafile_def('rp_resolution_filter={0}'.format(rpdat.arm_rp_resolution_filter))
|
2017-11-22 21:17:36 +01:00
|
|
|
|
|
|
|
if rpdat.rp_renderer == 'Deferred':
|
2018-12-10 09:46:46 +01:00
|
|
|
if rpdat.arm_material_model == 'Full':
|
|
|
|
assets.add_shader_pass('deferred_light')
|
|
|
|
else: # mobile, solid
|
|
|
|
assets.add_shader_pass('deferred_light_' + rpdat.arm_material_model.lower())
|
|
|
|
assets.add_khafile_def('rp_material_' + rpdat.arm_material_model.lower())
|
2018-10-01 22:01:03 +02:00
|
|
|
|
2019-04-06 18:52:21 +02:00
|
|
|
if len(bpy.data.lightprobes) > 0:
|
2018-10-04 15:35:33 +02:00
|
|
|
wrd.world_defs += '_Probes'
|
2018-10-01 22:01:03 +02:00
|
|
|
assets.add_khafile_def('rp_probes')
|
|
|
|
assets.add_shader_pass('probe_planar')
|
2018-10-04 15:35:33 +02:00
|
|
|
assets.add_shader_pass('probe_cubemap')
|
|
|
|
assets.add_shader_pass('copy_pass')
|
2018-10-01 22:01:03 +02:00
|
|
|
|
2019-01-28 11:28:21 +01:00
|
|
|
if rpdat.rp_volumetriclight:
|
|
|
|
assets.add_khafile_def('rp_volumetriclight')
|
|
|
|
assets.add_shader_pass('volumetric_light')
|
|
|
|
assets.add_shader_pass('blur_bilat_pass')
|
|
|
|
assets.add_shader_pass('blur_bilat_blend_pass')
|
|
|
|
assets.add(assets_path + 'blue_noise64.png')
|
|
|
|
assets.add_embedded_data('blue_noise64.png')
|
2016-10-09 16:06:18 +02:00
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_decals:
|
|
|
|
assets.add_khafile_def('rp_decals')
|
2016-10-09 16:06:18 +02:00
|
|
|
|
2019-04-29 16:21:44 +02:00
|
|
|
if rpdat.rp_water:
|
|
|
|
assets.add_khafile_def('rp_water')
|
2017-12-17 13:36:56 +01:00
|
|
|
assets.add_shader_pass('water_pass')
|
2019-04-29 16:21:44 +02:00
|
|
|
assets.add_shader_pass('copy_pass')
|
|
|
|
assets.add(assets_path + 'water_base.png')
|
|
|
|
assets.add_embedded_data('water_base.png')
|
|
|
|
assets.add(assets_path + 'water_detail.png')
|
|
|
|
assets.add_embedded_data('water_detail.png')
|
|
|
|
assets.add(assets_path + 'water_foam.png')
|
|
|
|
assets.add_embedded_data('water_foam.png')
|
2016-10-09 16:06:18 +02:00
|
|
|
|
2018-08-16 14:46:18 +02:00
|
|
|
if rpdat.rp_blending:
|
2017-11-22 21:17:36 +01:00
|
|
|
assets.add_khafile_def('rp_blending')
|
2016-09-23 00:34:42 +02:00
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_sss:
|
|
|
|
assets.add_khafile_def('rp_sss')
|
|
|
|
wrd.world_defs += '_SSS'
|
2017-12-13 14:21:42 +01:00
|
|
|
assets.add_shader_pass('sss_pass')
|
2017-11-22 21:17:36 +01:00
|
|
|
|
2018-12-10 17:25:29 +01:00
|
|
|
if (rpdat.rp_ssr and rpdat.arm_ssr_half_res) or (rpdat.rp_ssgi != 'Off' and rpdat.arm_ssgi_half_res):
|
2018-12-06 15:23:08 +01:00
|
|
|
assets.add_shader_pass('downsample_depth')
|
2017-11-22 21:17:36 +01:00
|
|
|
|
|
|
|
if rpdat.rp_motionblur != 'Off':
|
|
|
|
assets.add_khafile_def('rp_motionblur={0}'.format(rpdat.rp_motionblur))
|
2017-12-13 14:21:42 +01:00
|
|
|
assets.add_shader_pass('copy_pass')
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_motionblur == 'Camera':
|
2017-12-13 14:21:42 +01:00
|
|
|
assets.add_shader_pass('motion_blur_pass')
|
2017-11-22 21:17:36 +01:00
|
|
|
else:
|
2017-12-13 14:21:42 +01:00
|
|
|
assets.add_shader_pass('motion_blur_veloc_pass')
|
2016-11-07 16:11:35 +01:00
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_compositornodes and rpdat.rp_autoexposure:
|
|
|
|
assets.add_khafile_def('rp_autoexposure')
|
2019-04-22 14:11:17 +02:00
|
|
|
assets.add_shader_pass('histogram_pass')
|
2016-10-09 16:06:18 +02:00
|
|
|
|
2017-11-22 21:17:36 +01:00
|
|
|
if rpdat.rp_dynres:
|
|
|
|
assets.add_khafile_def('rp_dynres')
|
2017-12-03 11:19:13 +01:00
|
|
|
|
2019-01-24 12:47:51 +01:00
|
|
|
gbuffer2 = '_Veloc' in wrd.world_defs
|
2018-05-19 19:29:14 +02:00
|
|
|
if gbuffer2:
|
|
|
|
assets.add_khafile_def('rp_gbuffer2')
|
|
|
|
wrd.world_defs += '_gbuffer2'
|
|
|
|
|
2018-03-07 23:37:47 +01:00
|
|
|
if callback != None:
|
|
|
|
callback()
|