GithubHelp home page GithubHelp logo

konstantinseurer / raytracedgl1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sultim-t/raytracedgl1

0.0 0.0 0.0 20.06 MB

License: MIT License

C++ 37.65% Python 1.77% C 59.00% Objective-C 0.85% Awk 0.11% CMake 0.22% GLSL 0.40%

raytracedgl1's Introduction

RTGL1

Work in progress

RTGL1 is a library that simplifies the process of porting applications with fixed-function pipeline to real-time path tracing.

It's achievable with hardware accelerated ray tracing, low sample per pixel count and utilizing denoising algorithms to improve the image quality by aggressively reusing spatio-temporal data.

Build

  1. Requirements:

  2. Clone the repository

    • git clone https://github.com/sultim-t/RayTracedGL1.git
  3. Configure with CMake

    • on Windows, with Visual Studio:
      • open the folder as CMake project
    • otherwise:
      • specify windowing systems to build the library with, by enabling some of the CMake options:
        • RG_WITH_SURFACE_WIN32
        • RG_WITH_SURFACE_METAL
        • RG_WITH_SURFACE_WAYLAND
        • RG_WITH_SURFACE_XCB
        • RG_WITH_SURFACE_XLIB
      • (optional) to build with DLSS: add the environment variable DLSS_SDK_PATH that points to a cloned DLSS repository, and enable RG_WITH_NVIDIA_DLSS option
      • configure
      mkdir Build
      cd Build
      cmake ..
      
      • but make sure that projects that use RTGL1 can find the compiled dynamic library, as it usually assumed that it's in Build/x64-Debug or Build/x64-Release
  4. Build

    • cmake --build .
  5. Build shaders

    • Run Source/Shaders/GenerateShaders.py with Python3, it will generate SPIR-V files to Build folder

Notes:

  • RTGL1 requires a set of blue noise images on start-up: RgInstanceCreateInfo::pBlueNoiseFilePath. A ready-to-use resource can be found here: Tools/BlueNoise_LDR_RGBA_128.ktx2

Tools

Shader development

RTGL1 supports shader hot-reloading (a target application sets RgStartFrameInfo::requestShaderReload=true in runtime).

But to ease the process of building the shaders, instead of running GenerateShaders.py from a terminal manually, you can install Visual Studio Code and Script Runner extension to it. Open Sources/Shaders folder, add such config to VS Code's .json settings file (of courser, it could be better done with VS Code workspaces).

"script-runner.definitions": {
        "commands": [
            {
                "identifier": "shaderBuild",
                "description": "Build shaders",
                "command": "cls; python .\\GenerateShaders.py -ps",
                "working_directory": "${workspaceFolder}",
            },
            {
                "identifier": "shaderGenAndBuild",
                "description": "Build shaders with generating common files",
                "command": "cls; python .\\GenerateShaders.py -ps -g",
                "working_directory": "${workspaceFolder}",
            }
        ],
    },

Then assign hotkeys to shaderBuild and shaderGenAndBuild commands in File->Preferences->Keyboard Shortcuts.

Textures

Some games don't have PBR materials, but to add them, RTGL1 provides 'texture overriding' functionality: application requests to upload an original texture and specifies its name, then RTGL1 tries to find files with such name (appending some suffixes, e.g. _n for normal maps, or none for albedo maps) and loads them instead of original ones. These files are in .ktx2 format with a specific compression and contain image data.

To generate such textures:

  1. Compressonator CLI and Python3 are required
  2. Create a folder, put Tools/CreateKTX2.py, create folder named Raw and Compressed.
  3. The script:
    1. scans files (with INPUT_EXTENSIONS) in Raw folder
    2. generates corresponding .ktx2 file to Compressed folder, preserving the hierarchy

On RTGL1 initialization, RgInstanceCreateInfo::pOverridenTexturesFolderPath should contain a path to the Compressed folder.

Projects

Screenshots

Screenshot 00 Screenshot 01

raytracedgl1's People

Contributors

sultim-t avatar kd-11 avatar pac85 avatar

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.