Skip to content

Commit

Permalink
Make sky background static relative to camera.
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-graj committed Mar 26, 2023
1 parent 16d32e0 commit 4e63600
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/entity/sky.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Wojciech Graj
* Copyright (c) 2022-2023 Wojciech Graj
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -58,7 +58,7 @@ void sky_init(void)
vao_init(&vao);
idx_obj_init(&obj);
model_init(&model, &obj);
glm_scale_make(model.scl, (vec3){ 50.f, 50.f, 50.f });
glm_scale_make(model.scl, (vec3){ 70.f, 70.f, 70.f });
model_transform(&model);

shader_init(&shader, res_shader_sky_vert, res_shader_sky_vert_len, res_shader_sky_frag, res_shader_sky_frag_len, 2, (struct ShaderAttr[]){
Expand Down Expand Up @@ -86,6 +86,8 @@ void sky_render(void)
bo_bind(&obj.vbo_faces);
texture_bind(&texture);

glm_translate_make(model.trans, e_camera.pos);
model_transform(&model);
mat4 transform;
camera_mvp_generate(&e_camera, &model.model_mat, transform);

Expand Down

0 comments on commit 4e63600

Please sign in to comment.