-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved glsl code to files referenced on ShaderIndex var
- Loading branch information
1 parent
716398b
commit a399b42
Showing
4 changed files
with
44 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import animated_points_vertex from './animated-points-vertex.glsl'; | ||
import animated_points_fragment from './animated-points-fragment.glsl'; | ||
|
||
export var ShaderIndex = { | ||
animated_points_vertex: animated_points_vertex, | ||
animated_points_fragment: animated_points_fragment, | ||
}; |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#version 120 | ||
|
||
varying vec3 vColor; | ||
|
||
void main() { | ||
gl_FragColor = vec4( vColor, 1.0 ); | ||
} |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#version 120 | ||
|
||
attribute float size_from; | ||
attribute float size_to; | ||
|
||
attribute float r_from; | ||
attribute float g_from; | ||
attribute float b_from; | ||
|
||
attribute float r_to; | ||
attribute float g_to; | ||
attribute float b_to; | ||
|
||
attribute vec3 position_to; | ||
|
||
varying vec3 vColor; | ||
uniform float animationPos; | ||
|
||
void main() { | ||
vColor = vec3( | ||
r_from * (1.0 - animationPos) + r_to * animationPos, | ||
g_from * (1.0 - animationPos) + g_to * animationPos, | ||
b_from * (1.0 - animationPos) + b_to * animationPos | ||
); | ||
gl_Position = projectionMatrix * modelViewMatrix * vec4(position * (1.0 - animationPos) + position_to * animationPos, 1.0); | ||
gl_PointSize = size_from * (1.0 - animationPos) + size_to * animationPos; | ||
} |