GithubHelp home page GithubHelp logo

rengine's Introduction

a rendering engine

rengine is a header-only rendering library and has no dependencies other than OpenGL and the C++ standard library (C++11).

The idea is provide a simple scene graph and animation api that is capable of support HTML/CSS style layer composition. That means:

  • CSS keyframe inspired animation system
  • CSS inspired filters (grayscale, blur, etc)
  • (not the css parsing and logic itself, just the rendering and animation primitives for it)
  • only textures and rects
  • "dumb" 3D support
    • Sort center of layers front to back and render them (like chrome does)
    • Could in theory be expanded to proper 3D, but
  • replacable backends to handle windowsystem/eventloop/input
    • optional backend code to hardware compositor

Right now this project is not stable, not very functional, hard to use and very much work in progress, but I'm having fun :)

Now go look at something else...

Optional dependences include:

  • Qt: for the Qt based backend, the default
  • SDL2: for the SDL 2 based backend, enable using 'cmake -DRENGINE_USE_SDL=on'

todo

lots and lots...

  • OpenGL renderer
    • antialiased edges -> rely on MSAA for now, though this is slow on intel chips
    • provide effects both as 'live' in the tree and 'static' as a means of producing a Texture instance.
    • caching of non-changing flattened subtrees to improve performance, especially on blurred subtrees
    • custom render node
  • add more properties to TextureNode
    • opacity
    • border and rounded edges? -> lets not for now...
  • API
    • Be consistent with use of 2D (mat4::translate2D) and 2d (rect2d)
    • Change: T *Node::from(Node *) -> static T *T::from(Node *);
    • Combined matrices are hard in the animation system, for instance, setting up a rotation around a point x,y requires two nodes right now. One for the offset and one to run the animation on.
  • input, both keyboard, touch and mouse
    • keyboard input missing
    • basic pointer support in place, but lacking multitouch
  • property api needs to improve
    • Property takes up 32 bytes: 4 from float, 24 from std::vector, 4 bytes of padding
    • both signal and property's disconnect are broken, as the id is an integer removing one in the middle will invalidate all ids after that position... doh!

overview of the dependencies between source directories

include/rengine.h

  • main include file, used by all applications

include/common

  • Utility classes used throughout
  • no dependencies, can be used stand alone

include/scenegraph

  • The scene graph and default OpenGL renderer
  • depends on src/common

include/animation

  • The animation system
  • no dependences, can be used stand alone

include/windowsystem

  • The windowsystem/display/screen interfaces
  • depends on src/common

include/backend/

  • Implementation of backends -> qt/qtbackend.h: for qt one -> sdl/sdlbackend.h: for the sdl one

src/sailfish

  • Implementation of a Sailfish system (todo :)

3rdparty

  • stb headers for reading and writing

tests

  • tst_keyframes: tests for the animation system
  • tst_mathtypes: unit tests for the math classes
  • tst_node: unit tests for node classes
  • tst_property: unit tests for the property concept
  • tst_render: unit tests for rendering
  • tst_signal: unit tests for the signal concept

examples - The examples are simple snippets meant to illustrate how a concept works

  • ex_benchmark_rectangles: benchmark on creating/destroying 1000 rects per frame, including rendering
  • ex_blur: shows the blurring
  • ex_filters: shows how color filtering works
  • ex_layeredopacity: shows layered opacity
  • ex_rectangles: shows to render with 3D projection
  • ex_shadow: shows drop shadow

rengine's People

Contributors

sletta avatar rburchell avatar

Stargazers

Zaki Mughal [sivoais] avatar HiGHROLLER'S  Hub avatar Akhil avatar Shrikant Dhumal avatar Jan Arve Sæther avatar

Watchers

James Cloos avatar Joona Petrell avatar  avatar  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.