Compare commits

...

2 Commits

Author SHA1 Message Date
66ca20ee5b Reformat 2024-09-14 02:45:34 +01:00
ef0c29de02 Update head model 2024-09-14 02:43:56 +01:00
4 changed files with 24965 additions and 6179 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
#include "depth_shader.h"
#include "constants.h"
#include "shader.h"
VertexData depth_shader_vertex(void *shader, const VertexData *vert, u8 index, const Model *model) {
@ -18,9 +19,9 @@ FragmentResult depth_shader_fragment(void *shader, const V3f *barycentric, const
M3x3f pos_mat = {.rows = {shdr->vertices[0].position, shdr->vertices[1].position, shdr->vertices[2].position}};
pos_mat = mat3x3_transpose(pos_mat);
V3f position = mat3x3_mul_vec3(pos_mat, (*barycentric));
V3f position = mat3x3_mul_vec3(pos_mat, (*barycentric));
V4f output = {.r = position.z, .g = position.z, .b = position.z, .a = 255};
V4f output = {.r = position.z, .g = position.z, .b = position.z, .a = 255};
return (FragmentResult){.colour = output};
}

View File

@ -7,7 +7,7 @@
typedef struct depth_shader DepthShader;
struct depth_shader {
#include "shader_base.inc"
#include "shader_base.inc"
};
VertexData depth_shader_vertex(void *shader, const VertexData *vert, u8 index, const Model *model);

View File

@ -6,7 +6,8 @@
typedef struct shader Shader;
struct shader {
#include "shader_base.inc"
#include "shader_base.inc"
M4x4f shadow_matrix;
};
VertexData general_shader_vertex(void *shader, const VertexData *vert, u8 index, const Model *model);