summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--LUTS/dfg_standard.exrbin132134 -> 520151 bytes
-rwxr-xr-xLUTS/dfg_standard.exr.meta6
-rwxr-xr-xScripts/make_dfg_lut.py8
-rwxr-xr-xbrdf.cginc8
4 files changed, 12 insertions, 10 deletions
diff --git a/LUTS/dfg_standard.exr b/LUTS/dfg_standard.exr
index 7a3e0cd..9542464 100644
--- a/LUTS/dfg_standard.exr
+++ b/LUTS/dfg_standard.exr
Binary files differ
diff --git a/LUTS/dfg_standard.exr.meta b/LUTS/dfg_standard.exr.meta
index 68554f4..107cdd2 100755
--- a/LUTS/dfg_standard.exr.meta
+++ b/LUTS/dfg_standard.exr.meta
@@ -37,9 +37,9 @@ TextureImporter:
filterMode: 1
aniso: 1
mipBias: 0
- wrapU: 0
- wrapV: 0
- wrapW: 0
+ wrapU: 1
+ wrapV: 1
+ wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
diff --git a/Scripts/make_dfg_lut.py b/Scripts/make_dfg_lut.py
index 298452f..05794ff 100755
--- a/Scripts/make_dfg_lut.py
+++ b/Scripts/make_dfg_lut.py
@@ -244,10 +244,10 @@ def main():
parser = argparse.ArgumentParser(description='Generate DFG LUT EXR images for PBR.')
parser.add_argument('-t', '--type', choices=['standard', 'cloth'], default='standard',
help='Type of DFG texture to generate (default: standard)')
- parser.add_argument('-r', '--resolution', type=int, default=128,
- help='Resolution of the square EXR image (default: 128)')
- parser.add_argument('-s', '--samples', type=int, default=1024,
- help='Number of samples per pixel for integration (default: 1024)')
+ parser.add_argument('-r', '--resolution', type=int, default=512,
+ help='Resolution of the square EXR image (default: 512)')
+ parser.add_argument('-s', '--samples', type=int, default=8192,
+ help='Number of samples per pixel for integration (default: 8192)')
parser.add_argument('-o', '--output',
help='Output filename (default: dfg_standard.exr or dfg_cloth.exr)')
parser.add_argument('-j', '--workers', type=int, default=os.cpu_count(),
diff --git a/brdf.cginc b/brdf.cginc
index bd44b3f..8a3b2ff 100755
--- a/brdf.cginc
+++ b/brdf.cginc
@@ -166,11 +166,13 @@ float4 brdf(Pbr pbr, LightData data) {
remainder = saturate(remainder - indirect_specular_cc);
#endif
- // Standard split-sum IBL
- float3 f0_spec = lerp(f0, pbr.albedo.xyz, pbr.metallic);
- float3 ibl_specular_reflectance = lerp(dfg.xxx, dfg.yyy, f0_spec);
+ float3 base_color = lerp(1, pbr.albedo.xyz, pbr.metallic);
+ float3 specular_dfg = lerp(dfg.xxx, dfg.yyy, f0);
+ float3 ibl_specular_reflectance = specular_dfg * base_color;
float3 indirect_specular = data.indirect.specular * ibl_specular_reflectance;
+ return float4(specular_dfg, 1);
+
specular += indirect_specular;
remainder = saturate(remainder - indirect_specular);