Howdy, Stranger!

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

In this Discussion

Shade to Codea

in Codea Craft Posts: 61

Hi,
How do you import shaders made in Shade into Codea? I saved some of the example shaders in the Codea folder. Although they are shown when picking a shader in Codea, it crashes once I run a Craft project with a shader applied to a model. In Shader Lab, the shaders are empty.
Thanks in advance

Comments

  • dave1707dave1707 Mod
    Posts: 7,468

    @Leon Here's an example that uses a Shade from Shader. Just copy the Shade from Shader into the Codea Dropbox folder. I used the Checker Shader in this example.

    function setup()
        -- uses a shader from Shade.
        scene = craft.scene()
        skyMaterial=scene.sky.material
        skyMaterial.sky=color(0, 62, 255, 255)
        skyMaterial.horizon=color(99, 255, 0, 255)
        v=scene.camera:add(OrbitViewer, vec3(0,0,0), 100, 0, 200)
        v.rx,v.ry=20,20
        createRect1()
    end
    
    function draw()
        update(DeltaTime)
        scene:draw()    
    end
    
    function update(dt)
        scene:update(dt)
    end
    
    function createRect1() 
        local c1=scene:entity()
        c1.position=vec3(0,0,0)
        c1.model = craft.model.cube(vec3(10,10,10))
        c1.material = craft.material("Dropbox:Checkers")    
    end
    
Sign In or Register to comment.