diff options
Diffstat (limited to 'examples/resources')
| -rw-r--r-- | examples/resources/images/LICENCE | 5 | ||||
| -rw-r--r-- | examples/resources/images/apple.png | bin | 0 -> 239 bytes | |||
| -rw-r--r-- | examples/resources/images/cat.png | bin | 0 -> 388467 bytes | |||
| -rw-r--r-- | examples/resources/images/grass.png | bin | 0 -> 1065 bytes | |||
| -rw-r--r-- | examples/resources/images/snake.png | bin | 0 -> 1933 bytes | |||
| -rw-r--r-- | examples/resources/images/tiles.png | bin | 0 -> 32917 bytes | |||
| -rw-r--r-- | examples/resources/shaders/glsl100/wave.fs | 36 | ||||
| -rw-r--r-- | examples/resources/shaders/glsl330/wave.fs | 37 |
8 files changed, 78 insertions, 0 deletions
diff --git a/examples/resources/images/LICENCE b/examples/resources/images/LICENCE new file mode 100644 index 0000000..fca0d39 --- /dev/null +++ b/examples/resources/images/LICENCE @@ -0,0 +1,5 @@ +Resource Author Licence Source +tiles.png Chris Hamons (maintainer) CC0 https://opengameart.org/content/dungeon-crawl-32x32-tiles +apple.png Jussi Viitala CC0 +grass.png Jussi Viitala CC0 +snake.png Jussi Viitala CC0
\ No newline at end of file diff --git a/examples/resources/images/apple.png b/examples/resources/images/apple.png Binary files differnew file mode 100644 index 0000000..9526aa6 --- /dev/null +++ b/examples/resources/images/apple.png diff --git a/examples/resources/images/cat.png b/examples/resources/images/cat.png Binary files differnew file mode 100644 index 0000000..db56b9e --- /dev/null +++ b/examples/resources/images/cat.png diff --git a/examples/resources/images/grass.png b/examples/resources/images/grass.png Binary files differnew file mode 100644 index 0000000..4ba7263 --- /dev/null +++ b/examples/resources/images/grass.png diff --git a/examples/resources/images/snake.png b/examples/resources/images/snake.png Binary files differnew file mode 100644 index 0000000..e1b0091 --- /dev/null +++ b/examples/resources/images/snake.png diff --git a/examples/resources/images/tiles.png b/examples/resources/images/tiles.png Binary files differnew file mode 100644 index 0000000..4e3e9cc --- /dev/null +++ b/examples/resources/images/tiles.png diff --git a/examples/resources/shaders/glsl100/wave.fs b/examples/resources/shaders/glsl100/wave.fs new file mode 100644 index 0000000..50c4e02 --- /dev/null +++ b/examples/resources/shaders/glsl100/wave.fs @@ -0,0 +1,36 @@ +#version 100 + +precision mediump float; + +// Input vertex attributes (from vertex shader) +varying vec2 fragTexCoord; +varying vec4 fragColor; + +// Input uniform values +uniform sampler2D texture0; +uniform vec4 colDiffuse; + +uniform float secondes; + +uniform vec2 size; + +uniform float freqX; +uniform float freqY; +uniform float ampX; +uniform float ampY; +uniform float speedX; +uniform float speedY; + +void main() { + float pixelWidth = 1.0 / size.x; + float pixelHeight = 1.0 / size.y; + float aspect = pixelHeight / pixelWidth; + float boxLeft = 0.0; + float boxTop = 0.0; + + vec2 p = fragTexCoord; + p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (secondes * speedX)) * ampX * pixelWidth; + p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (secondes * speedY)) * ampY * pixelHeight; + + gl_FragColor = texture2D(texture0, p)*colDiffuse*fragColor; +} diff --git a/examples/resources/shaders/glsl330/wave.fs b/examples/resources/shaders/glsl330/wave.fs new file mode 100644 index 0000000..43efee2 --- /dev/null +++ b/examples/resources/shaders/glsl330/wave.fs @@ -0,0 +1,37 @@ +#version 330 + +// Input vertex attributes (from vertex shader) +in vec2 fragTexCoord; +in vec4 fragColor; + +// Input uniform values +uniform sampler2D texture0; +uniform vec4 colDiffuse; + +// Output fragment color +out vec4 finalColor; + +uniform float secondes; + +uniform vec2 size; + +uniform float freqX; +uniform float freqY; +uniform float ampX; +uniform float ampY; +uniform float speedX; +uniform float speedY; + +void main() { + float pixelWidth = 1.0 / size.x; + float pixelHeight = 1.0 / size.y; + float aspect = pixelHeight / pixelWidth; + float boxLeft = 0.0; + float boxTop = 0.0; + + vec2 p = fragTexCoord; + p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (secondes * speedX)) * ampX * pixelWidth; + p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (secondes * speedY)) * ampY * pixelHeight; + + finalColor = texture(texture0, p)*colDiffuse*fragColor; +} |
