diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-06-18 22:31:03 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-06-18 22:31:03 +1000 |
commit | 259da84075c62c2ab96c7cb922df2000ebefb735 (patch) | |
tree | 423106dd69711794a4d5b3d1f5031a65960d186d /examples | |
parent | b2c9782ab2f4abec8f8548e667a8f2ad6e36bd4b (diff) |
pbr progress
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pbr_textured/ex_pbr_textured.c | 10 | ||||
-rw-r--r-- | examples/shadow_maps/ex_shadow_maps.c | 0 |
2 files changed, 8 insertions, 2 deletions
diff --git a/examples/pbr_textured/ex_pbr_textured.c b/examples/pbr_textured/ex_pbr_textured.c index 8c48b8d..fa1d555 100644 --- a/examples/pbr_textured/ex_pbr_textured.c +++ b/examples/pbr_textured/ex_pbr_textured.c @@ -37,7 +37,7 @@ int main() { point_lights[i].color = vec3(300.0, 300.0, 300.0); } - vec3 camera_pos = vec3(5., 0., 0.); + vec3 camera_pos = vec3(3., 2., 0.); vec3 camera_front = vec3_normalise(vec3_negate(camera_pos)); camera cam = camera_create(camera_pos, camera_front, VEC3_NEG_Z, deg_to_rad(45.0)); @@ -82,6 +82,8 @@ int main() { pbr_textured_bindgroup pbr_bind_data; + static f32 theta = 0.0; + while (!should_exit()) { input_update(&g_core.input); @@ -95,7 +97,11 @@ int main() { encode_bind_pipeline(enc, PIPELINE_GRAPHICS, pbr_pipeline); encode_set_default_settings(enc); - mat4 model_affine = mat4_ident(); + theta += 0.01; + transform transform = { .position = vec3(0,0,0), + .rotation = quat_from_axis_angle(VEC3_Z, theta, true), + .scale = 1.0 }; + mat4 model_affine = transform_to_mat(&transform); mat4 view, proj; camera_view_projection(&cam, 1000, 1000, &view, &proj); diff --git a/examples/shadow_maps/ex_shadow_maps.c b/examples/shadow_maps/ex_shadow_maps.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/examples/shadow_maps/ex_shadow_maps.c |