Working GLSL TD Files for OSX Beta


These are some of the ones I’ve tried … ame#p22918

Is there a workaround for the GLSL 1.20 issue?

Unfortunately no, it’s a limitation of macOS that they don’t support GLSL 1.20 in their OpenGL 3.30 driver. The only way to avoid it is to upgrade the shader to GLSL 3.30, which isn’t a huge task luckily.

I see. Are there any existing project files which already have GLSL 3.30 shaders that work on OSX?

I have started looking at the intro tutorials to GLSL and the basics of TD but I really want to just open up a working project to see how things fit together down the line…

TD-Particle-Flowfields is actually GLSL 4.00 and 4.30, which is also why it fails on macOS.
The waves one doesn’t seem to have much GLSL actually, when you cloned the repository did you also get the ‘shared’ submodule?
You can do that with
git submodule init
git submodule update

Or download that project manually and put it in the shared directory.

hi movingninja,

welcome to the forum.

If you want to learn GLSL I’d advice you to begin with some simpler shaders, as you’ve chosen not the most easy ones for beginners to dissect.

That said, I’ve converted the TD-particles-flowfield from Asterix to GLSL 3.30 so you can have a look. I just tested it on my MacBook Air and it works.
particles-flowfield_glsl330_OSXv2.toe (10.8 KB)
Another advanced GLSL example is particlesGpu, it comes with TD and you can drag it in your network from the Palette
(it’s under Tools)

Some more TD GLSL examples which are perhaps a bit easier to digest are in the collection of David Braun on github

have fun!

Great, thanks to the both of you for your help.

One last question regarding the updated particles-flowfield_glsl330_OSX.tox file - is that meant to display output of some kind?

When I hit F1, I just get a xyz axis in a black space…

Thanks again

that is correct, this example was not made to show any output in perform mode(F1).

You need to go one level deeper, so scroll your mousewheel to zoom in until you enter the first Comp called “Composition”, in that network you’ll see some output. From there, zoom in to the Comp called ‘particles1’ to see more of the network.

Read “13. Navigate into Component Operators that contain Networks” on this page:
First Things to Know about TouchDesigner

Also, here’s another version which does show output when starting perform mode (F1)
particles-flowfield_glsl330_OSXv2.toe (10.8 KB)

Hu Nettoyeur

Thanks so much for taking the time to answer these questions.

I think from here I’d better start going through some simpler examples.

The file produces just a black window for me and when zooming in, there is a compile error in the GLSL shader that is too advanced for me.

Thanks again.

Screen Shot 2017-01-27 at 11.53.13.png

Do you know what model graphics card is in your mac?

Have you tried the other example from Palette?

It’s an Intel Iris Pro

I’ll try that other example now…


and also post what that GLSL error is, printed in the info1 DAT

I’d start with simpler ones. I know very few people who “just dived in” to GLSL shaders. You basically buckle down with the GLSL orange book or you start with tutorials and just build your way up.

Good intro to shaders in TouchDesigner is in our book, I believe we stuck to GLSL 3.30, but if not and you have errors, you can just post on the forum: … ction.html

If you’re completely new to TouchDesigner, you may want to start at the beginning and see Matthew Ragan’s site: … hdesigner/

Depending on what you need, many other good learning resources available too.

for a primer on glsl programming, you should consider this:

it sort of kicks ass. :slight_smile:

While also new in shaders I got into the same problem:

Pixel Shader Compile Results:
ERROR: 0:1: ‘’ : syntax error: #extension must always be before any non-preprocessor tokens

How can we fix this compile error in a mac?

Many Thanks

#extensions are processor-specific — I’d google the name of the extension and the name of your graphics card together and try to find documentation to see if your card supports that specific extension

Movingninja - are you the movingninja from Tectonic?

Hi There! I’m trying to get this example to work but the only error I am faced with is the particleMotion text linked to the GLSL Multi TOP. Do anyone know how to fix this?


Pixel Shader Compile Results:
ERROR: 0:1: ‘’ : syntax error: #extension must always be before any non-preprocessor tokens

for the line:

#extension GL_ARB_gpu_shader_fp64 : enable

Things such as #extensions should be specified in a DAT via the Preprocess Directives parameter, not in the shaders directly. That way it ensures it’s placed before other code that we add to your shaders to provide built-in uniforms etc.

Ok thanks, that makes sense!

Now the problem I am facing are these errors that come up:

Pixel Shader Compile Results:
ERROR: 0:41: ‘double’ : Reserved word.
ERROR: 0:41: ‘double’ : syntax error: syntax error

The only thing I did was move ‘#extension GL_ARB_gpu_shader_fp64 : enable’ from the shader into the Preprocess Directives parameter. I know that it’s not as simple as that. What specific way do you have to reference the extension in this parameter?

Iv’e been searching but can’t find the right answer. I’m new to this area of Touch

Is that extension supported by your GPU? You can check by using the OpenGL extension viewer app made by realtechVR

  1. make a text DAT, and paste the “#extension GL_ARB_gpu_shader_fp64 : enable” line inside.
  2. drag the text DAT (or type the name of the DAT) into the Preprocess Directives parameter, in the GLSL Multi TOP.

Took me a while to figure this out, but I was so happy when i did, that I had to come here and share :slight_smile:

Hope this helps!