ShaderAbstractions.jl

A backend independent shader API (For e.g. OpenGL WebGL and Vulkan)
Author SimonDanisch
Popularity
3 Stars
Updated Last
1 Year Ago
Started In
April 2019

ShaderAbstractions

Build Status Build Status Codecov

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),
)