norman784 / gaiku

3d agnostic framework (game engine) terrain engine
40 stars 1 forks source link

Amethyst based code and example #5

Closed QuantumEntangledAndy closed 3 years ago

QuantumEntangledAndy commented 3 years ago

Intro

As mentioned in #4 this is the amethyst based code I am using with an example too. Everything will be black in the example without the normals code in #4 so please merge that first :)

New code

It adds to the gaiku-amethyst a module named mesher which has the function to_amethyst_mesh this function takes as input a gaiku mesh and generates an amethyst MeshData which can then be used to build an amethyst Entity.

New examples

The rest of the code is all geared towards making an amethyst example (Amethyst requires a lot of setup so theres a lot in there fo that). Amethyst uses the coordinate system where y is up but your goxel examples use z as up so the example converts to this coordinate system before sending it to the new to_amethyst_mesh function.

QuantumEntangledAndy commented 3 years ago

If the normal branch is merged first the example has a working light. (you need normals for the light shading). The issue with the rotation is that goxel source is z up but amethyst is y up. The example should do the rotation for us.

QuantumEntangledAndy commented 3 years ago

Are you seeing something different. Because it would be odd if your goxel was already rotated?

Please try the light after normals are merged if it's still not working than I need to check to see if I have forgotten to move some code over from my Dev branch.

norman784 commented 3 years ago

Yeah, I tested in your branch, now I tested with both PR's merged and works, but there's an issue when running vulkan in arch linux. Tested with nightly (1.50) and stable (1.48) with the same issue, it works until I move the mouse over the amethyst window, so maybe it's something related to the camera angle and the mouse.

[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.15.3
[INFO][amethyst::app] Platform: x86_64-unknown-linux-gnu
[INFO][amethyst::app] Amethyst git commit: UNKNOWN
[INFO][amethyst::app] Rustc version: 1.50.0-nightly Nightly
[INFO][amethyst::app] Rustc git commit: 0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
[INFO][winit::platform::platform::x11::window] Guessed window DPI factor: 1.1666666666666667
[WARN][gfx_backend_vulkan] Unable to find extension: VK_KHR_wayland_surface
[WARN][gfx_backend_vulkan] Unable to find layer: VK_LAYER_LUNARG_standard_validation
[WARN][rendy_factory::factory] Slow safety checks are enabled! Disable them in production by enabling the 'no-slow-safety-checks' feature!
[INFO][rendy_util::wrap] Slow safety checks are enabled! You can disable them in production by enabling the 'no-slow-safety-checks' feature!
thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:659:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(15616) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(13568) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1536) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(18944) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(18432) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(7936) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(38144) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(27392) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(256) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(17664) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(15104) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(29696) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(10752) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(51456) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(24576) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(65536) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(9216) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(6400) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1280) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2816) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(9472) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(5120) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2560) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(35072) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4608) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(28928) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(5632) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(11264) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(26112) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(5376) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(13312) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(7680) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(3328) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(19200) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(17408) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(8448) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2097152) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(19968) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(20736) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(20224) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(17152) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(16384) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(10496) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1024) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2304) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(14592) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(18688) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(3584) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(13824) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(17920) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(104448) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(14080) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(25344) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(32768) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(26368) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(3072) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(30720) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(3840) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4096) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(11776) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(9728) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(20992) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(6656) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(512) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(28672) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(262144) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(8960) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1792) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4194304) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(131072) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(57600) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2048) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(6144) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(7424) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(15360) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(31232) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(14336) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(37632) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(8192) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(8704) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(22528) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(26880) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(15872) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(6912) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(12032) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(36864) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(27136) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(18176) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(16896) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(16640) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(9984) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1048576) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(16128) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(30208) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(23808) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(12544) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(21760) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(524288) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4864) is still used
[ERROR][rendy_memory::allocator::dedicated] Not all allocation from DedicatedAllocator was freed
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(262144) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(256) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(131072) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1048576) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(16384) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2048) is still used
[ERROR][rendy_descriptor::allocator] Not all descriptor sets were deallocated
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 58, freed: 0 }
[ERROR][rendy_descriptor::allocator] Not all descriptor sets were deallocated
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 0, freed: 0 }
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 0, freed: 0 }
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 128, free: 125, freed: 0 }
[ERROR][rendy_descriptor::allocator] Not all descriptor sets were deallocated
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 55, freed: 0 }
[ERROR][rendy_descriptor::allocator] Not all descriptor sets were deallocated
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 58, freed: 0 }
[ERROR][rendy_descriptor::allocator] Not all descriptor sets were deallocated
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 62, freed: 0 }
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
QuantumEntangledAndy commented 3 years ago

The vulkan issue is an upstream one here I think