Help us understand the problem. What is going on with this article?

ShaderToyのソースコードをTouchDesignerで使う

More than 5 years have passed since last update.

TouchDesignerでGLSLを使うには、GLSL TOPとText DATをつなぎ、Text DATにGLSLのコードを書く。
ShaderToyのコードも、サイト特有の変数表記をTouchDesigner特有のものに差し替えればほぼそのまま動く。
以下はその差し替え項目と差し替え方の例。他にもあるかも。

1 メイン関数?の表記差し替え

void mainImage( out vec4 fragColor, in vec2 fragCoord )

void main( void )
へ。

2 Shadertoy固有の変数

こんな感じでText DAT内で定義した上で、

uniform vec3 iResolution;
uniform float iGlobalTime;
uniform vec4 iMouse;

GLSL TOPのパネルで変数定義をする。
iGlobalTimeについては、たとえばme.time.secondsもしくはabsTime.secondsといったビルトイン変数などを割り当てる。

3 画像や動画の入力口の名称

iChannel* は画像などの入力なので、GLSL TOPに入力する口に合わせて変数を入れ替える。
iChannel0

sTD2DInputs[0]
へなど。

4 使わない変数にはとりあえず0を入れておく

vec2 fragCoord = vec2(0.0, 0.0);

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした