Skip to content

Instantly share code, notes, and snippets.

@raizam
Last active March 13, 2020 13:16
Show Gist options
  • Select an option

  • Save raizam/54e436d5d06cbe2314e622a579d54f10 to your computer and use it in GitHub Desktop.

Select an option

Save raizam/54e436d5d06cbe2314e622a579d54f10 to your computer and use it in GitHub Desktop.
program instancing_program(mat4 view_proj) //uniforms
{
    // each '~' delimits separate vertex buffers
    @vs(vec3 pos, vec4 color) ~ (vec3 normal) ~ instanced(mat4 transform) 
    {
       return view_proj * transform * pos;
    }
    
    @ps(vec4 color, vec3 normal) //fragment shader inputs are deduced from vertex shader.
    {
       return color;
    }
}
@nem0
Copy link
Copy Markdown

nem0 commented Mar 13, 2020

Rewrite in rust when?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment