merge upstream

This commit is contained in:
2025-06-07 21:35:02 +00:00
6 changed files with 23 additions and 12 deletions

View File

@ -144,7 +144,7 @@ float ConvertEV100ToExposure(float EV100) {
return 1/0.8 * exp2(-EV100); return 1/0.8 * exp2(-EV100);
} }
float ComputeEV(float avgLuminance) { float ComputeEV(float avgLuminance) {
const float sqAperture = PPComp1[0].x * PPComp1.x; const float sqAperture = PPComp1.x * PPComp1.x;
const float shutterTime = 1.0 / PPComp1.y; const float shutterTime = 1.0 / PPComp1.y;
const float ISO = PPComp1.z; const float ISO = PPComp1.z;
const float EC = PPComp2.x; const float EC = PPComp2.x;

View File

@ -49,7 +49,7 @@ class Postprocess {
0.01, //4: Fisheye Distortion 0.01, //4: Fisheye Distortion
1, //5: DoF AutoFocus §§ If true, it ignores the DoF Distance setting 1, //5: DoF AutoFocus §§ If true, it ignores the DoF Distance setting
10.0, //6: DoF Distance 10.0, //6: DoF Distance
160.0, //7: DoF Focal Length mm 50.0, //7: DoF Focal Length mm
128, //8: DoF F-Stop 128, //8: DoF F-Stop
0, //9: Tonemapping Method 0, //9: Tonemapping Method
2.0, //10: Distort 2.0, //10: Distort

View File

@ -540,7 +540,7 @@ class LeenkxExporter:
o['material_refs'].append(lnx.utils.asset_name(material)) o['material_refs'].append(lnx.utils.asset_name(material))
def export_particle_system_ref(self, psys: bpy.types.ParticleSystem, out_object): def export_particle_system_ref(self, psys: bpy.types.ParticleSystem, out_object):
if psys.settings.instance_object is None or psys.settings.render_type != 'OBJECT' or not psys.settings.instance_object.lnx_export: if psys.settings.instance_object is None or psys.settings.render_type != 'OBJECT' or not psys.settings.instance_object.lnx_export or not bpy.data.objects[out_object['name']].modifiers[psys.name].show_render:
return return
self.particle_system_array[psys.settings] = {"structName": psys.settings.name} self.particle_system_array[psys.settings] = {"structName": psys.settings.name}
@ -910,7 +910,8 @@ class LeenkxExporter:
out_object['particle_refs'] = [] out_object['particle_refs'] = []
out_object['render_emitter'] = bobject.show_instancer_for_render out_object['render_emitter'] = bobject.show_instancer_for_render
for i in range(num_psys): for i in range(num_psys):
self.export_particle_system_ref(bobject.particle_systems[i], out_object) if bobject.modifiers[bobject.particle_systems[i].name].show_render:
self.export_particle_system_ref(bobject.particle_systems[i], out_object)
aabb = bobject.data.lnx_aabb aabb = bobject.data.lnx_aabb
if aabb[0] == 0 and aabb[1] == 0 and aabb[2] == 0: if aabb[0] == 0 and aabb[1] == 0 and aabb[2] == 0:
@ -2280,6 +2281,15 @@ class LeenkxExporter:
if len(self.particle_system_array) > 0: if len(self.particle_system_array) > 0:
self.output['particle_datas'] = [] self.output['particle_datas'] = []
for particleRef in self.particle_system_array.items(): for particleRef in self.particle_system_array.items():
padd = False;
for obj in self.output['objects']:
if 'particle_refs' in obj:
for pref in obj['particle_refs']:
if pref['particle'] == particleRef[1]["structName"]:
if bpy.data.objects[obj['name']].modifiers[pref['name']].show_render == True:
padd = True;
if not padd:
continue;
psettings = particleRef[0] psettings = particleRef[0]
if psettings is None: if psettings is None:

View File

@ -241,8 +241,8 @@ def build():
compo_depth = True compo_depth = True
focus_distance = 0.0 focus_distance = 0.0
if len(bpy.data.cameras) > 0 and bpy.data.cameras[0].dof.use_dof: if len(bpy.data.cameras) > 0 and lnx.utils.get_active_scene().camera.data.dof.use_dof:
focus_distance = bpy.data.cameras[0].dof.focus_distance focus_distance = lnx.utils.get_active_scene().camera.data.dof.focus_distance
if focus_distance > 0.0: if focus_distance > 0.0:
wrd.compo_defs += '_CDOF' wrd.compo_defs += '_CDOF'

View File

@ -447,7 +447,7 @@ class LnxRPListItem(bpy.types.PropertyGroup):
name='Depth Texture', description='Whether materials can read from a depth texture', default='Auto', update=update_depth_texture_state) name='Depth Texture', description='Whether materials can read from a depth texture', default='Auto', update=update_depth_texture_state)
rp_stereo: BoolProperty(name="VR", description="Stereo rendering", default=False, update=update_renderpath) rp_stereo: BoolProperty(name="VR", description="Stereo rendering", default=False, update=update_renderpath)
rp_water: BoolProperty(name="Water", description="Enable water surface pass", default=False, update=update_renderpath) rp_water: BoolProperty(name="Water", description="Enable water surface pass", default=False, update=update_renderpath)
rp_pp: BoolProperty(name="Realtime postprocess", description="Realtime postprocess", default=False, update=update_renderpath) rp_pp: BoolProperty(name="Realtime post process", description="Realtime post process", default=False, update=update_renderpath)
lnx_clouds: BoolProperty(name="Clouds", description="Enable clouds pass", default=False, update=assets.invalidate_shader_cache) lnx_clouds: BoolProperty(name="Clouds", description="Enable clouds pass", default=False, update=assets.invalidate_shader_cache)
lnx_ssrs: BoolProperty(name="SSRS", description="Screen-space ray-traced shadows", default=False, update=assets.invalidate_shader_cache) lnx_ssrs: BoolProperty(name="SSRS", description="Screen-space ray-traced shadows", default=False, update=assets.invalidate_shader_cache)
lnx_micro_shadowing: BoolProperty(name="Micro Shadowing", description="Use the shaders' occlusion parameter to compute micro shadowing for the scene's sun lamp. This option is not available for render paths using mobile or solid material models", default=False, update=assets.invalidate_shader_cache) lnx_micro_shadowing: BoolProperty(name="Micro Shadowing", description="Use the shaders' occlusion parameter to compute micro shadowing for the scene's sun lamp. This option is not available for render paths using mobile or solid material models", default=False, update=assets.invalidate_shader_cache)

View File

@ -806,16 +806,17 @@ const int compoChromaticSamples = {rpdat.lnx_chromatic_aberration_samples};
focus_distance = 0.0 focus_distance = 0.0
fstop = 0.0 fstop = 0.0
if len(bpy.data.cameras) > 0 and bpy.data.cameras[0].dof.use_dof: if len(bpy.data.cameras) > 0 and lnx.utils.get_active_scene().camera.data.dof.use_dof:
focus_distance = bpy.data.cameras[0].dof.focus_distance focus_distance = lnx.utils.get_active_scene().camera.data.dof.focus_distance
fstop = bpy.data.cameras[0].dof.aperture_fstop fstop = lnx.utils.get_active_scene().camera.data.dof.aperture_fstop
lens = lnx.utils.get_active_scene().camera.data.lens
if focus_distance > 0.0: if focus_distance > 0.0:
f.write( f.write(
"""const float compoDOFDistance = """ + str(round(focus_distance * 100) / 100) + """; """const float compoDOFDistance = """ + str(round(focus_distance * 100) / 100) + """;
const float compoDOFFstop = """ + str(round(fstop * 100) / 100) + """; const float compoDOFFstop = """ + str(round(fstop * 100) / 100) + """;
const float compoDOFLength = 160.0; const float compoDOFLength = """ + str(round(lens * 100) / 100) +""";
""") # str(round(bpy.data.cameras[0].lens * 100) / 100) """) #160.0;
if rpdat.rp_voxels != 'Off': if rpdat.rp_voxels != 'Off':
f.write("""const ivec3 voxelgiResolution = ivec3(""" + str(rpdat.rp_voxelgi_resolution) + """, """ + str(rpdat.rp_voxelgi_resolution) + """, """ + str(rpdat.rp_voxelgi_resolution) + """); f.write("""const ivec3 voxelgiResolution = ivec3(""" + str(rpdat.rp_voxelgi_resolution) + """, """ + str(rpdat.rp_voxelgi_resolution) + """, """ + str(rpdat.rp_voxelgi_resolution) + """);