Coder Social home page Coder Social logo

vulkan's Introduction

Lucre

A Vulkan Render Engine




Features:

  • A Vulkan renderer with support for 2D and 3D scenes
  • Support for 3D file formats Obj Wavefront, glTF, and FBX
  • Physically-based rendering (PBR), materials based on Blender's roughness-metallic workflow, normal mapping
  • Point lights, directional lights with shadows, and deferred shading, instancing of models on the GPU
  • Post-processing (Bloom), skeletal animations
  • Scene management with scene descriptions, background loading, and scene saving
  • Sound support and desktop volume settings (Linux only)
  • Hotplug gamepad support based on SDL2 and a controller database
  • Cross-platform resource system (Windows/Linux)
  • Particle system
  • Event system for mouse, keyboard, controller, window, and game events
  • Settings manager and a message logger
  • Entity component system based on EnTT
  • Physics simulator based on Box2D
  • In-game GUI with two themes and debug GUI based on ImGUI
  • Sprite sheets, a sprite sheet generator, sprite sheet animations
  • Render-API abstraction and engine/application separation
  • Profiling JSON output file for chrome://tracing

Usage:

  • Press "f" to toggle fullscreen and "m" to toggle the debug imgui window.
  • Use the left and right sticks on the controller to move some objects around and scale them.
  • Use the AWSD keys to move the camera. Q and E are for up and down
  • Use the arrow keys to look around.
  • Use the mouse wheel to zoom.
  • The A button plays a test sound.
  • Press ESC or the guide button on the controller to exit.
  • Press "g" to fire the volcano and "r" to reset the scene.

To blacklist a GPU, enter its name or a substring in engine.cfg.

Contributions: Please use https://en.wikipedia.org/wiki/Indentation_style#Allman_style and four spaces to indent.

How to clone the repository


The repository contains larger 3D files and git may abort its download. If you experience this problem, follow these instructions.

In particular, add these lines to your global git configuration file, which is .gitconfig in your user home directory (~/.gitconfig), in order to fix this problem:
[core] 
    packedGitLimit = 512m 
    packedGitWindowSize = 512m 
[pack] 
    deltaCacheSize = 2047m 
    packSizeLimit = 2047m 
    windowMemory = 2047m

Then run:

git clone --recurse-submodules https://github.com/beaumanvienna/vulkan

Build Instructions

Ubuntu Build Instructions


Open a terminal

(Info: ppa:beauman/marley provides premake5)
sudo add-apt-repository ppa:beauman/marley
sudo add-apt-repository universe
sudo apt-get update
sudo apt install premake5 git build-essential xorg-dev libxrandr-dev libvulkan-dev libpulse-dev
sudo apt install libibus-1.0-dev libglib2.0-dev libsamplerate0-dev libasound2-dev libudev-dev

Get the Vulkan SDK from here:
https://vulkan.lunarg.com/doc/view/latest/linux/getting_started_ubuntu.html

Install the source code:

git clone --recurse-submodules https://github.com/beaumanvienna/vulkan
cd vulkan

Create project files for gcc:

premake5 gmake2


Define the number of CPU cores to be used for compiling
e.g. "-j4"
To use all available CPU cores, say:
export MAKEFLAGS=-j$(nproc)

You may want to add the export MAKEFLAGS=-j$(nproc) command to ~/.bashrc to always use multiple CPU cores for compiling a makefile.


Compile and run debug target:

make verbose=1 && ./bin/Debug/lucre

Compile and run release target:

make config=release verbose=1 && ./bin/Release/lucre

MacOSX Build Instructions

Install Dependencies

Download and install MacOS Vulkan sdk
Download and install Homebrew

Open a terminal

To install Xcode, type git

Install dependencies (note that premake5 is installed as premake, but called in the terminal as premake5):

brew install premake glib gtk+ sfml sdl2 sdl2_mixer libvorbis libogg glfw

Install the source code:
git clone --recurse-submodules https://github.com/beaumanvienna/vulkan
cd vulkan

Create project files for clang:
premake5 gmake2


Define the number of CPU cores to be used for compiling
e.g. "-j8" to use eight CPU cores
To use all available CPU cores, say:
export MAKEFLAGS=-j$(sysctl -n hw.ncpu)

To find out, how many cores your Mac has, say:

sysctl -n hw.ncpu

You may want to add the export MAKEFLAGS=-j8 command to ~/.zshrc to always use multiple CPU cores for compiling a makefile.


Compile and run debug target:

make verbose=1 && ./bin/Debug/lucre

Compile and run release target:

make config=release verbose=1 && ./bin/Release/lucre

Windows Build Instructions


Dependencies: gitbash, premake5, Visual Studio

Download the Vulkan SDK from lunarg.com, install it, then copy "C:\VulkanSDK\1.3.204.1" (path and version may differ) to vendor/VulkanSDK. The version number is omitted in the path.


Open gitbash


Install the source code:

git clone --recurse-submodules https://github.com/beaumanvienna/vulkan
cd vulkan

If you have Visual Studio 2022:

premake5.exe vs2022

If you have Visual Studio 2022, use instead:
premake5.exe vs2022

Open the solution for Vulkan, switch to Release, and hit F5

Clean Instruction


To clean all temporary files (including the spv-files, engine.cfg, imgui.ini, and the scene files in the top directory), use:
premake5 clean

Update Instruction


To pull in the latest changes for the repository, use:
git pull && git submodule update --init --recursive

vulkan's People

Contributors

beaumanvienna avatar ahmeterenlacinbala avatar gdbobby avatar robloach avatar

Stargazers

 avatar  avatar Nikita Gordeev avatar Fabian Oppermann avatar ShaneClark avatar Neel Raiyani avatar Hòa (Vladimir Scarlet) avatar ケイト avatar  avatar  avatar wumo avatar JBStoquer avatar Luke Bender avatar LuBai(露白) avatar Elliot avatar  avatar irice7 avatar 宇半仙 avatar Remus Jones avatar  avatar dbkwang avatar Aleksander Konovalov avatar Lucas Pena avatar Tomer Shalev avatar Antoine Hoarau avatar Rudra Trivedi avatar Antoine Pilote avatar Arman Isadzhanyan avatar Mykhailo Piddubnyi avatar kgnet88 avatar P. A. Minerva avatar  avatar kbz_8 avatar Ær1 avatar Fragtex177 avatar Sergey Dikiy avatar  avatar  avatar Serhat Güney avatar Daniil avatar Yue Zhang avatar Ram Iyer avatar Alejandro Garrido Resina avatar hongyulin avatar Mike Smullin avatar 代码即是地狱 avatar Bulbasaur avatar Malori avatar Stephen-A. Laurent avatar citruslee avatar Michael Kneuss avatar Drischdaan avatar Vladimir Leonidovich avatar kael avatar Sean Siddens avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

vulkan's Issues

cycle wrap-up

SW dev cycle-wrap for: json scene loading, fbx file support, scene graph refactor, material system refactor, and instancing

remaining sw changes / bug fixes:

  • fix shadows for instancing
  • instancing: transform component with model/normal matrix in instance buffer
  • instancing: ECS model access for all instances for skeletal animation

video:

  • animation for copying 3D file scene graph into main scene graph: Mantar finished
  • topics:
    ~~json scene loading, scene graph, ~~
    gltf, fbx,
    material system, instancing,
    thread pool/transfer queue pool and KTX
  • one part (8 topics) or two parts (4/4) or four parts (2/2/2/2)? --> 4 parts
  • script, video editing, voice over

add procedural terrain generation

Terms:

  • chunk: larger area corresponding to a height map (maybe 25m x 25m or 100m x 100m)
  • cell: node of quadtree, a result of dividing a chunk
  • patch: input primitive for tesselation control shader, usually triangle

best intro video: https://www.youtube.com/watch?v=OqRMNrvu6TE&t=45s&ab_channel=CemYuksel

Best blog on this topic: https://satellitnorden.wordpress.com/2018/02/12/vulkan-adventures-part-3-return-of-the-triangles-tessellation-tutorial/

quad tree: https://www.youtube.com/watch?v=YO_A5w_fxRQ&ab_channel=SimonDev
geometry clipmaps: https://mikejsavage.co.uk/geometry-clipmaps/

control texture to define which out of four terrain textures is used as albedo color: https://youtu.be/rNuDkDhadfU?si=8igI-qkdmwDU5NUu&t=179

Best YT tutorial SimonDev's (the first episodes only then he goes into planet rendering):
https://www.youtube.com/watch?v=hHGshzIXFWY&list=PLRL3Z3lpLmH3PNGZuDNf2WXnLTHpN9hXy&ab_channel=SimonDev

Tutorial about Vulkan tesselation:
https://github.com/PAMinerva/LearnVulkan/wiki/02.E-Tessellation

Wiki:
https://www.khronos.org/opengl/wiki/Tessellation

The work for Lukas in his engine
https://github.com/lukasino1214/soc_real_time_renderer/blob/2d9bc4a0376ad4e155d88a8a81433db2f2cf7102/src/graphics/tasks/draw_terrain.inl#L151-L192
https://github.com/lukasino1214/soc_real_time_renderer/blob/2d9bc4a0376ad4e155d88a8a81433db2f2cf7102/src/graphics/renderer.cpp#L194-L220

Vulkan cookbook, page 621 (p.658 in the pdf)
patches in view frustum OGLDEV: https://youtu.be/08dApu_vS4c?si=yDT4AJFd9ILHLNiv&t=111

Official Vulkan docs
https://docs.vulkan.org/spec/latest/chapters/tessellation.html#:~:text=Tessellation%20involves%20three%20pipeline%20stages,v%2Cw)%20parameter%20space.

[download JSON terrain config file (just brainstorming) terrain.json]
(https://github.com/beaumanvienna/vulkan/files/14395258/terrain.json)

write a serializer

create list of pairs [glTF file, entity] and [obj file, entity], then write the scene description file to disk

infinite scene

  • tile-based (9x base tile, base tile consists of two instances of the sand.gltf, tiles mirrored to match meshes)
    • alternatively, a single tile could be one gltf file (might be easier to place cactuses)
  • real sky box (moves with position moves with cam position)
  • directional light 0 and directional light 1 move according to cam position

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.