Why i can’t import this shader to Codea? obj.material = craft.material("Documents:Portal")
After that the error appears: Main:24: Shader could not be loaded (definition file invalid) - Documents:Portal stack traceback: [C]: in field 'material' Main:24: in function 'setup'
@Picalines - had trouble saving the file to my Codea folder , but once there ran ok. Photo with use in a cube. The file was saved to my iCloud Drive and seemed not to want to transfer to my Codea folder.
Later I tried adding a zero number node and saving again - if you struggle you might try that.
What versions of Shade and Codea are you using and what device and iOS?
I tested shader using Shade to Codea discussion and it didn’t work as well. Rebooting the device (iPad Air 2) and editing the shader doesn’t help either.
@Picalines - have you used the fileapp to ensure you have a copy of the Portal.shader in your Codea Documents folder - that’s where I ran it from on my iPad. Tend not to use iCloud.
@Picalines - so you have verified the shader is in the Codea folder. When you tap on the craft.material() input
obj.material = craft.material("Documents:Portal")
can you see the file in the selection window? you have to close Codea and restart it to see these files in the dialog window. Codea creates an asset list when it is started.
Okay, I see what the problem is. Somehow I was able to create a Shader called Portal, although I already had an image with the same name in my folder. Apparently Codea tried to use sprite instead of Shader. I think it is a bug of files app, but who knows. Now all works fine