1
0
mirror of https://github.com/lxsang/Diya-API.git synced 2024-12-27 20:08:22 +01:00
Diya-API/Diya/DiyaExampleShader.class.st

24 lines
451 B
Smalltalk
Raw Normal View History

2022-02-13 17:15:23 +01:00
Class {
2022-03-06 18:33:10 +01:00
#name : #DiyaExampleShader,
#superclass : #Diya2DShader,
2022-02-13 17:15:23 +01:00
#category : #'Diya-Shaders'
}
{ #category : #accessing }
2022-03-06 18:33:10 +01:00
DiyaExampleShader class >> fragmentShader [
2022-02-13 17:15:23 +01:00
^ '
2022-02-15 18:04:54 +01:00
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
2022-02-13 17:15:23 +01:00
void main()
{
vec2 mouse = u_mouse / u_resolution;
vec2 px = (gl_FragCoord.xy/u_resolution);
2022-03-15 19:29:57 +01:00
gl_FragColor = vec4(abs(sin(u_time)), px/mouse, 1.0);
2022-02-13 17:15:23 +01:00
}
'
]