Skip to content

Commit

Permalink
Merge pull request #2348 from jMonkeyEngine/yaRnMcDonuts-patch-3
Browse files Browse the repository at this point in the history
Add tbnMat variable to PBRSurface.glsl
  • Loading branch information
yaRnMcDonuts authored Jan 23, 2025
2 parents 0d963b6 + 9f6a168 commit 7aad158
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
vec3 normal; // normals w/ normalmap
bool frontFacing; //gl_FrontFacing
float depth;
mat3 tbnMat;

// from texture
vec3 albedo;
Expand All @@ -36,4 +37,4 @@
#endstruct
#define PBRSurface StdPBRSurface
#endif
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
#if defined(NORMALMAP) || defined(PARALLAXMAP)
vec3 tan = normalize(wTangent.xyz);
mat3 tbnMat = mat3(tan, wTangent.w * cross( surface.geometryNormal, tan), surface.geometryNormal);
surface.tbnMat = tbnMat;
#endif

vec2 newTexCoord;
Expand Down Expand Up @@ -338,7 +339,7 @@
#endif
surface.normal = normalize(tbnMat * normal);
#else
surface.normal = normal;
surface.normal = surface.geometryNormal;
#endif

//spec gloss tex reads:
Expand Down Expand Up @@ -589,4 +590,4 @@
#endif


#endif
#endif

0 comments on commit 7aad158

Please sign in to comment.