Skip to content

Commit 24f6bb2

Browse files
authored
Update PBRTerrainUtils.glsllib
1 parent 8f1a0c8 commit 24f6bb2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jme3-terrain/src/main/resources/Common/MatDefs/Terrain/Modular/PBRTerrainUtils.glsllib

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
return terrainTextureLayer;
119119
}
120120

121-
//3 functinos to update layers from respective packed data vecs:
121+
//3 functions to update layers from respective packed data vecs:
122122
void updateLayerFromPackedAlbedoMap(inout vec4 packedAlbedoVec, inout PBRTerrainTextureLayer layer){
123123
layer.albedo = packedAlbedoVec;
124124
layer.alpha = packedAlbedoVec.a;
@@ -144,7 +144,7 @@
144144
// normal:
145145
void PBRTerrainUtils_readNormalTexture(in sampler2D tex, in float scale, inout PBRTerrainTextureLayer layer){
146146
vec4 packedNormalParallaxVec = texture2D(tex, texCoord * scale);
147-
packedNormalParallaxVec.xyz *= normalize(vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0));
147+
packedNormalParallaxVec.xyz = normalize(packedNormalParallaxVec.xyz * vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0));
148148
updateLayerFromPackedNormalParallaxVec(packedNormalParallaxVec, layer);
149149
}
150150
// metallicRoughnessAoEi:
@@ -181,7 +181,7 @@
181181
// Normal TextureArray:
182182
void PBRTerrainUtils_readNormalTexArray(in int indexInTexArray, in float scale, in sampler2DArray texArray, inout PBRTerrainTextureLayer layer){
183183
vec4 packedNormalParallaxVec = texture2DArray(texArray, vec3(texCoord * scale, indexInTexArray));
184-
packedNormalParallaxVec.xyz *= normalize(vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0));
184+
packedNormalParallaxVec.xyz = normalize(packedNormalParallaxVec.xyz * vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0));
185185
updateLayerFromPackedNormalParallaxVec(packedNormalParallaxVec, layer);
186186
}
187187
// metallicRoughnessAoEi TextureArray:

0 commit comments

Comments
 (0)