diff options
| author | yum <yum.food.vr@gmail.com> | 2025-01-21 19:58:34 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-01-21 19:58:34 -0800 |
| commit | 4ec13bd7513f29e16ab22b7ffe7d06724c92a912 (patch) | |
| tree | e82920d170455fbfade69f7487ae5f6f4d0c1dd0 /pbr.cginc | |
| parent | e2911359e5acf79beb5c8359145669b96a931ab0 (diff) | |
Clearcoat can disable texture normals
Also:
* terrain gimmick
* makes some hardcoded shit into params
* add alternative normal evaluation methods
* stochastic method gives best results without getting into analytic
normals
* add FBM noise texture slot to improve perf
* add initial raytrace to sphere
* stabilizes appearance as camera moves
* add backtracking
* eliminates sharp lines without sacrificing perf
* fog 00 can render on a plane now, in addition to cylinder
* add epilepsy protection filter
Diffstat (limited to 'pbr.cginc')
| -rw-r--r-- | pbr.cginc | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -423,6 +423,7 @@ float4 getLitColor( } cc_mask *= cc_mask2_tmp; #endif + float3 cc_normal = _Clearcoat_Use_Texture_Normals ? normal : i.normal; // Diffuse specular const float cc_roughness = max(1E-4, _Clearcoat_Roughness); { @@ -431,12 +432,12 @@ float4 getLitColor( // https://google.github.io/filament/Filament.html metallic = 0; smoothness = 1.0 - _Clearcoat_Roughness; - indirect_light.specular = getIndirectSpecular(i, view_dir, normal, smoothness, + indirect_light.specular = getIndirectSpecular(i, view_dir, cc_normal, smoothness, metallic, worldPos, uv); - const float3 l = reflect(-view_dir, normal); + const float3 l = reflect(-view_dir, cc_normal); const float3 h = normalize(l + view_dir); - const float NoH = dot(normal, h); + const float NoH = dot(cc_normal, h); const float LoH = dot(l, h); float Fc; @@ -453,7 +454,7 @@ float4 getLitColor( { const float3 l = direct_light.dir; const float3 h = normalize(l + view_dir); - const float NoH = dot(normal, h); + const float NoH = dot(cc_normal, h); const float LoH = dot(direct_light.dir, h); float Fc; |
