All Projects → hamsham → SoftLight

hamsham / SoftLight

Licence: MIT license
A shader-based Software Renderer Using The LightSky Framework.

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
Objective-C++
1391 projects

Projects that are alternatives of or similar to SoftLight

Boost.simd
Boost SIMD
Stars: ✭ 238 (+11800%)
Mutual labels:  neon, sse, simd
oversimple
A library for audio oversampling, which tries to offer a simple api while wrapping HIIR, by Laurent De Soras, for minimum phase antialiasing, and r8brain-free-src, by Aleksey Vaneev, for linear phase antialiasing.
Stars: ✭ 25 (+1150%)
Mutual labels:  neon, sse, simd
Directxmath
DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps
Stars: ✭ 859 (+42850%)
Mutual labels:  neon, sse, simd
Fastnoisesimd
C++ SIMD Noise Library
Stars: ✭ 542 (+27000%)
Mutual labels:  neon, sse, simd
Simde
Implementations of SIMD instruction sets for systems which don't natively support them.
Stars: ✭ 1,012 (+50500%)
Mutual labels:  neon, sse, simd
Cglm
📽 Highly Optimized Graphics Math (glm) for C
Stars: ✭ 887 (+44250%)
Mutual labels:  neon, sse, simd
Base64simd
Base64 coding and decoding with SIMD instructions (SSE/AVX2/AVX512F/AVX512BW/AVX512VBMI/ARM Neon)
Stars: ✭ 115 (+5650%)
Mutual labels:  neon, sse, simd
Quadray Engine
Realtime raytracer using SIMD on ARM, MIPS, PPC and x86
Stars: ✭ 13 (+550%)
Mutual labels:  neon, sse, simd
Vc
SIMD Vector Classes for C++
Stars: ✭ 985 (+49150%)
Mutual labels:  neon, sse, simd
Xsimd
C++ wrappers for SIMD intrinsics and parallelized, optimized mathematical functions (SSE, AVX, NEON, AVX512)
Stars: ✭ 964 (+48100%)
Mutual labels:  neon, sse, simd
Sse2neon
A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation
Stars: ✭ 316 (+15700%)
Mutual labels:  neon, sse, simd
Hlslpp
Math library using hlsl syntax with SSE/NEON support
Stars: ✭ 153 (+7550%)
Mutual labels:  shaders, neon, sse
Std Simd
std::experimental::simd for GCC [ISO/IEC TS 19570:2018]
Stars: ✭ 275 (+13650%)
Mutual labels:  neon, sse, simd
Mipp
MIPP is a portable wrapper for SIMD instructions written in C++11. It supports NEON, SSE, AVX and AVX-512.
Stars: ✭ 253 (+12550%)
Mutual labels:  neon, sse, simd
Libsimdpp
Portable header-only C++ low level SIMD library
Stars: ✭ 914 (+45600%)
Mutual labels:  neon, sse, simd
Unisimd Assembler
SIMD macro assembler unified for ARM, MIPS, PPC and x86
Stars: ✭ 63 (+3050%)
Mutual labels:  neon, sse, simd
Simd
C++ image processing and machine learning library with using of SIMD: SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX-512, VMX(Altivec) and VSX(Power7), NEON for ARM.
Stars: ✭ 1,263 (+63050%)
Mutual labels:  neon, sse, simd
Computelibrary
The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
Stars: ✭ 2,123 (+106050%)
Mutual labels:  neon, simd
Nsimd
Agenium Scale vectorization library for CPUs and GPUs
Stars: ✭ 138 (+6800%)
Mutual labels:  neon, simd
Simdjson
Parsing gigabytes of JSON per second
Stars: ✭ 15,115 (+755650%)
Mutual labels:  neon, simd

SoftLight

A Software Renderer Using The LightSky Framework.

Build

About SoftLight

SoftLight started as a research project into software rendering and shader technology which mimicked modern hardware rendering APIs. By looking at other software rendering projects like tinyrenderer and Mesa3D, SoftLight began to take shape.

Tech

SoftLight has been built from the ground-up to run on Windows (Win32 & GDI), Linux (X11 or XCB, optionally with XSHM-MIT), and OS X (Cocoa & Quartz) using C++. For window creation, only the Win32 API and Xlib development libraries are used. Direct framebuffer access is available which can allow for other implementations to be created as well, or you can simply use the window handles to embed an internal, native context into other applications which support it.

SoftLight uses CPU-based SIMD acceleration (AVX2 on x86 and NEON/VFPv4 on ARM) to increase performance. There are also multithreaded work queues which can take advantage of as many cores as a system has available. The number of cores can be configured at runtime to help increase flexibility.

Getting Started

Compiler & Archtecture Support

Technically, any C++11-compliant compiler should be able to build the project. To build the project, you'll need GCC, Clang, Microsoft Visual Studio 2017, or MSVC 2019. Softlight should work on any modern architecture (tested on i686, x64, ARM, AARCH64, and PowerPC-EL64), the project has been tested on the following compilers:

GCC Clang* MSVC** MinGW-W64**
4.8.2 3.5 2017 5.1.0
5.0.0 3.6 2019 7.4.0
7.3.0 6.0 2022 8.4.0
9.3.0 10.0 11.0.0
11.1.0 12.0

* Benchmarking has consistently shown Clang generates and builds the most optimized code.

**Windows builds typically run the slowest. MSVC is the worst performer and using MinGW-w64 can lead to better performance.

Dependencies

3rd-party development dependencies listed here will either be detected from the local system or downloaded and built from source:

System/OS Dependencies
Dependency Platform Required? Use/Application
cmake All Yes Generate build files
x11-utils Linux Yes Required for X11 & XCB
libx11-dev Linux Yes Required for X11 & XCB
libx11-xcb-dev Linux Yes Enable X11 Shared Memory
libxext-dev Linux No Required for X11 & XCB
libxcb1-dev Linux Yes Required for X11 & XCB
libxcb-image0-dev Linux Yes Required for X11 & XCB
libxcb-shm0-dev Linux No Enable XCB Shared Memory
*libxkbcommon OS X + Homebrew No Enable X11/XQuartz on OSX
TortoiseSVN Windows Yes Checkout 3rd-party libs

* The X11 backend can be used on OS X with XQuartz but XSHM-MIT optimizations will be unavailable due to limitations of shared memory.

Linux targets currently require both X11 and XCB development libraries to compile. However the backend can be chosen at compile time by passing the -DPREFER_XCB=TRUE build flag to CMake. Similarly on OSX, the X11 backend can also be chosen by setting the -DPREFER_COCOA=FALSE flag. The X-Shared Memory (XSHM-MIT) will be checked and enabled at compile-time for better performance. All other dependencies will be downloaded from their source repositories and compiled.

3rd-Party Dependencies
Dependency Use/Application
ASSIMP For loading various 3D asset file formats
FreeImage To load textures and image files.
ENet Dependency of LightUtils. Used for UDP Networking.
GLM Dependency of LightMath. For unit testing and validation only.
FreeType Used for loading TTF fonts.

It is recommended to install the 3rd-party development packages onto the system to speed up build times.

Checking out the Code

SoftLight uses the following submodules:

Cloning the repository should be done recursively, using the following steps:

  1. git clone --recursive https://github.com/hamsham/SoftLight.git
  2. cd SoftLight
  3. git submodule foreach git checkout master
  4. git submodule foreach git pull origin master

Examples

SoftLight is a very flexible software rasterizer. Compiling the code will generate a set of tests you can use to play around with. Some interesting examples include:

  • Parallel Mesh Instancing (sl_instancing_test.cpp): Toggle threaded instancing by pressing the F2 key.
  • Skinning and animation (sl_animation_test.cpp).
  • Large indoor environment rendering (sl_large_scene_test.cpp): Press the F1 Key to capture the mouse and explore the environment using the WASD keys. You can also toggle PBR-based rendering with the F2 key as well as change the number of threads used for rendering by using the up/down arrow keys.
  • Full-screen quad rendering (sl_fullscreen_quad.cpp). Render to an offscreen Compact YCoCg Framebuffer then reconstruct the image in a second render pass.
  • Volumetric voxel rendering (sl_volume_rendering_test.cpp).

Check out the below screenshots to see what else it can do!

Diffuse Lighting, 122 FPS, 15 Threads, Ryzen 1800X

Physically Based Rendering, 114 FPS, 15 Threads, Ryzen 1800X

Skeletal Animations

Mesh Instancing, ~280 FPS, 14 Threads, Ryzen 1800X

Volume Rendering, ~9 FPS, 16 Threads, Ryzen 1800X

True-Type Font Rendering, ~562 FPS, 15 Threads, Ryzen 1800X

Samples

To see how to build a sample application using either SoftLight or the LightSky frameworks, explore the "tests" subdirectories within each project. You will find plenty of examples on how to load a 3D model, create a shader, render, and manipulate a 3D scene in real-time.

TODO

  • Provide support for mip-mapping.
  • Migrate shader system to use modern "pipeline" syntax (similar to Metal & Vulkan).
  • Migrate framebuffer system to render passes (similar to Metal & Vulkan).
  • Finish support for render state objects (including depth-stencil states).
  • Complete Doxygen-based documentation for the software rendering module.
  • Additional Unit Tests.
  • Create additional examples.
  • Wrap the rendering module in a C API for project portability.
  • Migrate high-level scene graph constructs into LightGame.
  • Add SDL2 backend support.

Q&A

For any inquiries or pull requests, please email [email protected]. Bugs and other issues can be added here on GitHub. Finally, all source code is available under the MIT License.

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].