mirror of
https://github.com/lxsang/Diya-API.git
synced 2024-12-27 03:48:21 +01:00
24 lines
451 B
Smalltalk
24 lines
451 B
Smalltalk
Class {
|
|
#name : #DiyaExampleShader,
|
|
#superclass : #Diya2DShader,
|
|
#category : #'Diya-Shaders'
|
|
}
|
|
|
|
{ #category : #accessing }
|
|
DiyaExampleShader class >> fragmentShader [
|
|
^ '
|
|
#ifdef GL_ES
|
|
precision mediump float;
|
|
#endif
|
|
uniform vec2 u_resolution;
|
|
uniform vec2 u_mouse;
|
|
uniform float u_time;
|
|
void main()
|
|
{
|
|
vec2 mouse = u_mouse / u_resolution;
|
|
vec2 px = (gl_FragCoord.xy/u_resolution);
|
|
gl_FragColor = vec4(abs(sin(u_time)), px/mouse, 1.0);
|
|
}
|
|
'
|
|
]
|