volumetric light effect in Shadertoy

Hello

Is there someone who can help me to create a volumetric light effect. I am quit new in the fantastic world of shaders. :confused:

I saw a nice shader on shadertoy but I really dont know how I can import the Shader in TD,
shadertoy.com/view/Mdl3Rr

Any help is welcome.

Thanks a lot

Its actually not too difficult. All you really need to do is create a GLSL TOP, copy the shader code into a Text DAT, change a couple variable names, and plug it into the pixel shader field of the vertex field of the GLSL TOP.

The main variable that needs to be changed in codes copied from shadertoy is the call to iChannel#. Touch designer uses sInput# instead to define its texture inputs. This can easily be replaced with a Substitute DAT.

Also important to remember is to put in your uniform variable names and values into the Vectors page of the GLSL TOP.

Check out the attached scene.
attic.toe (7.86 KB)

Thank you so much :smiley:

Now the next step is a volumetric light effect when I using a light comp. :wink:
Is there a way to generate these effect whit a shader?

Also important to remember is to put in your uniform variable names and values into the Vectors page of the GLSL TOP

Where did i found these uniform varible names?

at the very top of the shader the Uniform variable names are listed:

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

Volumetric light on the Light COMP would be dope. Let me know if you figure that one out.

In the mean time you can use this plugin for 2D effects: viewtopic.php?f=22&t=1650&p=5275&hilit=volumetric#p5275

Oke ive got a simple shader from shadertoy working. :slight_smile:
It is just te basic shader where you can start writing a new shader.

but when I copy another shader for example the clouds it gives a error in the info DAT.

Vertex Shader Compile Results:

Compiled Successfully

=============

Pixel Shader Compile Results:

Compiled Successfully

=============

Program Link Results:
Fragment shader(s) were not successfully compiled before glLinkProgram() was called. Link failed.

What does these means?

Ive uploaded te toe file for the example


shader toy import.toe (8.89 KB)

Not sure why the driver is returning such an unhelpful error. On my card it tell me the shader is written for GLSL 1.20, so you need to change the GLSL version in the GLSL TOPs parameters.
Also you have this line in the shader

uniform samplerXX iChannel0..3

Which isn’t valid GLSL. XX should be replaced with the texture type (2D etc.), and I assume you want 3 different samplers, so split that up onto 4 lines for iChannel0, iChannel1 etc.

HI. I just loaded your attic.toe scene into TD on my machine to see the volumetric light.

I am comparing it to the attic scene loaded up on the Shadertoy website in Chrome on Win7pro.

If I view the Shadertoy version on the page of fullscreen I have near 60fps performance.

If I play attic.toe in TD it’s quite slow, never topping 6fps. How is this scene benchmarking for others of you out there?

I have a Quadro K4000 card.

Since it’s purely a pixel based operation (no geometry at all), the resolution is a huge part of how expensive it will be. In the default shadertoy view it’s running at a very low res windows, while the GLSL TOP is running at 1024x1024. If you make the resolutions similar, the performance is similar too.

Sorry, I missed the part where you said you were running fullscreen. How are you measuring FPS in that case? My GPU is similar power and runs it quite slow on fullscreeen.

Perhaps the ‘fullscreen’ I saw on shadertoy was just a scaling up of its original small resolution and I was fooled.

In the attic.toe I have set glsl1’s from 1024x1024 to 256x256 the frame rate goes up to to 33 fps.