FIXED: Glsl material not working properly on mac

hi!

i recently did lucas morgans course on volumetric lighting (link) and couldn’t continue at some point, because the render top wouldn’t show anything but black. i tried the example project attached to the course and that also didn’t work. i tried both projects on an old thinkpad and they both worked.

i emailed lucas about this and he couldn’t help me unfortunately. regarding to the last release notes it seems there are some pbr/glsl mat issues with apple machines and this might be one of those i guess.

issue.toe (16.7 KB)

i attached the file with the problem.
i’m on a imac 2020 27" 6core i5 with a radeon pro 5300 4gb.
build is 2021.14360

hope this is the right forum!
thanks :slight_smile:

This is the correct place, thanks we will investigate.

We haven’t been able to reproduce the issue. Do you have any problem with this file in older builds? Can you open up Terminal, go to the executable directory inside TouchDesigner app directory - /Applications/TouchDesigner.app/Contents/MacOS/ and run ./TouchDesigner issue.toe in that directory and let us know if you see any errors printed to the Terminal please? Thank you.

i also had this problem with the two build i had installed before this one, but i don’t remember which ones they were. shouldnt be tooo old because i just got this imac recently, like a 1 1/2 months ago.

i ran the .toe through terminal an this is what i got, hope it helps.

WARNING: Output of vertex shader 'vColor' not read by fragment shader

Program Number 28
===============VERTEX SHADER=================
1: #version 410
2:  #extension GL_ARB_shading_language_include : enable
3:  #define TD_VERTEX_SHADER
4:  uniform vec4 uData[492];
5:  uniform sampler2DArray sInput0;
6:  uniform mat4 uTDWorldCamProj;
7:  uniform vec2 uScale;
8:  layout(location = 0) in vec2 P;
9:  out vec4 vColor;
10:  void main()
11:  {
12:  	int glyphIdx = gl_InstanceID / 7;
13:  	int vtxIdx = ((gl_InstanceID % 7) * 30) + gl_VertexID;
14:  	vec4 info = uData[glyphIdx];
15:  
16:  	int texZNV = floatBitsToInt(info.y);
17:  	int numVerts = texZNV & 0xFFFF;
18:  	if (vtxIdx >= numVerts)
19:  	{
20:  		gl_Position = vec4(0,0,0,0);
21:  		return;
22:  	}
23:  	int texXY = floatBitsToInt(info.x);
24:  
25:  	int texX = (texXY >> 16) & 0xFFFF;
26:  	int texY = (texXY) & 0xFFFF;
27:  	int texZ = (texZNV >> 16) & 0xFFFF;
28:  	texX += vtxIdx;
29:  	texY += texX / 3000;
30:  	texX = texX % 3000;
31:  	vec2 coords = texelFetch(sInput0, ivec3(texX, texY, texZ), 0).rg;
32:  vColor = vec4(coords.x, 0, 0, 1);
33:  	coords *= uScale;
34:  	coords += info.zw;
35:  	gl_Position = uTDWorldCamProj * vec4(coords, 0.0, 1.0);
36:  }
37:  
===============VERTEX SHADER=================
1: #version 410
2:  #extension GL_ARB_shading_language_include : enable
3:  #define TD_PIXEL_SHADER
4:  vec4 TDOutputSwizzle(vec4 v);
5:  out vec4 fragColor;
6:  in vec4 vColor;
7:  void main()
8:  {
9:  	vec4 outCol = vec4(1.0);
10:  	fragColor = TDOutputSwizzle(outCol);
11:  }
12:  
1: #version 410
2:  #extension GL_ARB_shading_language_include : enable
3:  #define TD_PIXEL_SHADER
4:  vec4 TDOutputSwizzle(vec4 c)
5:  {
6:  	return c.rgba;
7:  }
8:  
WARNING: Output of vertex shader 'vColor' not read by fragment shader

WARNING: Output of vertex shader 'vColor' not read by fragment shader

WARNING: Output of vertex shader 'vColor' not read by fragment shader

Program Number 84
===============VERTEX SHADER=================
1: #version 410
2:  #extension GL_ARB_shading_language_include : enable
3:  #define TD_VERTEX_SHADER
4:  uniform vec4 uData[492];
5:  uniform sampler2DArray sInput0;
6:  uniform mat4 uTDWorldCamProj;
7:  uniform vec2 uScale;
8:  layout(location = 0) in vec2 P;
9:  out vec4 vColor;
10:  void main()
11:  {
12:  	int glyphIdx = gl_InstanceID / 1;
13:  	int vtxIdx = ((gl_InstanceID % 1) * 30) + gl_VertexID;
14:  	vec4 info = uData[glyphIdx];
15:  
16:  	int texZNV = floatBitsToInt(info.y);
17:  	int numVerts = texZNV & 0xFFFF;
18:  	if (vtxIdx >= numVerts)
19:  	{
20:  		gl_Position = vec4(0,0,0,0);
21:  		return;
22:  	}
23:  	int texXY = floatBitsToInt(info.x);
24:  
25:  	int texX = (texXY >> 16) & 0xFFFF;
26:  	int texY = (texXY) & 0xFFFF;
27:  	int texZ = (texZNV >> 16) & 0xFFFF;
28:  	texX += vtxIdx;
29:  	texY += texX / 3000;
30:  	texX = texX % 3000;
31:  	vec2 coords = texelFetch(sInput0, ivec3(texX, texY, texZ), 0).rg;
32:  vColor = vec4(coords.x, 0, 0, 1);
33:  	coords *= uScale;
34:  	coords += info.zw;
35:  	gl_Position = uTDWorldCamProj * vec4(coords, 0.0, 1.0);
36:  }
37:  
===============VERTEX SHADER=================
1: #version 410
2:  #extension GL_ARB_shading_language_include : enable
3:  #define TD_PIXEL_SHADER
4:  vec4 TDOutputSwizzle(vec4 v);
5:  out vec4 fragColor;
6:  in vec4 vColor;
7:  void main()
8:  {
9:  	vec4 outCol = vec4(1.0);
10:  	fragColor = TDOutputSwizzle(outCol);
11:  }
12:  
1: #version 410
2:  #extension GL_ARB_shading_language_include : enable
3:  #define TD_PIXEL_SHADER
4:  vec4 TDOutputSwizzle(vec4 c)
5:  {
6:  	return c.rgba;
7:  }
8:  
WARNING: Output of vertex shader 'vColor' not read by fragment shader

WARNING: Output of vertex shader 'vColor' not read by fragment shader

Thank you, but unfortunately I don’t see any errors, so the issue is probably something else. What version of macOS are you on?

i’m on macOS 11.3.1.

edit: just updated to 11.4, still the same problem :confused:

any news on this one? i tried using 2020.27390 randomly, but that also didn’t work. could it be a problem with my machine?

nothing? :confused:

No luck reproducing this on any of our machines unfortunately. This is most likely a macOS GLSL bug though, as we have been running into those more and more.

ooookay :confused:
thanks for all the effort though!

hi!

i try to get this working each time a new version comes out and it was always just the same, i didnt see anything. but! with the latest experimental version (2021.38110) td crashes while opening issue.toe and gives me this error message:

TouchDesigner has encountered an error and must close.
It will now attempt to save your current file to filepath/CrashAutoSave.issue.1.toe.
Crash reports can be found by opening Applications->Utilities->Console. Please look for a file named TouchDesigner_date-xxx.crash under User Reports and email this file to support@derivative.ca so we can fix the problem.

now if i open the file provied by lucas morgan in the course, touchdesigner opens the file and it actually works, the tops are showing the volumetric lights. but if try to zoom inside a geo comp touchdesigner crashes and gives me the same error message. (edit: also if i try to replace the geometry)

i hope this will help to get rid of this problem, files are attached (i dont know if im actually allowed to share that course example file, but if not, i will remove it)

CrashAutoSave.issue.1.toe (16.8 KB)
CrashAutoSave.lucasmorgancourseexample.1.toe (22.1 KB)

We fixed a huge number of 38110’s crashes in the current experimental build 2021.39010. How does that build fair for you?
The new experimentla builds are now running Vulkan/Metal and macOS has finally been freed of the openGL limitations it has for GLSL, so you can expect much better GLSL feature support in macOS now. But experimental builds are basically like beta builds, so you’ll also find lots bugs right now as they stabilize into production ready builds.

issue.toe opens without crashes, the other one doesnt. buuut i redid the whole course from the start and it actually worked pretty well, thanks so much! there are still some crashes when trying to change different things like turning on shadows in the light comp and stuff like that, can i somehow help by providing the crashautosave files? :slight_smile:

again, thank you sooo much!

edit: the .toe i made in 2021.39010 also works in older builds. its not displaying everything correctly, but its working.

Crashautosave file will not help us, if the crash is reproducible then the regular .toe file is just as good. If you can send us the Crash Reports from the Console.app, they are more helpful.

You can sometimes use a .toe file in earlier build within the same branch, but it is risky. I would not recommend using a .toe file from 30k back in 10k official, some part of it will be corrupt.

one of the light comps, reset all parameters, after that activate hard shadows → crash
where do i get the console output?

test.toe (19.1 KB)

Open macOS’s built-in ‘Console’ application. There is a section in the left column for “Crash Reports”

Hey @xmarianx

I was able to reproduce that crash and logged an issue for a dev to look into it.

Best,
Michel

This will be fixed in the next experimental build we post. Tested with both the original issue.toe file and the more recent test.toe file.

1 Like

thanks so much!

hi,

it seemed to work fine with a few experimental builds this year before the official 2022 release, but at least since the official release it doesn’t work anymore. i did everything again from scratch in the latest build (2022.28040), nothing crashes and all the shaders compile correctly,but as soon i try to implement the given td pbr function, the renders only show the red and blue error squares.

20220902 test.toe (9.9 KB)