This repository has been archived by the owner on Sep 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wireframe rendering is now way faster.
- Loading branch information
Showing
4 changed files
with
47 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,17 +1,21 @@ | |||
attribute vec3 vertex; | attribute vec3 vertex; | ||
attribute vec3 normal; | attribute vec4 normal; | ||
attribute vec3 barycenter; | |||
uniform mat4 mvMat, mvpMat; | uniform mat4 mvMat, mvpMat; | ||
uniform mat3 nMat; | uniform mat3 nMat; | ||
varying vec3 vVertex; | varying vec3 vVertex; | ||
varying vec3 vNormal; | varying vec3 vNormal; | ||
varying vec3 vBarycenter; | varying vec3 vBarycenter; | ||
varying vec2 vTexCoord; | |||
void main() | void main() | ||
{ | { | ||
vBarycenter = barycenter; | |||
vec4 vertex4 = vec4(vertex, 1.0); | vec4 vertex4 = vec4(vertex, 1.0); | ||
vNormal = nMat * normal; | float bVal = normal[3]; | ||
if(bVal > 1.5) | |||
vBarycenter = vec3(0,0,1); | |||
else if(bVal < 0.5) | |||
vBarycenter = vec3(0,1,0); | |||
else | |||
vBarycenter = vec3(1,0,0); | |||
vNormal = nMat * vec3(normal); | |||
vVertex = vec3(mvMat * vertex4); | vVertex = vec3(mvMat * vertex4); | ||
gl_Position = mvpMat * vertex4; | gl_Position = mvpMat * vertex4; | ||
} | } |