work on improving level editing and camera
This commit is contained in:
parent
a5c617d2e4
commit
69e3dd26dc
1
TODO.txt
1
TODO.txt
@ -4,4 +4,5 @@ Engine todo list:
|
||||
- Sokol should be fully under a platform abstraction layer but it's not,
|
||||
currently it's fine but it would be really nice to be able to have a metal, vulkan
|
||||
webgpu backends at some point for the longevity of the engine.
|
||||
- Backend sokol has a global named camera taking up the name which is fucking crazy.
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
_______________
|
||||
Vulkan Version:
|
||||
- available: 1.4.309
|
||||
- available: 1.3.296
|
||||
- requesting: 1.3.0
|
||||
______________________
|
||||
Used Instance Layers :
|
||||
@ -8,15 +8,17 @@ VK_LAYER_KHRONOS_validation
|
||||
|
||||
Used Instance Extensions :
|
||||
____________________
|
||||
Devices : 1
|
||||
0: AMD Radeon RX 6950 XT
|
||||
Devices : 2
|
||||
0: AMD Radeon RX 6700 XT (RADV NAVI22)
|
||||
- Compatible
|
||||
Compatible physical devices found : 1
|
||||
1: llvmpipe (LLVM 20.1.2, 256 bits)
|
||||
- Compatible
|
||||
Compatible physical devices found : 2
|
||||
Using Device:
|
||||
- Device Name : AMD Radeon RX 6950 XT
|
||||
- Device Name : AMD Radeon RX 6700 XT (RADV NAVI22)
|
||||
- Vendor : AMD
|
||||
- Driver Version : 2.0.341
|
||||
- API Version : 1.4.308
|
||||
- Driver Version : 25.2.8
|
||||
- API Version : 1.4.318
|
||||
- Device Type : Discrete GPU
|
||||
________________________
|
||||
Used Device Extensions :
|
||||
@ -24,4 +26,33 @@ VK_KHR_deferred_host_operations
|
||||
VK_KHR_acceleration_structure
|
||||
VK_KHR_ray_query
|
||||
|
||||
BLAS Compaction: 1.8MB -> 0.6MB (1.2MB saved, 65.9% smaller)
|
||||
BLAS Compaction: 0.3MB -> 0.2MB (0.1MB saved, 31.9% smaller)
|
||||
_______________
|
||||
Vulkan Version:
|
||||
- available: 1.3.296
|
||||
- requesting: 1.3.0
|
||||
______________________
|
||||
Used Instance Layers :
|
||||
VK_LAYER_KHRONOS_validation
|
||||
|
||||
Used Instance Extensions :
|
||||
____________________
|
||||
Devices : 2
|
||||
0: AMD Radeon RX 6700 XT (RADV NAVI22)
|
||||
- Compatible
|
||||
1: llvmpipe (LLVM 20.1.2, 256 bits)
|
||||
- Compatible
|
||||
Compatible physical devices found : 2
|
||||
Using Device:
|
||||
- Device Name : AMD Radeon RX 6700 XT (RADV NAVI22)
|
||||
- Vendor : AMD
|
||||
- Driver Version : 25.2.8
|
||||
- API Version : 1.4.318
|
||||
- Device Type : Discrete GPU
|
||||
________________________
|
||||
Used Device Extensions :
|
||||
VK_KHR_deferred_host_operations
|
||||
VK_KHR_acceleration_structure
|
||||
VK_KHR_ray_query
|
||||
|
||||
BLAS Compaction: 0.3MB -> 0.2MB (0.1MB saved, 31.9% smaller)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
master_volume 0.276042
|
||||
music_volume 0
|
||||
sfx_volume 1
|
||||
fullscreen 0
|
||||
fullscreen 1
|
||||
|
||||
@ -78,7 +78,10 @@ draw_editor_ui :: (theme: *GR.Overall_Theme) {
|
||||
|
||||
draw_editor :: () {
|
||||
#if OS != .WASM {
|
||||
disable_dof_post_process = false;
|
||||
if !in_editor_view then return;
|
||||
disable_dof_post_process = true;
|
||||
|
||||
|
||||
if current_editor_view == {
|
||||
case .Trile_Editor;
|
||||
@ -107,10 +110,8 @@ tick_editor_ui :: () {
|
||||
|
||||
#if OS != .WASM {
|
||||
if in_editor_view {
|
||||
disable_dof_post_process = false;
|
||||
if current_editor_view == {
|
||||
case .Trile_Editor;
|
||||
disable_dof_post_process = true;
|
||||
tick_trile_editor();
|
||||
case .Level_Editor;
|
||||
tick_level_editor();
|
||||
|
||||
@ -646,15 +646,17 @@ create_level_editor_preview_tasks :: () {
|
||||
name, orientation, found := get_trile_at(*curworld.world, xx px, xx py, xx pz);
|
||||
cursor_trile := ifx found then name else (ifx editor_current_trile then editor_current_trile.name else "");
|
||||
if cursor_trile != "" {
|
||||
ck := world_to_chunk_coord(xx px, xx py, xx pz);
|
||||
lx, ly, lz := world_to_local(xx px, xx py, xx pz);
|
||||
positions: [..]Trile_Instance;
|
||||
positions.allocator = temp;
|
||||
array_add(*positions, Trile_Instance.{xx (px % 32), xx (py % 32), xx (pz % 32), xx orientation});
|
||||
array_add(*positions, Trile_Instance.{lx, ly, lz, xx orientation});
|
||||
task: Rendering_Task_Trile;
|
||||
task.trile = cursor_trile;
|
||||
task.positions = positions;
|
||||
task.worldConf = *curworld.world.conf;
|
||||
task.preview_mode = 1;
|
||||
task.chunk_key = world_to_chunk_coord(xx px, xx py, xx pz);
|
||||
task.chunk_key = ck;
|
||||
add_rendering_task(task);
|
||||
}
|
||||
return;
|
||||
@ -664,7 +666,8 @@ create_level_editor_preview_tasks :: () {
|
||||
|
||||
positions: [..]Vector4;
|
||||
positions.allocator = temp;
|
||||
ori := cast(float) get_current_orientation();
|
||||
ori_u8 := get_current_orientation();
|
||||
ori := cast(float) ori_u8;
|
||||
|
||||
if current_tool_mode == .POINT {
|
||||
array_add(*positions, .{cast(float)px, cast(float)py, cast(float)pz, ori});
|
||||
@ -720,12 +723,37 @@ create_level_editor_preview_tasks :: () {
|
||||
is_delete := (current_tool_mode == .AREA && area_active && area_delete)
|
||||
|| (current_tool_mode == .LINE && line_active && line_delete);
|
||||
|
||||
chunk_groups: [..] struct { key: Chunk_Key; instances: [..]Trile_Instance; };
|
||||
chunk_groups.allocator = temp;
|
||||
for pos : positions {
|
||||
wx := cast(s32) pos.x; wy := cast(s32) pos.y; wz := cast(s32) pos.z;
|
||||
ck := world_to_chunk_coord(wx, wy, wz);
|
||||
lx, ly, lz := world_to_local(wx, wy, wz);
|
||||
found := false;
|
||||
for *grp : chunk_groups {
|
||||
if grp.key == ck {
|
||||
array_add(*grp.instances, Trile_Instance.{lx, ly, lz, ori_u8});
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
instances: [..]Trile_Instance;
|
||||
instances.allocator = temp;
|
||||
array_add(*instances, Trile_Instance.{lx, ly, lz, ori_u8});
|
||||
array_add(*chunk_groups, .{ck, instances});
|
||||
}
|
||||
}
|
||||
|
||||
for grp : chunk_groups {
|
||||
task: Rendering_Task_Trile;
|
||||
task.trile = editor_current_trile.name;
|
||||
// task.positions = positions;
|
||||
task.positions = grp.instances;
|
||||
task.worldConf = *curworld.world.conf;
|
||||
task.chunk_key = grp.key;
|
||||
task.preview_mode = ifx is_delete then cast(s32)2 else cast(s32)1;
|
||||
add_rendering_task(task);
|
||||
}
|
||||
}
|
||||
|
||||
get_trile_at :: (world: *World, wx: s32, wy: s32, wz: s32) -> (name: string, orientation: u8, found: bool) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Camera :: struct {
|
||||
fov : float = 75.0 * 3.141 / 180.0;
|
||||
near : float = 1.0;
|
||||
far : float = 20.0;
|
||||
near : float = 0.5;
|
||||
far : float = 2000.0;
|
||||
position : Vector3 = .{2, 2, 2};
|
||||
target : Vector3 = .{0, 0, 0};
|
||||
}
|
||||
|
||||
@ -329,6 +329,19 @@ recompute_buried_at_cell :: (world: *World, wx: s32, wy: s32, wz: s32) {
|
||||
}
|
||||
}
|
||||
|
||||
get_note_locations :: (note : string) -> []Vector3 {
|
||||
result: [..]Vector3;
|
||||
print("Looking for notes %\n", current_world.world.name);
|
||||
for n: current_world.world.notes {
|
||||
print("COMP: % %\n", n.text, note);
|
||||
if n.text == note {
|
||||
v: Vector3 = .{cast(float)n.position.x, cast(float)n.position.y, cast(float)n.position.z};
|
||||
array_add(*result, v);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
invalidate_buried_around :: (world: *World, wx: s32, wy: s32, wz: s32) {
|
||||
recompute_buried_at_cell(world, wx, wy, wz);
|
||||
for axis: 0..5 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user