polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

commit 8cca4e9e69c9fe169ed6575aa164e5f6afe81cf3
parent da29bf4d4253079fef40b45c3b72464c7d44775c
Author: William Casarin <bill@casarin.me>
Date:   Thu,  2 Jul 2015 21:42:54 -0700

fix up some values

Diffstat:
Metc/shaders/test.v.glsl | 2+-
Msrc/game.c | 2+-
Msrc/render.c | 2+-
Msrc/slab_geom.c | 6+++---
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/etc/shaders/test.v.glsl b/etc/shaders/test.v.glsl @@ -12,6 +12,6 @@ uniform vec3 light_dir; void main() { vec4 trans_normal = normal_matrix * vec4(normal, 1); - gl_Position = mvp * vec4(position.xyz, 1.0); + gl_Position = mvp * vec4(position.xyz / 10., 1.0); v_dot = max(dot(trans_normal.xyz, light_dir), 0.4); } diff --git a/src/game.c b/src/game.c @@ -9,5 +9,5 @@ void init_game(struct game_state *game) { mat4_id(normal); // move the camera a bit - mat4_translate(mvp, -10.0f, -10.0f, -40.0f, mvp); + mat4_translate(mvp, -1.0f, -1.0f, -10.0f, mvp); } diff --git a/src/render.c b/src/render.c @@ -97,7 +97,7 @@ init_gl(struct resources *resources) { assert(resources->fragment_shader != 0); // camera - mat4_perspective(80 /* fov */, 1080 / 720, 1, 1000, resources->camera); + mat4_perspective(90 /* fov */, 1080 / 720, 1, 1000, resources->camera); // Shader program resources->program = make_program(resources->vertex_shader, diff --git a/src/slab_geom.c b/src/slab_geom.c @@ -23,9 +23,9 @@ slab_alloc_arrays(const struct slab *slab, vert_per_side, verts_allocd ); - verts = malloc(verts_allocd * 2); - normals = malloc(verts_allocd * 2); - indices = malloc((size_t)num_verts * sizeof(u32) * 2); + verts = malloc(verts_allocd); + normals = malloc(verts_allocd); + indices = malloc((size_t)num_verts * sizeof(u32)); assert(verts); assert(normals);