Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Invalid definition file of shader

in Shaders Posts: 15

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'

link to shader:
https://www.icloud.com/iclouddrive/0aq0SbS9OBeZlHLoNcFyDyaSA#Portal

Tagged:

Comments

  • Posts: 1,225

    @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?

    Does sharing files automatically save to iCloud?

  • dave1707dave1707 Mod
    Posts: 7,602

    @Picalines I also just loaded you Portal Shade and it worked fine using my code in the discussion Shade to Codea.

  • Posts: 15

    I uploaded this shader to icloud just for demonstration. I am using latest versions of iOS, Codea and Shade

  • Posts: 15

    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.

  • Posts: 1,225

    @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.

  • Posts: 15

    Originally i created shader in "On iPad" -> "Codea" folder using files app

  • edited May 11 Posts: 1,225

    @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.

  • Posts: 15

    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

    Anyway, thanks for help

  • SimeonSimeon Admin Mod
    Posts: 4,957

    @Picalines that is a bug in Codea, thank you for discovering it

Sign In or Register to comment.