Looking to understand the shade to Codea relationship a bit better.
I have a very simple mesh which I can map the built in procedural shader to. This works as expected.
--Very basic demonstration of a shader
--uses in built shader and has the minimum elements to get things upand running
displayMode(FULLSCREEN)
function setup()
m = mesh() --create the mesh
m.shader = shader(asset.builtin.Patterns.Bricks) --assign the shader to the mesh
verts={vec2(300,300),vec2(600,300),vec2(800,800),vec2(300,600)} --define the perimeter of the mesh shape
m.vertices=triangulate(verts) --use the triangulate command to ensure the correct mesh triangles are generated. A rectangle is represented by a path of six points: bl,tl,br,tl,br,tr in this order -->bl is bottom left
-- m.texCoords = {vec2(0,0),vec2(0,1),vec2(1,0),vec2(0,1),vec2(1,0),vec2(1,1)} --for texture based shaders the texCoords will also need to be generated and this is done relative to the TEXTURE image, not the projected mesh shape
m:setColors(255,255,255,255) --assign colors to all vertices
--shader specific inputs mappings to the uniforms/bindings for built in brick shader
m.shader.mortarColor=vec4(0.8,0.8,0.8,1.0)
m.shader.brickSize=vec3(35,15,35)
m.shader.brickPct=vec3(0.9,0.85,0.85)
m.shader.brickColor=vec4(1.0,0.3,0.2,1.0)
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
m:draw()
end
What I want to do is drag across a shader from shade. If I try to drag across the checkers shader from shade (split screen and drag from shade into the shader function it gives me a warning, doesn’t update properly, but the shader is now in the assets for the project. When I select it from the picker and run it crashes out. I’m wondering if there are additional bindings required? (I’ve see this approach successfully with the AR Face demo, but the code is way more complex)