diff options
| author | Ray <[email protected]> | 2022-08-02 10:31:31 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-08-02 10:31:31 +0200 |
| commit | 5fc1538c24f61bd5973ce6f3514ecaadef8f1cd9 (patch) | |
| tree | bd81bb12ac15d4d9697baaa6d448cdd15c4a85cf /examples/shaders/shaders_hot_reloading.data | |
| parent | 192e2026607b27e0226a1e2c4336799b77a2b4e8 (diff) | |
| download | raylib.com-5fc1538c24f61bd5973ce6f3514ecaadef8f1cd9.tar.gz raylib.com-5fc1538c24f61bd5973ce6f3514ecaadef8f1cd9.zip | |
Update examples to raylib 4.2
Diffstat (limited to 'examples/shaders/shaders_hot_reloading.data')
| -rw-r--r-- | examples/shaders/shaders_hot_reloading.data | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/shaders/shaders_hot_reloading.data b/examples/shaders/shaders_hot_reloading.data index eda00ae..d8e4416 100644 --- a/examples/shaders/shaders_hot_reloading.data +++ b/examples/shaders/shaders_hot_reloading.data @@ -14,26 +14,26 @@ uniform float time; // Total run time (in secods) // Draw circle vec4 DrawCircle(vec2 fragCoord, vec2 position, float radius, vec3 color) { - float d = length(position - fragCoord) - radius; - float t = clamp(d, 0.0, 1.0); - return vec4(color, 1.0 - t); + float d = length(position - fragCoord) - radius; + float t = clamp(d, 0.0, 1.0); + return vec4(color, 1.0 - t); } void main() { - vec2 fragCoord = gl_FragCoord.xy; - vec2 position = vec2(mouse.x, resolution.y - mouse.y); - float radius = 40.0; + vec2 fragCoord = gl_FragCoord.xy; + vec2 position = vec2(mouse.x, resolution.y - mouse.y); + float radius = 40.0; // Draw background layer vec4 colorA = vec4(0.2,0.2,0.8, 1.0); vec4 colorB = vec4(1.0,0.7,0.2, 1.0); - vec4 layer1 = mix(colorA, colorB, abs(sin(time*0.1))); - - // Draw circle layer - vec3 color = vec3(0.9, 0.16, 0.21); - vec4 layer2 = DrawCircle(fragCoord, position, radius, color); - - // Blend the two layers - gl_FragColor = mix(layer1, layer2, layer2.a); + vec4 layer1 = mix(colorA, colorB, abs(sin(time*0.1))); + + // Draw circle layer + vec3 color = vec3(0.9, 0.16, 0.21); + vec4 layer2 = DrawCircle(fragCoord, position, radius, color); + + // Blend the two layers + gl_FragColor = mix(layer1, layer2, layer2.a); } |
