Giter Site home page Giter Site logo

starry-lei / easy_pbr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ais-bonn/easy_pbr

0.0 0.0 0.0 279.65 MB

Lightweight Physically-Based Renderer designed for ease of use and fast prototyping

License: MIT License

C++ 62.17% Python 1.42% C 0.01% Makefile 0.02% CMake 23.99% GLSL 12.39%

easy_pbr's Introduction

EasyPBR

EasyPBR: A Lightweight Physically-Based Renderer
Radu Alexandru Rosu 1, Sven Behnke 1,
1University of Bonn, Autonomous Intelligent Systems

EasyPBR is a lightweight Physically-Based Renderer designed for ease of use and fast prototyping. It abstracts away most of the complexity of rendering allowing the user to display high quality images in only a couple of lines of code. By default, EasyPBR tries to choose parameters in order to best render a particular scene but if more control is needed, the whole rendering process is controllable through either a Python script or C++ program. EasyPBR is written in C++ and OpenGL and provides Python bindings to most of it's functionality.

Usage

An example of a python3 script which shows a single mesh using the default viewing parameters:

try:
    import torch
except ImportError:
    pass
from easypbr  import *

config_file="./config/default_params.cfg"

view=Viewer.create(config_file)
lucy = Mesh("./data/lucy.obj")
Scene.show(lucy, "lucy")

while True:
    view.update()

Alternatively, one can also start an empty viewer and dragging and dropping meshes on it:

./python/empty.py

One can also define their own mesh by filling up the vertices and faces vector:

view=Viewer.create()   #a viewer with no argument reads by default the parameters from "./config/default_params.cfg"

mesh=Mesh()     #create an empty mesh
mesh.V=[        #fill up the vertices of the mesh as a matrix of Nx3
    [0,0,0],
    [0,1,0],
    [1,0,0],
    [1.5,1.5,-1]
]
mesh.F=[        #fill up the faces as a Nx3 matrix of integers which point into mesh.V
    [0,2,1],
    [1,2,3]
]
mesh.m_vis.m_show_wireframe=True

Scene.show(mesh,"mesh")
while True:
    view.update()

An example of using EasyPBR from an external C++ application can be seen in ./examples/example_cpp

Features

  • Deferred rendering
  • Physically-based shading
  • Screen Space Ambient Occlusion (SSAO)
  • Shadow Mapping with Percentage Closer Filtering for soft shadows
  • Image Based Lighting (IBL) using HDR maps
  • Eye Dome Lighting for point cloud rendering
  • Various tonemapping operators (Rheinhard, Unreal, ACES)
  • Shader hotloading
  • Various modes of visualization (mesh, wireframe, point cloud, surfel)
  • Loading of multiple meshes formats (.obj, .ply, .pcd, .off)
  • Drag and drop of meshes and HDR maps directly in the viewer
  • Easy extension and usage from other packages

Install

Dependencies:

$ sudo apt-get install python3-pip python3-setuptools python3-numpy libglfw3-dev libboost-all-dev libeigen3-dev libpcl-dev libopencv-dev

Optional dependencies:

Allow for shader hotloading, so changes to .glsl files are automatically recompiled and used while the program is running:

$ sudo apt-get install libkqueue-dev

Build and install:

$ git clone --recursive https://github.com/RaduAlexandru/easy_pbr.git
$ cd easy_pbr
$ make

Troubleshoot:

If the GUI is too small or to big, enable the hidpi: true in the corresponding config file from easy_pbr/config.

The error libGL error: No matching fbConfigs or visuals found can be fixed with: export LIBGL_ALWAYS_INDIRECT=1

Examples

Various examples can be found in the ./examples folder. A short description of each one is given here. The various effects are achived through a combination of different .cfg file configurations and different setting established in the python file.

Name Description
Deferred Physically based rendering PBR demo preview Real-time rendering of a scene with 'physically-based' materials (GGX BRDF introduced in Microfacet Models for Refraction through Rough Surfaces, Walter et al., 2007), using deferred rendering and an HDR pipeline with bloom and SSAO.
Run with ./examples/pbr.py
Shadows and Ambient Occlusion Shadows and Ambient Occlusion
Run with ./examples/shadows.py
Bloom Bloom
Run with ./examples/bloom.py
Cloud render Cloud render
Eye-dome lighting and SSAO for shading

Citation

@inproceedings{rosu2021easypbr,
  title={EasyPBR: A Lightweight Physically-Based Renderer},
  author={Rosu, Radu Alexandru and Behnke, Sven},
  booktitle={Proc. of 16th International Conference on Computer Graphics Theory and Applications (GRAPP)},
  year={2021}
}

License

EasyPBR is provided under the terms of the MIT license (see LICENSE). We bundle various other libraries (see ./deps) which may have different licenses.

easy_pbr's People

Contributors

janquenzel avatar radualexandru 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.