Changeset View
Changeset View
Standalone View
Standalone View
src/shaders/sdf_core.frag
1 | // Copyright (c) 2019 Arjen Hiemstra <ahiemstra@heimr.nl> | 1 | // SPDX-FileCopyrightText: 2019 Arjen Hiemstra <ahiemstra@heimr.nl> | ||
---|---|---|---|---|---|
2 | // SPDX-FileCopyrightText: 2017 Inigo Quilez | ||||
3 | // | ||||
4 | // SPDX-License-Identifier: MIT | ||||
2 | // | 5 | // | ||
3 | // This file is based on | 6 | // This file is based on | ||
4 | // https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm | 7 | // https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm | ||
5 | // | | |||
6 | // The MIT License | | |||
7 | // Copyright © 2017 Inigo Quilez | | |||
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy | | |||
9 | // of this software and associated documentation files (the "Software"), to deal | | |||
10 | // in the Software without restriction, including without limitation the rights | | |||
11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | | |||
12 | // copies of the Software, and to permit persons to whom the Software is | | |||
13 | // furnished to do so, subject to the following conditions: The above copyright | | |||
14 | // notice and this permission notice shall be included in all copies or | | |||
15 | // substantial portions of the Software. | | |||
16 | // | | |||
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | | |||
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | | |||
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | | |||
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | | |||
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | | |||
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | | |||
23 | // SOFTWARE. | | |||
24 | 8 | | |||
25 | //include "desktop_header_core.glsl" | 9 | //include "desktop_header_core.glsl" | ||
26 | 10 | | |||
27 | // A maximum point count to be used for sdf_polygon input arrays. | 11 | // A maximum point count to be used for sdf_polygon input arrays. | ||
28 | // Unfortunately even function inputs require a fixed size at declaration time | 12 | // Unfortunately even function inputs require a fixed size at declaration time | ||
29 | // for arrays, unless we were to use OpenGL 4.5. | 13 | // for arrays, unless we were to use OpenGL 4.5. | ||
30 | // Since the polygon is most likely to be defined in a uniform, this should be | 14 | // Since the polygon is most likely to be defined in a uniform, this should be | ||
31 | // at least less than MAX_FRAGMENT_UNIFORM_COMPONENTS / 2 (since we need vec2). | 15 | // at least less than MAX_FRAGMENT_UNIFORM_COMPONENTS / 2 (since we need vec2). | ||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |