Shade export to Metal

Hey guys! Quick question about Shade. I see that it is able to export the shaders to Unity and I am wondering if it is also possible to export to Metal shaders for Xcode ?


Ok, so I started the trial and was able to see all the export options.

The SCNMaterial export option seemed like it could do what I want, no need for a Metal shader export if that is the case. BUT when I tried to export the example Hologram shader and run the Playground or attach the material to my own scene, it just renders a flat purple texture :tired_face:

@Simeon @John any ideas about this? Is the SCNMaterial export broken ?

There must be a syntax error in the exported shader, I’ll have to check it out

Thanks @John please let me know what you find. Hesitant to purchase the full version of Shade without this feature working

@JakAttak Fair enough, I’ve had most of my time monopolised by Codea 4.x, but I’ll get back to when I get the chance

Any update on this? @John

I just had a look at the errors with SCNMaterial. It basically comes down to some differences between MSL and GLSL. In GLSL you can have distance(float a, float b) but in MSL you can’t do that because distance(float, float) is not defined. Instead it needs to be changed abs(a - b) to get the same result. Another issue is that any user defined functions need to be renamed.

It looks like shade needs to be updated to support some of these features. I’ll try get it working with this shader first but there are no doubt a number of other things that will need to be addressed. Some features will be dependent on what SCNMaterial can support (I’m restricted by some of the design choices Apple made with regards to custom shaders within a SCNMaterial object)

1 Like