Full BSDF
This commit is contained in:
@ -665,7 +665,8 @@ class Main {
|
||||
if rpdat.rp_voxels == 'Voxel GI' or rpdat.rp_voxels == 'Voxel AO':
|
||||
f.write("""
|
||||
public static inline var voxelgiClipmapCount = """ + str(rpdat.lnx_voxelgi_clipmap_count) + """;
|
||||
public static inline var voxelgiVoxelSize = """ + str(round(rpdat.lnx_voxelgi_size * 100) / 100) + """;""")
|
||||
public static inline var voxelgiVoxelSize = """ + str(round(rpdat.lnx_voxelgi_size * 100) / 100) + """;
|
||||
public static inline var diffuseConeCount = """ + str(rpdat.lnx_voxelgi_cones) + """;""")
|
||||
|
||||
if rpdat.rp_bloom:
|
||||
follow_blender = rpdat.lnx_bloom_follow_blender if bpy.app.version < (4, 3, 0) else False
|
||||
@ -834,12 +835,12 @@ def write_compiledglsl(defs, make_variants):
|
||||
|
||||
if '_SSRefraction' in wrd.world_defs or '_VoxelRefract' in wrd.world_defs:
|
||||
f.write(f'#define GBUF_IDX_REFRACTION {idx_refraction}\n')
|
||||
idx_refraction += 1
|
||||
|
||||
idx_anisotropy = idx_refraction
|
||||
if '_Anisotropy' in wrd.world_defs:
|
||||
f.write(f'#define GBUF_IDX_3 {idx_anisotropy}\n')
|
||||
if '_ClearCoat' in wrd.world_defs:
|
||||
f.write(f'#define GBUF_IDX_COAT_NORMAL {idx_refraction}\n')
|
||||
|
||||
ext_brdf_defs = ('_ClearCoat', '_Sheen', '_Anisotropy', '_Subsurface', '_Transmission')
|
||||
ext_brdf_defs = ('_ClearCoat', '_Sheen', '_Anisotropy', '_SSS', '_Transmission')
|
||||
if any(d in wrd.world_defs for d in ext_brdf_defs):
|
||||
f.write('#ifndef _ExtBRDF\n')
|
||||
f.write('#define _ExtBRDF\n')
|
||||
@ -855,8 +856,12 @@ def write_compiledglsl(defs, make_variants):
|
||||
if state.target == 'html5' or lnx.utils.get_gapi() == 'direct3d11':
|
||||
f.write("#define _FlipY\n")
|
||||
|
||||
f.write("""const float PI = 3.1415926535;
|
||||
const float PI2 = PI * 2.0;
|
||||
f.write("""#ifndef PI
|
||||
#define PI 3.1415926535
|
||||
#endif
|
||||
#ifndef PI2
|
||||
#define PI2 6.2831853071
|
||||
#endif
|
||||
const vec2 shadowmapSize = vec2(""" + str(shadowmap_size) + """, """ + str(shadowmap_size) + """);
|
||||
const float shadowmapCubePcfSize = """ + str((round(rpdat.lnx_pcfsize * 100) / 100) / 1000) + """;
|
||||
const int shadowmapCascades = """ + str(rpdat.rp_shadowmap_cascades) + """;
|
||||
@ -1027,6 +1032,7 @@ const float compoDOFLength = """ + str(round(lens * 100) / 100) +""";
|
||||
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) + """);
|
||||
const int voxelgiClipmapCount = """ + str(rpdat.lnx_voxelgi_clipmap_count) + """;
|
||||
const int diffuseConeCount = """ + str(rpdat.lnx_voxelgi_cones) + """;
|
||||
const float voxelgiOcc = """ + str(round(rpdat.lnx_voxelgi_occ * 100) / 100) + """;
|
||||
const float voxelgiVoxelSize = """ + str(round(rpdat.lnx_voxelgi_size * 1000) / 1000) + """;
|
||||
const float voxelgiStep = """ + str(round(rpdat.lnx_voxelgi_step * 1000) / 1000) + """;
|
||||
@ -1042,9 +1048,6 @@ const float voxelgiDiff = """ + str(round(rpdat.lnx_voxelgi_diff * 100) / 100) +
|
||||
const float voxelgiRefl = """ + str(round(rpdat.lnx_voxelgi_spec * 100) / 100) + """;
|
||||
const float voxelgiRefr = """ + str(round(rpdat.lnx_voxelgi_refr * 100) / 100) + """;
|
||||
""")
|
||||
if rpdat.rp_sss or '_SSS' in wrd.world_defs:
|
||||
f.write(f"const float sssWidth = {rpdat.lnx_sss_width / 10.0};\n")
|
||||
|
||||
# Skinning
|
||||
if rpdat.lnx_skin == 'On':
|
||||
f.write(
|
||||
|
||||
Reference in New Issue
Block a user