blob: cc3144362a9a300b6c0a55151da95c67f16a7164 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include "common/core.h"
/*uniforms*/
#define object2world UM4(0)
#define light UV3(0)
#define maintex UTEX(0)
/*varyings*/
#define rough reg_num_00
static void vert( Vertex* in, Vec4* clipcoord) {
static Vec4 p; p.xyz = in->position; p.w = 1;
Vec4 normal = {
in->normal.x,
in->normal.y,
in->normal.z,
1
};
Vec4 worldnormal; internal_mat4_mulvec4(object2world, &normal, &worldnormal);
internal_vec3_normalize(light, light);
*reg_num_00 = 1 - internal_vec3_dot(&worldnormal, light);
}
static bool frag( Color32* color) {
internal_vec3_normalize(light, light);
return 1;
}
Program ssr_built_in_shader_unlit = {
vert, frag,
VARYING_NUM_00
};
|