mirror of
https://github.com/flutter/samples.git
synced 2025-11-11 15:28:44 +00:00
Next Gen UI demo (#1778)
First pass at a Next Generation UI demo app. The UI needs work, feedback gratefully accepted. ## 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]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/wiki/Chat [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md
This commit is contained in:
16
next_gen_ui_demo/assets/shaders/common/common.glsl
Normal file
16
next_gen_ui_demo/assets/shaders/common/common.glsl
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2023 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#define M_PI 3.14159265
|
||||
#define M_INVPI 0.31830989
|
||||
|
||||
float hash_1d(float v) {
|
||||
float u = 50.0 * sin(v * 3000.0);
|
||||
return 2.0 * fract(2.0 * u * u) - 1.0;
|
||||
}
|
||||
|
||||
float hash_2d(vec2 pos) {
|
||||
vec2 uv = 50.0 * fract(pos * M_INVPI);
|
||||
return 2.0 * fract(uv.x * uv.y * (uv.x + uv.y)) - 1.0;
|
||||
}
|
||||
Reference in New Issue
Block a user