Reflections / Refractions

This commit is contained in:
2026-09-06 01:37:13 -07:00
parent 1e500993d9
commit bc700a6374
4 changed files with 81 additions and 69 deletions

View File

@ -247,9 +247,12 @@ def make(context_id, rpasses, shadowmap=False, shadowmap_transparent=False):
if parse_opacity and not shadowmap_transparent:
if mat_state.material.lnx_discard:
opac = mat_state.material.lnx_discard_opacity_shadows
frag.write('if (opacity < {0}) discard;'.format(opac))
elif rpdat.rp_renderer == 'Deferred' and 'translucent' in rpasses and not shadowmap:
pass
else:
opac = '1.0'
frag.write('if (opacity < {0}) discard;'.format(opac))
frag.write('if (opacity < {0}) discard;'.format(opac))
make_finalize.make(con_depth)

View File

@ -20,7 +20,7 @@ else:
def make(context_id):
con_refract = mat_state.data.add_context({
'name': context_id,
'depth_write': False,
'depth_write': True,
'compare_mode': 'less',
'cull_mode': 'clockwise',
'blend_source': 'blend_one',

View File

@ -55,6 +55,8 @@ def get_rpasses(material):
ar.append('voxel')
if rpdat.rp_renderer == 'Forward' and rpdat.rp_depthprepass and not material.lnx_blending and not material.lnx_particle_flag:
ar.append('depth')
if rpdat.rp_renderer == 'Deferred' and rpdat.rp_ssr and 'translucent' in ar:
ar.append('depth')
if material.lnx_cast_shadow and rpdat.rp_shadows and ('mesh' in ar):
if 'translucent' in ar or 'refraction' in ar: