shader-park / shader-park-core

A JavaScript library for creating real-time 2D and 3D shaders. JS -> Shader. https://shaderpark.com/ https://twitter.com/shaderpark

Home Page:https://shaderpark.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add function 'shapeFromGLSL'

PWhiddy opened this issue · comments

create an sdf primitive using sdf string

provide glsl source which defines a function which defines an sdf with signature 'float shapeSDF(vec3 p)'
automatically create primitive

let mySphere = glslShape(`
float shapeSDF(vec3 p) {
    return length(p) - 0.5;
}`);

mySphere()

It's working! de8e517