add a new post-processing view

This commit is contained in:
Tuomas Katajisto 2025-10-09 21:22:31 +03:00
parent 966513a64d
commit 6b93d08209
4 changed files with 44 additions and 8 deletions

View File

@ -31,10 +31,6 @@ game_tick :: () {
}
game_draw :: () {
camtask := Rendering_Task_Set_Camera.{type = .SET_CAMERA, camera = cam};
add_rendering_task(camtask);
skytask := Rendering_Task_Sky.{type = .SKY, worldConfig = *world.conf};
add_rendering_task(skytask);
groundtask := Rendering_Task_Ground.{type = .GROUND, world = *world};
add_rendering_task(groundtask);
create_set_cam_rendering_task(cam);
create_world_rendering_tasks(*world);
}

View File

@ -1,4 +1,5 @@
#load "console.jai";
#load "postprocess.jai";
#load "trile_editor.jai";
#load "level_editor.jai";
#load "iprof.jai";
@ -15,6 +16,7 @@ Editor_View :: enum {
Closed_Editor;
Trile_Editor;
Level_Editor;
Post_Process_Editor;
};
current_editor_view : Editor_View = .Trile_Editor;
@ -49,12 +51,18 @@ draw_editor_ui :: (theme: *GR.Overall_Theme) {
if GR.button(r, "Trile editor", *t_button_selectable(theme, current_editor_view == .Trile_Editor))
then current_editor_view = .Trile_Editor;
r.x -= r.w;
if GR.button(r, "Post-process", *t_button_selectable(theme, current_editor_view == .Post_Process_Editor))
then current_editor_view = .Post_Process_Editor;
if current_editor_view == {
case .Trile_Editor;
draw_trile_editor_ui(theme);
case .Level_Editor;
draw_level_editor_ui(theme);
case .Post_Process_Editor;
draw_post_process_editor_ui(theme);
}
}
draw_console(theme);
@ -72,6 +80,8 @@ draw_editor :: () {
draw_trile_editor();
case .Level_Editor;
draw_level_editor();
case .Post_Process_Editor;
draw_post_process_editor();
}
}
@ -87,6 +97,8 @@ tick_editor_ui :: () {
tick_trile_editor();
case .Level_Editor;
tick_level_editor();
case .Post_Process_Editor;
tick_post_process_editor();
}
}

View File

@ -0,0 +1,28 @@
#scope_file
world : World; // @ToDo: Actually load the world from somewhere once we have actual world management.
get_post_processing_camera :: () -> Camera {
camera : Camera;
camera.target = Vector3.{0,0,0};
camera.position = Vector3.{5,5,5};
camera.near = 1.0;
camera.far = 2000.0;
return camera;
}
#scope_export
tick_post_process_editor :: () {
}
draw_post_process_editor :: () {
create_set_cam_rendering_task(get_post_processing_camera());
create_world_rendering_tasks(*world);
}
draw_post_process_editor_ui :: (theme: *GR.Overall_Theme) {
}

View File

@ -51,6 +51,6 @@ get_low_res :: (width: s32, height: s32, max_dimension: s32 = 720) -> (s32, s32)
get_render_size :: () -> (s32, s32) {
w,h := get_window_size();
wl, hl := get_low_res(w,h, 360);
return wl, hl;
// wl, hl := get_low_res(w,h, 360);
return w, h;
}