Porting Shaders from Shadertoy

Learn about building and using Max for Live devices.
Post Reply
Artoo
Posts: 3
Joined: Tue Sep 11, 2012 4:39 pm

Porting Shaders from Shadertoy

Post by Artoo » Mon Jan 20, 2014 1:47 pm

I have been inspired by the site Shadertoy, and am trying to port some of the more simple shaders from shadertoy into .jxs files for use withing max4live.

Shadertoy makes use of some standard uniforms.

uniform vec3 iResolution; // viewport resolution (in pixels)
uniform float iGlobalTime; // shader playback time (in seconds)
uniform float iChannelTime[4]; // channel playback time (in seconds)
uniform vec3 iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click
uniform samplerXX iChannel0..3; // input channel. XX = 2D/Cube
uniform vec4 iDate; // (year, month, day, time in seconds)

Are there similar uniforms within jitter?

I guess sampler2d and sampler2drect are analagous to the iChannel uniform? What about resolution and time uniforms?

Also is it possible to pass-in/reference an audio signal - I would really like to try to create shaders that reacted to an audio signal playing within live.

Post Reply