forked from LeenkxTeam/LNXSDK
Patch_2
This commit is contained in:
@ -18,7 +18,15 @@ else:
|
||||
|
||||
|
||||
def make(context_id):
|
||||
con_refract = mat_state.data.add_context({ 'name': context_id, 'depth_write': True, 'compare_mode': 'less', 'cull_mode': 'clockwise' })
|
||||
con_refract = mat_state.data.add_context({
|
||||
'name': context_id,
|
||||
'depth_write': False,
|
||||
'compare_mode': 'less',
|
||||
'cull_mode': 'clockwise',
|
||||
'blend_source': 'blend_one',
|
||||
'blend_destination': 'inverse_source_alpha',
|
||||
'blend_operation': 'add'
|
||||
})
|
||||
make_mesh.make_forward_base(con_refract, parse_opacity=True, transluc_pass=True)
|
||||
|
||||
vert = con_refract.vert
|
||||
@ -51,14 +59,16 @@ def make(context_id):
|
||||
frag.write('const uint matid = 0;')
|
||||
|
||||
if rpdat.rp_renderer == 'Deferred':
|
||||
frag.write('fragColor[0] = vec4(n.xy, roughness, packFloatInt16(metallic, matid));')
|
||||
frag.write('fragColor[1] = vec4(direct + indirect, packFloat2(occlusion, specular));')
|
||||
frag.write('fragColor[0] = vec4(n.xy, roughness, 1.0);')
|
||||
frag.write('vec3 finalColor = direct + indirect;')
|
||||
frag.write('fragColor[1] = vec4(finalColor * opacity, opacity);')
|
||||
else:
|
||||
frag.write('fragColor[0] = vec4(direct + indirect, packFloat2(occlusion, specular));')
|
||||
frag.write('fragColor[1] = vec4(n.xy, roughness, metallic);')
|
||||
frag.write('vec3 finalColor = direct + indirect;')
|
||||
frag.write('fragColor[0] = vec4(finalColor * opacity, opacity);')
|
||||
frag.write('fragColor[1] = vec4(n.xy, roughness, 1.0);')
|
||||
|
||||
frag.write('fragColor[2] = vec4(ior, opacity, 0.0, 1.0);')
|
||||
# frag.write('fragColor[2] = vec4(ior, opacity, packFloat2(basecol.r, basecol.g), basecol.b);')
|
||||
frag.write('fragColor[2] = vec4(ior, 1.0 - opacity, gl_FragCoord.z, 1.0);')
|
||||
# frag.write('fragColor[2] = vec4(ior, 1.0 - opacity, packFloat2(basecol.r, basecol.g), basecol.b);')
|
||||
|
||||
make_finalize.make(con_refract)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user