summaryrefslogtreecommitdiff
path: root/src/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/shaders')
-rw-r--r--src/shaders/common/core.h2
-rw-r--r--src/shaders/default.c10
-rw-r--r--src/shaders/pbr.c10
-rw-r--r--src/shaders/unlit.c10
4 files changed, 16 insertions, 16 deletions
diff --git a/src/shaders/common/core.h b/src/shaders/common/core.h
index 69ff48b..2e895c5 100644
--- a/src/shaders/common/core.h
+++ b/src/shaders/common/core.h
@@ -50,7 +50,7 @@ if(cond) return 0; \
#define MVP_PROCESS \
do{ \
-static Vec4 p; p.xyz = in->vertex->position; p.w = 1; \
+static Vec4 p; p.xyz = in->position; p.w = 1; \
internal_mat4_mulvec4(uniforms->mvp, &p, clipcoord); \
}while(0)
diff --git a/src/shaders/default.c b/src/shaders/default.c
index e05d15d..efd9f25 100644
--- a/src/shaders/default.c
+++ b/src/shaders/default.c
@@ -11,13 +11,13 @@
/*varyings*/
#define rough reg_num_00
-static void vert(UniformCollection* uniforms, VertexShaderIn* in, Vec4* clipcoord) {
- static Vec4 p; p.xyz = in->vertex->position; p.w = 1;
+static void vert(UniformCollection* uniforms, Vertex* in, Vec4* clipcoord) {
+ static Vec4 p; p.xyz = in->position; p.w = 1;
internal_mat4_mulvec4(uniforms->mvp, &p, clipcoord);
Vec4 normal = {
- in->vertex->normal.x,
- in->vertex->normal.y,
- in->vertex->normal.z,
+ in->normal.x,
+ in->normal.y,
+ in->normal.z,
1
};
Vec4 worldnormal; internal_mat4_mulvec4(object2world, &normal, &worldnormal);
diff --git a/src/shaders/pbr.c b/src/shaders/pbr.c
index 556208e..1c74feb 100644
--- a/src/shaders/pbr.c
+++ b/src/shaders/pbr.c
@@ -19,14 +19,14 @@
#define _world_tangent reg_v3_03
#define _world_bitangent reg_v3_04
-static void vert(UniformCollection* uniforms, VertexShaderIn* in, Vec4* clipcoord) {
- static Vec4 p; p.xyz = in->vertex->position; p.w = 1;
+static void vert(UniformCollection* uniforms, Vertex* in, Vec4* clipcoord) {
+ static Vec4 p; p.xyz = in->position; p.w = 1;
object2clip(&p, clipcoord);
- Vec3 worldnormal = mat4_mulvec3(*_object2world, in->vertex->normal);
+ Vec3 worldnormal = mat4_mulvec3(*_object2world, in->normal);
worldnormal = vec3_normalize(worldnormal);
//*rough = 1 - internal_vec3_dot(&worldnormal, light);
- //*vnormal = in->vertex->normal;
- *_texcoord = in->vertex->texcoord;
+ //*vnormal = in->normal;
+ *_texcoord = in->texcoord;
_clip_pos->x = clipcoord->z;
_clip_pos->y = clipcoord->w;
}
diff --git a/src/shaders/unlit.c b/src/shaders/unlit.c
index 0b92c8c..c6a258b 100644
--- a/src/shaders/unlit.c
+++ b/src/shaders/unlit.c
@@ -8,13 +8,13 @@
/*varyings*/
#define rough reg_num_00
-static void vert(UniformCollection* uniforms, VertexShaderIn* in, Vec4* clipcoord) {
- static Vec4 p; p.xyz = in->vertex->position; p.w = 1;
+static void vert(UniformCollection* uniforms, Vertex* in, Vec4* clipcoord) {
+ static Vec4 p; p.xyz = in->position; p.w = 1;
internal_mat4_mulvec4(uniforms->mvp, &p, clipcoord);
Vec4 normal = {
- in->vertex->normal.x,
- in->vertex->normal.y,
- in->vertex->normal.z,
+ in->normal.x,
+ in->normal.y,
+ in->normal.z,
1
};
Vec4 worldnormal; internal_mat4_mulvec4(object2world, &normal, &worldnormal);