Skip to content

Instantly share code, notes, and snippets.

@kovrov
Created January 19, 2017 06:38
Show Gist options
  • Save kovrov/11879c65a35dcd52a07d5625b802e3e8 to your computer and use it in GitHub Desktop.
Save kovrov/11879c65a35dcd52a07d5625b802e3e8 to your computer and use it in GitHub Desktop.
Render passes
pass_1: {
uniforms: {
view: camera.view
projection: camera.projection
}
id_tex: {
format: GL_R8UI
size: {width, height}
}
depth_tex: {
format: GL_DEPTH_COMPONENT24
size: {width, height}
}
target: {
attachments: [
{
texture: id_tex
attachment: GL_COLOR_ATTACHMENT0
drawbuffer: GL_COLOR_ATTACHMENT0
}
{
texture: depth_tex
attachment: GL_DEPTH_ATTACHMENT
drawbuffer: GL_NONE
}
]
}
shader: {
vertex: "stencil.vert"
fragment: "stencil.frag"
}
}
pass_2: {
uniforms: {
view: camera.view
projection: camera.projection
id_map: pass_1.id_tex
depth_map: pass_1.depth_tex
}
target: default
shader: {
vertex: "solid.vert"
fragment: "solid.frag"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment