4.1 Mix 函数 | Shadertoy中文教程 #6
Replies: 2 comments
-
this is a test comment |
Beta Was this translation helpful? Give feedback.
0 replies
-
上面的代码 uv.y 是一个标量(scalar),也就是一个单独的浮点数值。 在 GLSL (OpenGL Shading Language) 中,mix 函数有多种重载形式。当你像这样调用它时: vec3 mix(vec3 x, vec3 y, float a) 它的工作方式是:使用同一个标量 a (在这里是 uv.y) 来对 x 和 y 的每一个分量(component)进行独立的线性插值。 展开来说,mix(gradientStartColor, gradientEndColor, uv.y) 等价于: vec3 result; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
4.1 Mix 函数 | Shadertoy中文教程
我们先看一下 mix 函数。当我们将多个 2D 形状渲染到场景中时,此功能对我们来说特别有用。
https://shadertoy.peakcoder.com/mulitple2d-shapes-mixing/mix/
Beta Was this translation helpful? Give feedback.
All reactions