island

授权协议 MIT License
开发语言 C/C++
所属分类 程序开发、 图形/图像处理
软件类型 开源软件
地区 不详
投 递 者 王君墨
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Project Island �� ��

Project Island is an experimental Vulkan renderer/proto-engine forLinux and Windows, written in C/C++.

Island is written for rapid protoyping and tweaking. That's why itallows hot-reloading wherever possible: for C/C++ applicationcode, GLSL or HLSL shader code, even the renderer's own coremodules.

Each module aims to be strictly isolated, which makes the codebasefast to compile, especially in parallel.

C/C++ CI

Main Features:

  • Hot-reloading: An Island project is made from isolated c/cppmodules, each of which can be tweaked, re-compiled at runtime, andautomatically hot-reloaded.

  • Shader Hot-reloading: Island supports shader code hot-reloadingfor HLSL, GLSL, or SPIR-V shader source files. Shader files areautomatically watched, and any change triggers a recompile, with(Vulkan) pipelines automatically rebuilt if needed. HLSL/GLSLShaders may use #include directives. Error messages (if any) willpoint at shader file and line number, and include a brief listingwith problematic lines highlighted in context.

  • Fast compile times: Because of Island's modular architecture,a recompilation & reload cycle typically takes less than 1 second,while the application keeps running. Compiling the whole codebasefrom scratch should take less than 5 seconds when using LLVM on anaverage multi-core machine.

  • Code tweaks: Near-instant in-code parameter tweaks for Debugbuilds (no need to recompile) by using a special TWEAK() macro.

  • Vulkan backend: Island has a Vulkan rendering backend, which, onLinux, allows access to new and experimental GPU features soon afterthey are released. The renderer takes care of most of thebureaucracy which comes with modern APIs: Vulkan resources areautomatically synchronised, and only allocated when needed. Mostresource properties are inferred automatically based on thecontext of how the resource is being used. Pipelines are compiledand recompiled on demand. When compiled in Debug mode, Vulkanvalidation layers are loaded by default.

  • Rendergraph- based Architecture: Rendering is structured usingrenderpasses. Renderpasses are executed on-demand and synchronisedautomatically by evaluating a rendergraph. If a renderpass isdetected to have no effect on the final image, it is automaticallypruned. For Debug targets, the rendergraph generates .dot files,which can be drawn using graphviz.

  • Static release binaries: While Island is highly modular anddynamic when compiled for Debug, it can compile into a single,optimised static binary for Release.

  • Multi-Window Island allows you to hook up multiple swapchains toa single application. This is particularly useful for multi-windowscenarios. See example

  • Straight to video: Island can render straight to screen usingthe direct rendering swapchain, or use any number of availableoptions for a window-based vulkan swapchain. It's also easy torender straight to an mp4 file, or an image sequence without showinga window, by selecting the appropriate le_swapchainspecialisation.

  • Helpers: minimal effort to enable multisampling, import images,fonts

  • 2d drawing context: Draw thick lines and curves usingle_paths, which specialises in 2d meshes. This module implementsa useful subset of the SVG command palette, and includes some extraslike for example a command to smoothen open or closed Bézier curvesby applying the Hobby algorithm. Thick Bézier curves aredrawn using an algorithm outlined by T. F. Hain.

  • glTF Island wraps cgltf for gltf file import, andthe le_stage module can display and render most features found ingltf 2.0 files: pbrt materials, vertex animations, morph targetanimations, and skinning animations.

  • Job-system: Cooperatively parallel workloads can be implementedusing the le_jobs module, which implements a job system usingcoroutine-like fibers. Both backend and render modules are designedto minimise resource contention.

  • GPU ray tracing Island supports RTX via the Khronos Vulkanraytracing extensions. Creating acceleration structures and shaderbinding tables is automated and simplified as much as possible. Raytracing shaders can be hot-reloaded.

  • GPU mesh shaders gives you - optional - access toNvidia-specific extensions for mesh and task shaders. These can beused in regular graphics pipelines.

Tools

Examples (more examples)

Island comes with a number of examples. No collection of exampleswould be complete without a hellotriangle example, and a helloworld example.

A full list of examples can be found here. More examples to come.

Modules

Island projects can be built by combining any number of islandmodules. Each module aims to do one thing well, and to play nicewith others. Modules are automatically hot-reloaded, if a change isdetected and hot-reloading is active. Some modules provide theirfunctionality by wrapping well-known external libraries, some arewritten entirely from scratch. Some of the most useful modules arelisted here:

Module Wraps Description
le_camera - interactive, mouse controlled camera
le_path - draw svg-style paths, parse simplified SVG-style path command lists
le_tessellator earcut, libtess tessellation; dynamic choice of tessellation backend
le_imgui imgui graphical user interface
le_pixels stb image load image files
le_font stb truetype truetype glyph sdf, geometry and texture atlas based typesetting
le_pipeline_builder - build graphics, and compute pipelines
le_rtx_pipeline_builder - build Khronos RTX raytracing pipelines
le_2d - simplified 2d drawing context
le_gltf cgltf load and parse glTF 2.0 files
le_stage - render 3d scenes, display animations
le_timebase - timekeeping, canonical clock for animations
le_jobs - fiber-based job system
le_ecs - entity-component-system
le_shader_compiler shaderc compile glsl shaders to SPIR-V
le_window glfw window i/o system
le_swapchain - windowed, direct, or straight-to-video output
le_renderer - record command buffers, evaluate rendergraphs
le_backend - interact with GPU via Vulkan, manage GPU resources

To use a module, name it as a dependency in your applidation module'sCMakeLists.txt file; modules may depend on other modules, and the buildsystem will automatically include these dependencies. You can write your ownmodules - and there is a module template generator whichprovides you with a scaffold to start from.

Installation instructions

Island should run out of the box on a modern Linux system with thecurrent Vulkan SDK and build tools installed. For Windows, buildinstructions are collected in a separate readme.

Depencencies

Island depends on a few common development tools: CMake, gcc, git,ninja. These are commonly found on a development machine. Island alsodepends on the Vulkan SDK.

Install Vulkan SDK

Vulkan SDK >= 1.2.175

I recommend to install the latest Vulkan SDK via a package manager.Follow the installation instructions via:https://vulkan.lunarg.com/sdk/home#linux.

Arch Linux (Manjaro)

On Arch Linux, I recommend installing the following packages viapacman: shaderc vulkan-devel ninja cmake.

Building an Island project

�� If you freshly cloned the Island repository, remember to updatesubmodules before proceeding. ��

git submodule init
git submodule update --depth=1

Then move to the directory of the Island project which you want tocompile:

cd apps/examples/hello_triangle/

Build using CMake:

mkdir build
cd build
cmake -G Ninja ..
ninja

Run your new Island Application:

./Island-HelloTriangle

Note: The CMAKE parameter PLUGINS_DYNAMIC lets you choose whether tocompile Island as a static binary, or as a thin module with dynamic plugins.Unless you change this parameter, Debug builds will be built thin/dynamic withhot-reloading enabled, and Release builds will produce a single static binarywith hot-reloading disabled.

IDE support

I recommend using the freely available QT Creator IDE, it allowsyou to directly open CMake project files, and integrates pretty seamlessly withthe Island workflow: running, hot-reloading, then setting a breakpoint, andthen stepping whilst inspecting state in the debugger just works. AlternativeIDEs are of course available, and as long as they support CMake project files,should work. When running an Island app with the debugger in Qt Creator, it'simportant to check that Run in terminal is disabled - this can bespecified in the Run Settings dialog.

Auto-recompilation on save using entr

If you prefer to work without an IDE, but wish a setup where apps getrecompiled as soon as a source file changes, the following Linux-basedsetup is pretty nice:

cd apps/examples/hello_triangle
    mkdir build
    cd build
    cmake -G Ninja ..
    # and then 
    git ls-files ../.. | entr ninja &

entr(1) is a great utility, which runs a command on file change. Thelast line of the above script causes ninja to run as soon as any ofthe files checked into the github repo at hello_triangle change.

Windows 10 support

Island can compile and run natively on Microsoft Windows - with somecaveats. Progress of the Windows port and Windows-specific buildinstructions etc. are tracked in a separate readme.

Caveats

Note The API is under active development, expect lots of change.As such, there are no promises that it might be ready or fit for anypurpose, and the code here is released in the hope that you might findit interesting.

The initial motivation for writing Island was to experiment witha modern rendering API (Vulkan), to learn by trying out ideas aroundmodern realtime-rendering, and to have a framework to create visualexperiments with.

Acknowledgements

I would like to thank the folks at our machinery fortheir wonderful blog posts on engine architecture and hotreloading, these were a big initial inspiration for this project.

 相关资料
  • Source hihoCoder Problem 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 There are N islands on a planet whose coordinates are (X1, Y1), (X2, Y2), (X3, Y3) ..., (XN, YN). You starts at the 1st island (X1, Y1)

  • 问题内容: 我正试图从我的一些图像中去除背景噪音。这就是未过滤图像。 当我从原始图像中屏蔽掉不需要的像素时 形象,我得到的是正如你所看到的,中间区域的所有小点都消失了,但是很多 那些来自人口密集地区的人也不见了。为了减少过滤,我 已尝试将“getStructuringElement()”的第二个参数更改为(1,1) 但是这样做给了我第一个图像,好像什么都没有被过滤过。 有什么方法可以在这两个之间加

  • 问题内容: 我有一个这样的示例表: 像这样的一些样本数据 我需要按日期顺序和vKey / DKey组合对数据进行分组,并像这样显示 最好的方法是什么? 提前致谢 问题答案: Select vKey ,dKey ,StartTrip = min(StartTrip) ,EndTrip = max(EndTrip) ,Distance = sum(Distance) From ( Select * ,

  • 我在leetcode#695遇到了一些问题。我不明白为什么我的代码会出现溢出结果。这是我的c代码。我想请你帮我指出我犯的错误。谢谢。 问题: 给出了一个mxn二元矩阵网格。岛屿是一组1(代表陆地)以4个方向(水平或垂直)相连你可以假设网格的四个边缘都被水包围。 孤岛的面积是孤岛中值为1的单元格的数量。 返回网格中岛屿的最大面积。如果没有孤岛,则返回0 问题链接 输入是 1.0,0,0 0,0 0,

相关阅读

相关文章

相关问答

相关文档