ShaderAbstractions
Abstractions to construct shader objects for any WebGL/OpenGL/EGS context! You construct the objects, and then render them in any backend.
using ShaderAbstractions, LinearAlgebra
using ShaderAbstractions: VertexArray
using Test, GeometryBasics
import GeometryBasics
struct WebGL <: ShaderAbstractions.AbstractContext end
m = GLNormalMesh(Sphere(Point3f0(0), 1f0))
mvao = VertexArray(m)
instances = VertexArray(positions = rand(GeometryBasics.Point{3, Float32}, 100))
x = ShaderAbstractions.InstancedProgram(
WebGL(),
"void main(){}\n", "void main(){}\n",
mvao,
instances,
model = Mat4f0(I),
view = Mat4f0(I),
projection = Mat4f0(I),
)