Can Shader Lab be modified to also do Craft Shaders?

The Craft shader format would be so much easier to learn if we had an addition to Shader Lab that could handle Craft shaders.

Any chance of getting one?

i was looking at this myself and here’s what i gathered and it could be wrong:

shade isn’t even working for me anymore, failed to create document when making new shader

shade uses internal logic and algorithms to determine what nodes do
not all of these translate into glsl or the interpretor codea used for shading

so it’s not easy to get a shade shader into codea because the shaders use completely different tech for shading

@skar Shade functionality shouldn’t affect this, I don’t think.

The Shader Lab currently is just a UI for manipulating shaders on Codea’s normal mesh objects.

I’m trying to see if we can get that UI extended to manipulate shaders on Craft objects

Ohh my bad, I got confused between Shade (app) and shader lab included in Codea. But on that note, I have also investigated this on my end as I’m trying to add 3D support into Core framework at a simple scale.

Mesh and Craft Entities are different.

Mesh uses shader() to create a shader for the mesh, to which Codea provides some default things like matricProjection, etc.

Craft Entities use “Materials” or at least how Codea defines Materials, for which they are their own shaders but built in a different module, for instance, you CANNOT write your own shader code and pass it to Craft as such “craft.material(shader(myCode))” but you can do this with Mesh, “mesh.shader = shader(myCode)”

To support Craft Materials in the shader lab, I think it would be easy, they just need to make it support the module of shader language they are using for craft vs mesh.

But it seems to me that we can only really use the built-in materials, as I’ve tried to use others but they fail to load (since .mtl files are not what Codea says is a material, for Codea it’s a .shader file). You can actually open that materials in the shader lab if it doesn’t crash on you, and you can see the craft material code is shader code with tons of ifs and defined, and the shader lab shows an error in some places where it’s technically not an error for the module of shader code this is using, check out “Standard” Material in Shader Lab.

To do this you have to open the editor and type “craft.materials()” then click in the () to get the Materials menu to show up and click the pencil edit icon. This might make Codea crash, you just have to keep trying.