-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pad out vertex array to four-element vectors, and pass timer instead …
…of fade_factor as uniform
- Loading branch information
Showing
3 changed files
with
22 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
#version 110 | ||
|
||
attribute vec2 position; | ||
uniform float timer; | ||
|
||
attribute vec4 position; | ||
|
||
varying vec2 texcoord; | ||
varying float fade_factor; | ||
|
||
void main() | ||
{ | ||
gl_Position = vec4(position, 0.0, 1.0); | ||
texcoord = position * vec2(0.5) + vec2(0.5); | ||
gl_Position = position; | ||
texcoord = position.xy * vec2(0.5) + vec2(0.5); | ||
fade_factor = sin(timer * 0.5 + 0.5); | ||
} |