Previous topicNext topic

Shader Issue Migration PC Windows 10 to IMAC Catalina

Questions, comments, feedback, etc.
Post Reply
machonar
Posts: 4
Joined: Mon Oct 05, 2020 9:58 am

Shader Issue Migration PC Windows 10 to IMAC Catalina

Post 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 .
machonar
Posts: 4
Joined: Mon Oct 05, 2020 9:58 am

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Post 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'
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Post 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.
machonar
Posts: 4
Joined: Mon Oct 05, 2020 9:58 am

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Post 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.
Attachments
A River 3_Input.fs
MsSGWK
(2.2 KiB) Downloaded 168 times
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Post by Magic »

In your shader I think you might need to replace texture with texture2D. Try it and let me know if it works.
machonar
Posts: 4
Joined: Mon Oct 05, 2020 9:58 am

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Post 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.
Attachments
A River 3_Input_mod.fs
texture now texture2D
(2.21 KiB) Downloaded 163 times
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Shader Issue Migration PC Windows 10 to IMAC Catalina

Post by Magic »

The texture2D function can only accept a two-dimensional vector (.xy), not a three-dimensional vector (.xyz). Does that help?
Post Reply