內容簡介
此外掛允許您顯示與 https://shadertoy.com 相容的 WebGL2 片段著色器。
只需將您的片段著色器代碼複製並粘貼到編輯框中即可。
此外掛使用 Brandon Jones 和 Colin MacKensie IV 的開源 "gl-matrix" 函式庫。
您的著色器代碼應類似以下範例。對於每個像素,都會呼叫 mainImage() 函數。
`
void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
// 正規化像素座標 (從 0 到 1)。
vec2 uv = fragCoord / iResolution.xy;
// 輸出到螢幕 as (r, g, b, alpha)。
fragColor = vec4(uv.x, uv.y, 0.0, 1.0);
}
`
外掛標籤
開發者團隊
原文外掛簡介
This plugin allows you to display a WebGL2 fragment shader, compatible with https://shadertoy.com
Simply copy and paste the code of your fragment shader into the edit box.
This plugin makes use of the open source “gl-matrix” library by Brandon Jones and Colin MacKensie IV.
Your shader code should look like the example below. The mainImage() function is called once for each pixel.
`
void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
// Normalized pixel coordinates (from 0 to 1).
vec2 uv = fragCoord / iResolution.xy;
// Output to screen as (r, g, b, alpha).
fragColor = vec4(uv.x, uv.y, 0.0, 1.0);
}
`
