• This repository has been archived on 17/Mar/2019
  • Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    C
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An abstract graphics API library

PROJECT DISCONTINUED

Unfortunately I'm no longer maintaining this project - I've left the company that was sponsoring it, and since then they've been developing this library internally. It diverged a lot from what's currently hosted here and nobody has the time to merge these changes back.

I recommend everyone to use https://github.com/bkaradzic/bgfx instead - it's stable, reliable and has excellent documentation.

I thank everyone who was involved in developing this little library.

Sigrlinn - An abstract graphics API library

Intro

Sigrlinn is an abstract cross platform graphical API, that tries to make you forget about different GPU APIs and their evolution in time.

What does the name mean?

Sigrlinn is the name of a pretty Scandinavian princess, daugther of the king Sváfnir of Sváfaland, from the Helgakviða Hjörvarðssonar poem.

What can it do?

Here are several interesting screenshots in a clockwise order:

  • Dynamic Vertex Pulling combined with GPU Driven Occlusion Culling. Warning: sample code is far from being optimal.
  • GPU-driven particle system where individual particles can collide with the scene and stay on top of it persistently.
  • Order independent transparency with per-pixel linked lists.
  • Lionheads Mega Meshes implementation (continuous multi resolution surface). This does not include: a DCC plugin or any mesh sculpting code; streaming; texturing.

Motivation

There are 2 major cross-platform problems: the APIs and the shaders. In the nearest future we will have to support 5 (!) graphics APIs: DX11, DX12, OpenGL (ES?), Metal and Vulkan, and 4 (!) shader languages: HLSL, GLSL, Metal and Vulkan shaders (GLSL? I hope so).

SGFX tries to address only the first issue by providing an extremely thin layer that connects your application code to all 5 graphics APIs and does not stand in your way. It is designed with simplicity and flexibility in mind, it is open source (MIT license), and it is extremely small and easy to integrate.

It features DX12-like interface, all API functions are inside a single header file, while implementations are in several source files (typically one source file per gfx backend). Everything is somewhere around 5 KLOC, so it is also easy to contribute new features, modify and debug the code and even replace the parts you don’t like.

Target audience

This library is intented for those developers, who either have their own graphics engine, or use an open source one which may or will not be updated for some reasons. SGFX aims to simplify different platforms and different graphics API support, which in turn allows developers to focus more on the game visuals rather then fiddling with platform support and API-specific bugs.

The abstraction layer is as thin as possible, therefore it allows transparent API debugging and it makes that SGFX code will also run at roughly the same performance across different rendering backends.

The performance statement should be explained. There are 2 different groups of supported APIs: next-gen group and legacy group. The code performance is the same between different APIs from the same group, e.g. SGFX with DX12 backend will run at the same speed as SGFX with Vulkan backend.

Here is the table that shows API groups:

Next-Gen Legacy
D3D12 OpenGL
Mantle D3D11
Metal
Vulkan
GNM

SGFX is designed with common legacy engines in mind, therefore certain decisions are made to simplify integration process. For instance, SGFX does not sort the draw calls for you, it does not ship with a custom cross-API shader language, etc.

Library complilation is also as simple, as possible: just drag and drop the source files to your solution or simply use the bundled CMake script. No extra dependencies or any additional include directories are required (except for the DX SDK, but you probably already have this).

Features

At the current stage of development the library supports:

API Status
D3D11 Full support (starting from feature level 10.0)
OpenGL 4.0 Partial support (WIP)
Apple METAL WIP
D3D12 WIP
AMD Mantle Abandoned in favor of Vulkan
Khronos Vulkan WIP
PlayStation 4 libGNM Possible, but not planned for the nearest future
OpenGL ES 3.0 Possible, but not planned for the nearest future

What it is NOT

  • It is not a game/graphics engine
  • It is not a library that loads textures and 3D models
  • It is not a new universal standard that covers everyone's use cases
  • It is not a native graphics API - there will always be some limitations and overheads
  • It is not a thing that you can easily drag-n-drop to your engine to enable fancy graphics

Similar projects

  • BGFX - A similar library that does the same things differently.

    • It supports DX9 and above, while SGFX aims at DX10 and above. Supporting higher feature level simplifies library design and removes a lot of legacy. Use BGFX if you need to support DX9 or WindowsXP! SGFX will likely never support those.
    • It strictly supports mobile platforms, while SGFX has no plans for it. This may change in the future, however.
    • It adresses cross-platform shaders issue, however this is somewhat limiting. SGFX intentionally does not address this.
    • It does a lot of additional work under the hood (e.g. draw call sorting). SGFX has a different puprose and different target audience, therefore it avoids doing extra work unless this is vital. SGFX assumes that users graphics engine already has draw call sorting and other important things as well.
    • It ships with its own tools for shader compiling, texture compressing, etc. which are meant to be used with the library. SGFX assumes that users graphics engine already has this.
  • More similar libraries, anyone?

Who is using it?

  • BitBox, Ltd. is going to use the library in their current big project, Life is Feudal, as well, as in the future projects (that’s why it is sponsoring SGFX development!)
  • Bug-Zen is using the library in one of their unannounced projects (thanks for the valuable feedback!)
  • Peter Ellsum from Westwood 3D has provided lots of valuable feedback.
  • Luis Anton Rebollo from BeamNG has participated in the library design and implementation.

Credits

Name Role Position
Kirill Bazhenov aka bazhenovc Library developer Lead graphics programmer at BitBox Ltd
Peter Ellsum aka CfeHunter Feedback Lead graphics programmer at Westwood 3D
Luis Anton Rebollo Ideas and feedback Lead graphics programmer at BeamNG
Linda MacGill aka Methelina Marketing and support Technical art director at Westwood 3D

Contact

Current library maintainer is Kirill Bazhenov, bazhenovc AT gmail DOT com.

More Repositories

1

QtPropertyBrowser

A Qt5 compatible fork of QtPropertyBrowser from QtSolutions.
C++
27
star
2

libdds

libdds is a library for operating DDS textures. It is able to load DXT1-5 compressed textures, pack/unpack them with different compression algorythms and so on.
C
19
star
3

cst-lisp

Experimental statically typed programming language that compiles to LLVM and has Lisp syntax
C++
8
star
4

lid-lang

Experimental functional programming language with C-like syntax, static typing and LLVM backend.
C++
7
star
5

enetpp

ENet C++ port. http://enet.bespin.org/
C++
7
star
6

SpatialIndex

Implicit unbounded spatial acceleration structure in less than 200 lines of code.
C++
5
star
7

gl4_samples_rus

Примеры использования OpenGL 4 на русском языке
C++
5
star
8

MetaGen

A clang-based utility to dump C++ object metadata to the XML file
C++
4
star
9

fullscreenize

A very simple utility, that switches any X11 window to fullscreen mode without grabbing mouse/keyboard and allowing window switching
C
3
star
10

SDE

SDE aims to be fast and feature rich desktop environment for Linux-based devices with strong focus on touchscreen handhelds, PDAs and mobile phones.
C++
3
star
11

friskhet

Friskhet! A software rendered game.
C++
3
star
12

QtToolWindowManager

A Qt5 compatible fork of libQToolWindowManager from QtSolutions.
C++
3
star
13

atom

Atom is a library for manipulating human-readable ASCII string literals packed into 64 bit integers.
C++
2
star
14

blendtool

Command line tool to extract various data from Blender .blend files
Rust
2
star
15

scratch-dds

Low-level DDS parsing and writing library
Rust
1
star
16

blog

CSS
1
star
17

dds2ktx

This tool converts DirectDraw Surface .dds files to Khronos TeXture .ktx files.
Rust
1
star