1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-27 09:58:50 +00:00
Files
samples/simple_shader/shaders/simple.frag
Andy Wolff 56bf76f2f0 Add copyright to source files in simple_shader and simple_sdf (#2837)
@gaaclarke noticed the copyright was missing from the top of these
files, so this PR adds them.

## Pre-launch Checklist

- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I read the [Contributors Guide].
- [ ] I have added sample code updates to the [changelog].
- [x] I updated/added relevant documentation (doc comments with `///`).


If you need help, consider asking for advice on the #hackers-devrel
channel on [Discord].

<!-- Links -->
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
[Contributors Guide]:
https://github.com/flutter/samples/blob/main/CONTRIBUTING.md
[changelog]: ../CHANGELOG.md
2026-04-23 11:10:53 -07:00

30 lines
732 B
GLSL

// Copyright 2024 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#version 460 core
#include <flutter/runtime_effect.glsl>
precision mediump float;
uniform vec2 resolution;
out vec4 fragColor;
vec3 flutterBlue = vec3(5, 83, 177) / 255;
vec3 flutterNavy = vec3(4, 43, 89) / 255;
vec3 flutterSky = vec3(2, 125, 253) / 255;
void main() {
vec2 st = FlutterFragCoord().xy / resolution.xy;
vec3 color = vec3(0.0);
vec3 percent = vec3((st.x + st.y) / 2);
color =
mix(mix(flutterSky, flutterBlue, percent * 2),
mix(flutterBlue, flutterNavy, percent * 2 - 1), step(0.5, percent));
fragColor = vec4(color, 1);
}