2022-02-13 17:15:23 +01:00
|
|
|
Class {
|
|
|
|
#name : #GLSimpleShader,
|
|
|
|
#superclass : #OpenGLSL,
|
|
|
|
#category : #'Diya-Shaders'
|
|
|
|
}
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
GLSimpleShader class >> fragmentShader [
|
|
|
|
^ '
|
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()
|
|
|
|
{
|
2022-02-15 22:01:26 +01:00
|
|
|
vec2 mouse = u_mouse / u_resolution;
|
|
|
|
vec2 px = (gl_FragCoord.xy/u_resolution);
|
|
|
|
|
|
|
|
gl_FragColor = vec4(px/mouse, abs(sin(u_time)), 1.0);
|
2022-02-13 17:15:23 +01:00
|
|
|
}
|
|
|
|
'
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
GLSimpleShader class >> vertextShader [
|
|
|
|
^ '
|
2022-03-02 20:11:01 +01:00
|
|
|
#ifdef GL_ES
|
|
|
|
precision mediump float;
|
|
|
|
#endif
|
2022-02-13 17:15:23 +01:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
|
|
|
}
|
|
|
|
'
|
|
|
|
]
|