moonshine

所属分类:GPU/显卡
开发工具:Zig
文件大小:343KB
下载次数:0
上传日期:2023-05-09 01:30:48
上 传 者sh-1993
说明:  用Zig+Vulkan构建的通用光线跟踪渲染器
(A general purpose ray traced renderer built with Zig + Vulkan)

文件列表:
moonshine-trunk (0, 2023-08-29)
moonshine-trunk\COPYING (34523, 2023-08-29)
moonshine-trunk\assets (0, 2023-08-29)
moonshine-trunk\assets\sphere_external.glb (24572, 2023-08-29)
moonshine-trunk\assets\sphere_internal.glb (24696, 2023-08-29)
moonshine-trunk\build.zig (19102, 2023-08-29)
moonshine-trunk\deps (0, 2023-08-29)
moonshine-trunk\deps\cimgui (0, 2023-08-29)
moonshine-trunk\deps\glfw (0, 2023-08-29)
moonshine-trunk\deps\tinyexr (0, 2023-08-29)
moonshine-trunk\deps\vk.xml (1960680, 2023-08-29)
moonshine-trunk\deps\vulkan-zig (0, 2023-08-29)
moonshine-trunk\deps\zgltf (0, 2023-08-29)
moonshine-trunk\deps\zigimg (0, 2023-08-29)
moonshine-trunk\engine (0, 2023-08-29)
moonshine-trunk\engine\Window.zig (5843, 2023-08-29)
moonshine-trunk\engine\c.zig (1212, 2023-08-29)
moonshine-trunk\engine\core (0, 2023-08-29)
moonshine-trunk\engine\core\Allocator.zig (6887, 2023-08-29)
moonshine-trunk\engine\core\Commands.zig (12493, 2023-08-29)
moonshine-trunk\engine\core\DestructionQueue.zig (1853, 2023-08-29)
moonshine-trunk\engine\core\Film.zig (3294, 2023-08-29)
moonshine-trunk\engine\core\ImageManager.zig (8463, 2023-08-29)
moonshine-trunk\engine\core\SyncCopier.zig (4821, 2023-08-29)
moonshine-trunk\engine\core\VulkanContext.zig (15792, 2023-08-29)
moonshine-trunk\engine\core\core.zig (474, 2023-08-29)
moonshine-trunk\engine\core\descriptor.zig (3171, 2023-08-29)
moonshine-trunk\engine\core\vk_helpers.zig (6435, 2023-08-29)
moonshine-trunk\engine\displaysystem (0, 2023-08-29)
moonshine-trunk\engine\displaysystem\Display.zig (8661, 2023-08-29)
moonshine-trunk\engine\displaysystem\Swapchain.zig (6320, 2023-08-29)
moonshine-trunk\engine\displaysystem\displaysystem.zig (1058, 2023-08-29)
moonshine-trunk\engine\engine.zig (394, 2023-08-29)
... ...

# Moonshine **A general purpose GPU ray traced renderer built with Zig + Vulkan**
[![A bathroom scene rendered with moonshine](https://repository-images.githubusercontent.com/378788480/b9ad3836-4558-43f6-82ed-6668d99399b4)](https://blendswap.com/blend/12584) *Salle de bain by nacimus, rendered with Moonshine* ### Features * Binaries * offline -- a headless offline renderer * online -- a real-time windowed renderer, interactive features WIP * Light Transport * Global Illumination * Direct light sampling with multiple importance sampling for all lights and materials * Lights * 360° environment maps * Emissive meshes * Materials * Standard PBR with metallic + roughness * Mirror * Glass ### Dependencies #### Build * zig `0.12.0-dev.168+a31748b29` * DirectXShaderCompiler * For the online (real-time) renderer: * For Linux (Ubuntu, similar on others): * For Wayland: `wayland-protocols` `libwayland-dev` `libxkbcommon-dev` * For X11: `libxcursor-dev` `libxrandr-dev` `libxinerama-dev` `libxi-dev` * Should work on Windows without more dependencies #### Run * A GPU supporting Vulkan ray tracing ### // TODO * Feature * Bloom * Tonemapping * HDR display * More camera models * Orthographic * Materials * Metal * Rough metal * Rough glass * Plastic * Rough plastic * Mix * Layer * Code * Make sure we have all necessary `errdefer`s * Proper memory allocation interface * Reduce unnecessary copying ### Current jankiness * Asset system * Currently, one can either construct a scene manually with code or very inefficiently import glb * Ideal would be to have custom scene description format that can be quickly deserialzed * An Blender export addon for this format, so other formats don't need to be supported in engine directly * I think this custom format would make destinctions between scene stuff and staging stuff. It would only contain actual information about the world, but not stuff like camera position, that would be separate * Light system * Currently, only support skybox and mesh lights, which I think makes sense * Both explicitly sampled using the alias method built on CPU * But we'd like to have more dynamic meshes, which means we should mesh sampling build sampling stuff on GPU * Not sure about proper route -- build inversion sampler on GPU in compute? * Memory management * A lot of unncessary copying in scene construction at the moment * Filesystem to RAM * RAM to staging buffer * Staging buffer to GPU * Ideally this can be vastly minimized, depending on hardware * At most should be doing filesystem to staging buffer * On some machines, can do filesystem to GPU directly * Destruction queue needs work ### Some notes about conventions * `+z` is up * phi is azimuthal angle (0-2pi) and theta is polar angle (0-pi) ### Some light reading - [Importance sampling](https://computergraphics.stackexchange.com/q/4979) - [Explicit light sampling](https://computergraphics.stackexchange.com/q/5152) - [Multiple importance sampling](https://graphics.stanford.edu/courses/cs348b-03/papers/veach-chapter9.pdf) - [Microfacets](https://agraphicsguy.wordpress.com/2015/11/01/sampling-microfacet-brdf/) - [Actual materials](https://github.com/wdas/brdf) - ton of BRDF examples, in **CODE**! - [Better sky](https://sebh.github.io/publications/egsr2020.pdf) ### License This project is licensed under the AGPL.

近期下载者

相关文件


收藏者