All Projects â†’ egorodet â†’ Methanekit

egorodet / Methanekit

Licence: apache-2.0
🎲 Modern 3D graphics made simple with cross-platform C++17 meta-API on top of DirectX 12 & Metal (Vulkan is coming)

Projects that are alternatives of or similar to Methanekit

3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+5838.07%)
Mutual labels:  game-development, gamedev, graphics, shaders, 3d-graphics, graphics-programming
Renderer
A shader-based software renderer written from scratch in C89
Stars: ✭ 1,366 (+593.4%)
Mutual labels:  graphics, shaders, 3d-graphics, graphics-programming, cross-platform
Cpp 3d Game Tutorial Series
C++ 3D Game Tutorial Series is a YouTube tutorial series, whose purpose is to help all those who want to take their first steps in the game development from scratch.
Stars: ✭ 400 (+103.05%)
Mutual labels:  game-development, gamedev, graphics, 3d-graphics, graphics-programming
Bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+5104.06%)
Mutual labels:  gamedev, graphics, metal, directx, d3d12
Ultralight
Next-generation HTML renderer for apps and games
Stars: ✭ 3,585 (+1719.8%)
Mutual labels:  cmake, game-development, gamedev, metal, cross-platform
Flycube
Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.
Stars: ✭ 78 (-60.41%)
Mutual labels:  gamedev, graphics, 3d-graphics, graphics-programming, d3d12
Obengine
2D Game Engine with Lua Scripting made on top of SFML !
Stars: ✭ 335 (+70.05%)
Mutual labels:  cmake, game-development, gamedev, cross-platform
Verticaldissolve
Procedural vertical dissolve shader. Highly customizable. Tweak edge color, noisiness & waviness, rim light, emission scrolling and more.
Stars: ✭ 434 (+120.3%)
Mutual labels:  game-development, gamedev, graphics, shaders
Texturepanner
This repository hosts a shader for Unity3D whose main goal is to facilitate the creation of neon-like signs, conveyor belts and basically whatever based on scrolling textures
Stars: ✭ 528 (+168.02%)
Mutual labels:  game-development, gamedev, graphics, shaders
Hybridrenderingengine
Clustered Forward/Deferred renderer with Physically Based Shading, Image Based Lighting and a whole lot of OpenGL.
Stars: ✭ 563 (+185.79%)
Mutual labels:  graphics, shaders, 3d-graphics, graphics-programming
Renderdoc
RenderDoc is a stand-alone graphics debugging tool.
Stars: ✭ 5,969 (+2929.95%)
Mutual labels:  graphics, directx, graphics-programming, d3d12
Radialprogressbar
Customizable radial progress bar shader for Unity3D. Allows you to set arc range, minimum and maximum colors, textures, radius, and a few more things. Create HP Bars, Speedometers, rank progress, etc!
Stars: ✭ 714 (+262.44%)
Mutual labels:  game-development, gamedev, graphics, shaders
Softwarerenderer
Software rendering engine with PBR. Built from scratch on C++.
Stars: ✭ 323 (+63.96%)
Mutual labels:  graphics, shaders, 3d-graphics, graphics-programming
Diligentsamples
Sample projects demonstrating the usage of Diligent Engine
Stars: ✭ 138 (-29.95%)
Mutual labels:  gamedev, directx, graphics-programming, d3d12
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+987.31%)
Mutual labels:  gamedev, directx, graphics-programming, d3d12
Rimlight
Customizable rimlight shader for Unity that includes pulsation and noise scrolling. Give your scenes that extra oomph!
Stars: ✭ 170 (-13.71%)
Mutual labels:  game-development, gamedev, graphics, shaders
Spheredissolve
Customizable procedural spherical dissolve shader for Unity3D, for all your customizable procedural spherical dissolve needs!
Stars: ✭ 311 (+57.87%)
Mutual labels:  game-development, gamedev, graphics, shaders
Alimer
Cross-platform game engine.
Stars: ✭ 172 (-12.69%)
Mutual labels:  game-development, gamedev, graphics, cross-platform
Tinykaboom
A brief computer graphics / rendering course
Stars: ✭ 2,077 (+954.31%)
Mutual labels:  graphics, shaders, 3d-graphics, graphics-programming
Klayge
KlayGE is a cross-platform open source game engine with plugin-based architecture.
Stars: ✭ 1,646 (+735.53%)
Mutual labels:  graphics, d3d12, cross-platform

Methane Kit

Open in Gitpod License Contributions Welcome Join the chat at https://gitter.im/MethaneKit/community

Easy to use modern 3D graphics abstraction API in C++17 for cross-platform applications development:

  • Builds on top of modern native 3D graphics APIs: DirectX 12 on Windows and Metal on MacOS, Vulkan on Linux will be enabled soon.
  • Simplifies modern graphics programming with object-oriented higher-level graphics API inspired by simplicity of Apple's Metal and common shaders code in HLSL 6.
  • Provides cross-platform application infrastructure from CMake-based toolchain to platform independent application and user input classes.

Click "Open in Gitpod" button above to explore Methane Kit codebase right away in a familiar VSCode-like IDE environment in your web-browser with navigation by symbols and cloud-build. Download release builds with built samples and tutorials to try them out. Also you can get Azure Pipelines build artifacts to test latest versions from develop branch. For manual build instruction see topic Building from Sources described below. Start learning Methane Graphics API with Hello Triangle tutorial documentation.

Platform Graphics API Master Build Status Develop Build Status
Windows x64 DirectX 12 Windows x64 Master Build Status Windows x64 Develop Build Status
Windows x86 DirectX 12 Windows x86 Master Build Status Windows x86 Develop Build Status
MacOS Metal MacOS Master Build Status MacOS Develop Build Status
Linux Vulkansoon Ubuntu Master Build Status Ubuntu Develop Build Status

Static code analysis scans are performed as a part of automated CI build process on master and develop branches with up-to-date results published on Sonar Cloud.

Platform Sonar Quality Gate Master Scan Status Develop Scan Status
Windows Windows Quality Gate Status Windows Master Scan Status Windows Develop Scan Status
MacOS Quality Gate Status MacOS Master Scan Status MacOS Develop Scan Status
Linux Quality Gate Status Linux Master Scan Status Linux Develop Scan Status

Windows Maintainability Rating Windows Reliability Rating Windows Security Rating Windows Code Smells Windows Duplicated Lines (%) Windows Coverage Windows Lines of Code Codacy CodeFactor Total lines

Asteroids sample on Windows

Asteroids sample demonstrating multi-threaded rendering with Methane Graphics API

Getting Started

High-Level Architecture

Methane Kit architecture is clearly distributing library modules between 5 layers from low to high level of abstraction. High Level Architecture

Graphics Core Interfaces

Methane Graphics Core module implements a set of public object-oriented interfaces, which make modern graphics programming easy and convenient in a platform and API independent way. Graphics Core Interfaces

Features

  • Cross-platform application & input classes: Windows & MacOS are supported, Linux is coming soon
    • CMake modules for convenient application build configuration, adding shaders and embedded resources
    • HLSL-6 Shaders serving all graphics APIs converted to native shader language and compiled in build time with SPIRV-Cross & DirectXCompiler
    • HLSL++ Math library with HLSL-like syntax in C++ and vector-instruction optimizations for different platforms
  • Modern Graphics API abstractions: DirectX 12 & Metal are supported, Vulkan is coming soon
    • Render state and program configuration with compact initialization syntax
    • Program binding objects implement efficient binding of shader arguments to resources
    • Automatic resource state tracking used for automatic resource transition barriers setup
    • Resources are automatically retained from destroying while in use on GPU with shared pointers in command list state
    • Command list execution state tracking with optional GPU timestamps query on completion
    • Parallel render command list for multi-threaded render commands encoding in single render pass
    • Multiple command queues execution on GPU with synchronization using fences
    • Private GPU resources asynchronously updated through the upload command list and shared resource
    • Registry of named graphics objects enabling reuse of render states and graphics resources between renderer objects
  • Graphics primitives and extensions:
    • Graphics application base class with per-frame resource management and frame buffers resizing enable effective triple buffering
    • Camera primitive and interactive arc-ball camera
    • Procedural mesh generation for quad, box, sphere, icosahedron and uber-mesh
    • Perlin Noise generator
    • Screen-quad and sky-box rendering extension classes
    • Texture loader (currently implemented with STB, planned for replacement with OpenImageIO)
  • User Interface:
    • UI application base class with integrated HUD, logo badge and help/parameters text panels
    • Typography library for fonts loading, dynamic atlas updating, text rendering & layout
    • Widgets library (under development)
  • Platform Infrastructure:
    • Base application with window management and input handling
    • Events mechanism connecting emitters and receivers via callback interfaces
    • Animations subsystem
    • Embedded resource providers
    • Range Set implementation
  • Integrated debugging and profiling capabilities:
  • Continuous integration with automated multi-platform builds, unit-tests and Sonar Cloud static code analysis in Azure Pipelines

For detailed features description and development plans please refer to Modules documentation.

Tutorials

Start learning Methane Graphics API with Hello Triangle tutorial documentation and continue with others.

Name / Link
Screenshot
Description                                         
Hello Triangle Hello Triangle on Windows Colored triangle rendering in just 120 lines of code!
Textured Cube Textured Cube on Windows Textured cube introduces buffers and textures usage along with program bindings.
Shadow Cube Shadow Cube on Windows Shadow cube introduces multi-pass rendering with render passes.
Typography Typography on Windows Typography demonstrates animated text rendering with dynamic font atlas updates using Methane UI.

Samples

Methane samples demonstrate advanced techniques and usage scenarios with a more complex implementation than tutorials above.

Name / Link
Screenshot
Description                                         
Asteroids Asteroids on Windows Benchmark demonstrating parallel render commands encoding in a single render pass for the large number of heterogeneous asteroid objects processed in multiple threads.

Building from Sources

Prerequisites

  • Common
    • Git (required to pull sub-modules)
    • CMake 3.16 or later
  • Windows
    • Windows 10 RS5 (build 1809) or later
    • Visual Studio 2019 with MSVC v142 or later
    • Windows 10 SDK latest
  • MacOS
    • MacOS 10.15 "Catalina" or later
    • XCode 11 or later with command-line tools
  • Linux
    • Ubuntu 20.04 or later
    • GCC 9 or later

Fetch Sources

IMPORTANT!

  • Do not download source code via Zip archive, since it does not include content of Externals submodules. Use git clone command as described below.
  • Consider using short path for repository location on Windows (for example c:\Git), which may be required to resolve problem with support of paths longer than 260 symbols in some Microsoft build tools.

First time initialization

git clone --recurse-submodules https://github.com/egorodet/MethaneKit.git
cd MethaneKit

Update sources to latest revision

cd MethaneKit
git pull && git submodule update --init --recursive

Build

Windows Build with Visual Studio 2019

Start Command Prompt, go to MethaneKit root directory (don't forget to pull dependent submodules as described above) and either start auxiliary build script Build/Windows/Build.bat or build with CMake command line:

mkdir Build\Output\VisualStudio\Build && cd Build\Output\VisualStudio\Build
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="%cd%\..\Install" "..\..\..\.."
cmake --build . --config Release --target install

Alternatively you can open root CMakeLists.txt directly in Visual Studio or any other IDE of choice with native CMake support and build it with Ninja using provided configurations in CMakeSettings.json.

Run built applications from the installation directory Build\Output\VisualStudio\Install\Apps

MacOS Build with XCode

Start Terminal, go to MethaneKit root directory (don't forget to pull dependent submodules as described above) and either start auxiliary build script Build/Posix/Build.sh or build with CMake command line:

mkdir -p Build/Output/XCode/Build && cd Build/Output/XCode/Build
cmake -H../../../.. -B. -G Xcode -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_INSTALL_PREFIX="$(pwd)/../Install"
cmake --build . --config Release --target install

Note that starting with XCode 12 and Clang 12 build architectures have to be specified explicitly using CMake generator command line option -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" to build the fat binary. This option can be omitted with earlier versions of Clang on macOS.

Alternatively you can open root CMakeLists.txt and build it from any IDE with native CMake support.

Run built applications from the installation directory Build/Output/XCode/Install/Apps

Linux Build with Unix Makefiles

Build on Linux is supported with "Unix Makefiles" generator. But Linux platform abstraction layer and Vulkan graphics API abstraction implementations are currently stubbed, so in spite of it builds fine, do not expect anything to work on Linux now besides unit-tests.

mkdir -p Build/Output/Linux/Build && cd Build/Output/Linux/Build
cmake -H../../../.. -B. -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$(pwd)/../Install"
cmake --build . --config Release --target install

CMake Build Options

Build options can be configured in cmake generator command line:

cmake -G [Generator] ... -D[BUILD_OPTION_NAME]:BOOL=ON
Build Option Name Default Value Release Build Profiling Build Description
METHANE_APPS_BUILD_ENABLED ON ON ON Enable applications build
METHANE_TESTS_BUILD_ENABLED ON ON ON Enable tests build
METHANE_CHECKS_ENABLED ON ON ON Enable runtime checks of input arguments
METHANE_RUN_TESTS_DURING_BUILD ON OFF OFF Enable test auto-run after module build
METHANE_UNITY_BUILD_ENABLED ON ON ON Enable unity build speedup for some modules
METHANE_CODE_COVERAGE_ENABLED OFF OFF OFF Enable code coverage data collection with GCC and Clang
METHANE_SHADERS_CODEVIEW_ENABLED OFF ON ON Enable shaders code symbols viewing in debug tools
METHANE_USE_OPEN_IMAGE_IO OFF OFF OFF Enable using OpenImageIO library for images loading
METHANE_COMMAND_DEBUG_GROUPS_ENABLED OFF ON ON Enable command list debug groups with frame markup
METHANE_LOGGING_ENABLED OFF OFF OFF Enable debug logging
METHANE_SCOPE_TIMERS_ENABLED OFF OFF ON Enable low-overhead profiling with scope-timers
METHANE_ITT_INSTRUMENTATION_ENABLED OFF ON ON Enable ITT instrumentation for trace capture with Intel GPA or VTune
METHANE_ITT_METADATA_ENABLED OFF OFF ON Enable ITT metadata for tasks and events like function source locations
METHANE_GPU_INSTRUMENTATION_ENABLED OFF OFF ON Enable GPU instrumentation to collect command list execution timings
METHANE_TRACY_PROFILING_ENABLED OFF OFF ON Enable realtime profiling with Tracy
METHANE_TRACY_PROFILING_ON_DEMAND OFF OFF ON Enable Tracy data collection on demand, after client connection

Supported Development Tools

Development Environments

  • Microsoft Visual Studio 2019
    • Solutions and projects build (generate with Build.bat)
    • Ninja build with CMake native support (pre-configured with CMakeSettings.json)
  • Apple XCode
    • XCode workspace and projects (generate with Build.sh)
  • Microsoft VS Code and GitPod (pre-configured with .vscode/settings.json)
  • Jet Brains CLion (pre-configured with .idea)
  • Jet Brains ReSharper C++ (pre-configured with Folder.DotSettings)
  • Qt Creator with CMake native support

Methane Kit is being developed with support of Jet Brains development tools. Open source project development license is provided free of charge to all key contributors of Methane Kit project.

Static Code Analysis

Methane Kit comes with continuous C++ static code and code coverage analysis performed as a part of automated CI "Scan" builds with up-to-date results published on Sonar Cloud separately for all supported platforms.

Master Scan Results Windows MacOS Linux
Scan Build Status Windows Master Scan Status MacOS Master Scan Status Linux Master Scan Status
Quality Gate Windows Quality Gate Status MacOS Quality Gate Status Linux Quality Gate Status
Maintainability Windows Maintainability Rating MacOS Maintainability Rating Linux Maintainability Rating
Reliability Windows Reliability Rating MacOS Reliability Rating Linux Reliability Rating
Security Windows Security Rating MacOS Security Rating Linux Security Rating
Technical Debt Windows Technical Debt MacOS Technical Debt Linux Technical Debt
Bugs Windows Bugs MacOS Bugs Linux Bugs
Vulnerabilities Windows Vulnerabilities MacOS Vulnerabilities Linux Vulnerabilities
Code Smells Windows Code Smells MacOS Code Smells Linux Code Smells
Duplicated Lines Windows Duplicated Lines (%) MacOS Duplicated Lines (%) Linux Duplicated Lines (%)
Tests Coverage Windows Coverage MacOS Coverage Linux Coverage
Lines of Code Windows Lines of Code MacOS Lines of Code Linux Lines of Code

Trace Profiling Tools

Methane Kit contains integrated instrumentation of all libraries for performance analysis with trace collection using following tools. Please refer to Methane Instrumentation document for more details on trace collection instructions and related build options.

Tracy Frame Profiler Intel Graphics Trace Analyzer
Asteroids Trace in Tracy Asteroids Trace in GPA Trace Analyzer

Frame Profiling and Debugging Tools

External Dependencies

All external dependencies of Methane Kit are listed in MethaneExternals repository. See MethaneExternals/README.md for more details.

License

Methane Kit is distributed under Apache 2.0 License: it is free to use and open for contributions!

Copyright 2019-2021 © Evgeny Gorodetskiy Follow

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].