summaryrefslogtreecommitdiff
path: root/src/example/04_bloom/preprocess.c
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-12-21 22:24:15 +0800
committerchai <chaifix@163.com>2019-12-21 22:24:15 +0800
commitec111247c614663d8231245a17c314b9b8b4a28c (patch)
treea66058508161da488371c90316865ae850b8be15 /src/example/04_bloom/preprocess.c
parentc3f45735ecfab6e567be371758f21395e92dfef6 (diff)
*misc
Diffstat (limited to 'src/example/04_bloom/preprocess.c')
-rw-r--r--src/example/04_bloom/preprocess.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/example/04_bloom/preprocess.c b/src/example/04_bloom/preprocess.c
new file mode 100644
index 0000000..def9fd8
--- /dev/null
+++ b/src/example/04_bloom/preprocess.c
@@ -0,0 +1,31 @@
+#include "../../shaders/common.h"
+
+/*uniforms*/
+
+/*varyings*/
+#define _color reg_v4_00
+
+static void vert(UniformCollection* uniforms, VertexShaderIn* in, Vec4* clipcoord) {
+ static Vec4 p; p.xyz = in->vertex->position; p.w = 1;
+ mat4_mulvec4(uniforms->mvp, &p, clipcoord);
+ color_tocolor32(in->vertex->color, _color);
+}
+
+/*multi target*/
+#define _frag_color out_color[0]
+#define _bright_color out_color[1]
+
+static bool frag(UniformCollection* uniforms, FragmentShaderIn* in, Color32* color) {
+ //_frag_color->r = 1;
+ //_frag_color->g = 1;
+ //_frag_color->b = 1;
+ //_frag_color->a = 1;
+ //*_bright_color = *_color;
+ *_frag_color = *_color;
+ return 1;
+}
+
+Program _04_bloom_preprocess = {
+ vert, frag,
+ VARYING_V4_00
+};