Skip to content

Commit

Permalink
Boneheaded approach to fixing normal map mip seams
Browse files Browse the repository at this point in the history
  • Loading branch information
xezno committed Sep 8, 2024
1 parent 5993029 commit 56d48b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Content/core/shaders/pbr.mshdr
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ Fragment
return texture( target, vs_out.vTexCoord.xy ).rgb;
}

vec3 sampleLod( sampler2D target )
{
return textureLod( target, vs_out.vTexCoord.xy, 0 ).rgb;
}

float luminance(vec3 v)
{
return dot(v, vec3(0.2126f, 0.7152f, 0.0722f));
Expand All @@ -216,7 +221,7 @@ Fragment
float roughness = sampleTexture( roughnessTexture ).r;
float ao = sampleTexture( ambientOcclusionTexture ).r;

vec3 vNormalTS = sampleTexture( normalTexture );
vec3 vNormalTS = sampleLod( normalTexture );
vNormalTS = normalize( vNormalTS * 2.0 - 1.0 );

vec3 viewDir = normalize( vs_out.vCameraTS - vs_out.vPositionTS );
Expand Down

0 comments on commit 56d48b2

Please sign in to comment.