snapshot of https://github.com/flutter/samples.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Main Branch CI / Test Flutter beta on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter stable on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter beta on macos-latest (push) Has been cancelled
Main Branch CI / Test Flutter stable on macos-latest (push) Has been cancelled
Some checks failed
Main Branch CI / Test Flutter beta on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter stable on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter beta on macos-latest (push) Has been cancelled
Main Branch CI / Test Flutter stable on macos-latest (push) Has been cancelled
This commit is contained in:
29
simple_shader/shaders/simple.frag
Normal file
29
simple_shader/shaders/simple.frag
Normal file
@@ -0,0 +1,29 @@
|
||||
// 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);
|
||||
}
|
||||
Reference in New Issue
Block a user