examples: add render-pass-ext exmaple

This commit is contained in:
YaoBing Xiao 2026-03-23 21:09:13 +08:00
parent 53630a0a60
commit 393f96274a
14 changed files with 705 additions and 0 deletions

View file

@ -0,0 +1,22 @@
custom_pass_embed = find_program('../../../../render/gles2/shaders/embed.sh', native: true)
triangle_vert = custom_target(
'custom-render-pass-triangle-vert',
command: [custom_pass_embed, 'custom_triangle_vert'],
input: 'triangle.vert',
output: 'triangle_vert.h',
feed: true,
capture: true,
)
triangle_frag = custom_target(
'custom-render-pass-triangle-frag',
command: [custom_pass_embed, 'custom_triangle_frag'],
input: 'triangle.frag',
output: 'triangle_frag.h',
feed: true,
capture: true,
)
gles2_shader_sources = [
triangle_vert,
triangle_frag,
]

View file

@ -0,0 +1,11 @@
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
varying vec3 v_color;
void main() {
gl_FragColor = vec4(v_color, 1.0);
}

View file

@ -0,0 +1,8 @@
attribute vec2 pos;
attribute vec3 color;
varying vec3 v_color;
void main() {
gl_Position = vec4(pos, 0.0, 1.0);
v_color = color;
}