[WordPress] 外掛分享: Display WebGL Shader

首頁外掛目錄 › Display WebGL Shader
10+
安裝啟用
尚無評分
1460 天前
最後更新
問題解決
WordPress 5.8+ PHP 7.0+ v1.0.3 上架:2021-12-21

內容簡介

此外掛允許您顯示與 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);

}
`

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Display WebGL Shader」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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);

}
`

文章
Filter
Apply Filters
Mastodon