Page 1 of 1

Shader Issue Migration PC Windows 10 to IMAC Catalina

Posted: Mon Oct 05, 2020 10:07 am
by machonar
Shader Issue Migration PC Windows 10 to IMAC Catalina 10.15.7 5700XT Graphics

Hello , I have been enjoying using Magic since I purchased it in June. I have recently moved from a PC to a new IMAC . Normally I have been able to figure most issues by referencing the manual or the Magic Web Site. However I now have a Shader question so not specific to Magic itself but hoping someone may be able to point me in the right direction.

On my PC (Windows 10) I had converted a number of Shadertoy files using the Converter https://magicmusicvisuals.com/utils/sha ... to_isf.php. and if they ran in my Browser (Google Chrome) they would work in Magic.

On My 2020 IMAC some of the Shaders that worked on my PC now don't give any output
I can preview the originals in Shadertoy ok via Google Chrome.

The problem on my IMac appears to be with shaders expecting texture inputs via a channel either directly mapped or via input through Magic

I have searched extensively and haven't found much on this topic so assuming at this stage its unique to me and I am missing something .
I don’t know enough about the shaders to diagnose what's going on. For the directly mapped channels all the *.jpg files are in the original locations i.e. the same folders as the Shaders. Some of the shaders at least on Shadertoy will produce output with all the channel inputs removed so I don’t think the issue is with the texture files.


Hoping someone may be able to point me in the right direction .

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Posted: Mon Oct 05, 2020 2:55 pm
by machonar
Further to my initial post I have found /Users/Shared/Magic_GLSL_compile_errors.txt. on my IMAC on checking this it seems to backup my thoughts that the issue Is with textures. I have checked back on the PC that I migrated from and although I used the same Shaders on the PC can find no matching errors.

Does Mac OS treat the shaders differently to windows in Magic ? Is there anything I can do to fix these errors as stated I am not familiar enough with how this works to identify if the logs are reporting the actual issue or a symptom of something else going on.

Extract from Log
03-10-2020 17:34:07 Fragment shader: A River 3_Input
ERROR: 0:26: Invalid call of undeclared identifier 'texture'
ERROR: 0:28: Invalid call of undeclared identifier 'texture'
ERROR: 0:30: Invalid call of undeclared identifier 'texture'
ERROR: 0:31: Use of undeclared identifier 'c1'
ERROR: 0:31: Use of undeclared identifier 'c2'
ERROR: 0:31: Use of undeclared identifier 'c3'
ERROR: 0:32: Use of undeclared identifier 'c1'
ERROR: 0:32: Use of undeclared identifier 'c1'
ERROR: 0:32: Use of undeclared identifier 'c1'
ERROR: 0:33: Use of undeclared identifier 'z'
ERROR: 0:78: Invalid call of undeclared identifier 'texture'
ERROR: 0:79: Invalid call of undeclared identifier 'texture'
ERROR: 0:80: Use of undeclared identifier 'rfa'
ERROR: 0:80: Use of undeclared identifier 'ref'

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Posted: Mon Oct 05, 2020 2:59 pm
by Magic
Different graphics cards have slighly different syntax requirements.

If you post the shader I'll probably be able to figure out the issue when combined with the error log you posted.

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Posted: Mon Oct 05, 2020 8:25 pm
by machonar
Many Thanks Eric

As requested I have attached the file which is based onhttps://www.shadertoy.com/view/MsSGWK fed through the conversion tool.

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Posted: Mon Oct 05, 2020 9:12 pm
by Magic
In your shader I think you might need to replace texture with texture2D. Try it and let me know if it works.

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Posted: Tue Oct 06, 2020 10:28 pm
by machonar
Thanks Eric,

I checked through some of GLSL_compile_errors.txt for ' Invalid call of undeclared identifier 'texture' ' and as you suggested substituting texture with texture2D fixed some of the shaders which now work as they did originally.

The shader that I used as an example and updated to texture2D however is still reporting error which are now;-
06-10-2020 23:01:12 Fragment shader: A River 3_Input_mod
ERROR: 0:78: No matching function for call to texture2D(sampler2D, vec3)
ERROR: 0:80: Use of undeclared identifier 'ref'

I did download the ISF Editor from https://vdmx.vidvox.net/blog/isf which is the link from your conversion tool but that reported a whole load of different errors including a malformed JSON blob so I assume would be out of context for me to use in this setting.

Thanks for your help.

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Posted: Wed Oct 07, 2020 8:08 pm
by Magic
The texture2D function can only accept a two-dimensional vector (.xy), not a three-dimensional vector (.xyz). Does that help?