planar reflection shader fix
This commit is contained in:
@@ -350,7 +350,7 @@ inline float3 PlanarReflection(in Surface surface, in float2 bumpColor)
|
||||
float4 reflectionUV = mul(GetCamera().reflection_view_projection, float4(surface.P, 1));
|
||||
reflectionUV.xy /= reflectionUV.w;
|
||||
reflectionUV.xy = clipspace_to_uv(reflectionUV.xy);
|
||||
return bindless_textures[GetCamera().texture_reflection_index].SampleLevel(sampler_linear_clamp, reflectionUV.xy + bumpColor * GetMaterial().normalMapStrength, 0).rgb;
|
||||
return bindless_textures[GetCamera().texture_reflection_index].SampleLevel(sampler_linear_clamp, reflectionUV.xy + bumpColor, 0).rgb;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ struct Surface
|
||||
RayCone raycone;
|
||||
float hit_depth;
|
||||
float3 gi;
|
||||
float3 bumpColor;
|
||||
|
||||
// These will be computed when calling Update():
|
||||
float roughnessBRDF; // roughness input for BRDF functions
|
||||
@@ -110,6 +111,7 @@ struct Surface
|
||||
facenormal = 0;
|
||||
flags = 0;
|
||||
gi = 0;
|
||||
bumpColor = 0;
|
||||
|
||||
sheen.color = 0;
|
||||
sheen.roughness = 0;
|
||||
@@ -372,6 +374,7 @@ struct Surface
|
||||
const float3 normalMap = float3(tex.SampleLevel(sam, uv, lod).rg, 1) * 2 - 1;
|
||||
#endif // SURFACE_LOAD_QUAD_DERIVATIVES
|
||||
N = normalize(lerp(N, mul(normalMap, TBN), material.normalMapStrength));
|
||||
bumpColor = normalMap * material.normalMapStrength;
|
||||
}
|
||||
|
||||
#ifdef ANISOTROPIC
|
||||
|
||||
@@ -59,7 +59,7 @@ void main(uint DTid : SV_DispatchThreadID, uint groupIndex : SV_GroupIndex, uint
|
||||
|
||||
|
||||
#ifdef PLANARREFLECTION
|
||||
lighting.indirect.specular += PlanarReflection(surface, surface.N.xz) * surface.F;
|
||||
lighting.indirect.specular += PlanarReflection(surface, surface.bumpColor.rg) * surface.F;
|
||||
#endif
|
||||
|
||||
TiledLighting(surface, lighting);
|
||||
|
||||
Reference in New Issue
Block a user