Skip to content

Commit a993763

Browse files
committed
Merge pull request #388 from tangrams/normalize-normals
Normalize world normals
2 parents aa21687 + 379f00c commit a993763

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: core/resources/shaders/polygon.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ varying vec2 v_texcoord;
3535
#pragma tangram: global
3636

3737
vec3 worldNormal() {
38-
return u_inverseNormalMatrix * v_normal;
38+
return normalize(u_inverseNormalMatrix * v_normal);
3939
}
4040

4141
void main(void) {

Diff for: core/resources/shaders/polyline.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ varying vec2 v_texcoord;
3131
#endif
3232

3333
vec3 worldNormal() {
34-
return u_inverseNormalMatrix * v_normal;
34+
return normalize(u_inverseNormalMatrix * v_normal);
3535
}
3636

3737
#pragma tangram: material

0 commit comments

Comments
 (0)