Coder Social home page Coder Social logo

lmb's Introduction

LMB

LMB is a c++ library that bakes lightmaps. The library is flexible and extendable and it also supports multithreading. LMB supports direct lighting, ambient occlusion, indirect lighting, denoising and more to come in the future.You can also extend the features on your own fairly easily.

Third Party Libraries

Known Bugs

  • Light leak from directional light on transparent surface: light leak

Build

  1. Copy glm,SDL2,stb include folder to location third_party/includes/

  2. Copy SDL2 bin library to location third_party/libs/SDL2/

Release build:

$ sh build_release.sh

Debug build:

$ sh build_debug.sh

CMake build:

cmake -S ./ -B build/

Usage

Example: src/lmb_example/

Example how to calculate ao:

#include <lmb/lmb.h>

int main()
{
    //initiate library
    LMB::Init();

    //create a lmb session
    auto lmb_session = 
    std::make_shared<LMB::LMBSession>();

    //create a solver
    auto solver = 
    std::make_shared<LMB::KDTreeSolver>();

    //create calculator
    auto calc_ao =
    std::make_shared<LMB::AOCalculator>(default_ao_config);

    //set the blending function
    calc_ao->SetBlend(std::make_shared<LMB::CalcBlendSet>());

    //set the solver and calculator
    //!if you already set a solver/calculator on another lmb session the solver/calculator wont be set
    lmb_session->SetSolver(solver);
    lmb_session->SetCalculator(calc_ao);

    //starts calculating async
    lmb_session->StartCalc();

    //waits for the end of calculation
    lmb_session->EndCalc();

    //you can use lmb_session->GetLightmaps() to get the final lightmaps


    //terminate library
    LMB::Term();

    return 0;
}

Result Screen Shots

  • Direct lighting,Indirect lighting,Ambient Occlusion: screenshot screenshot
  • Direct lighting,Indirect lighting,Ambient Occlusion,Denoising: screenshot screenshot
  • Direct lighting,Indirect lighting,Ambient Occlusion,Denoising,Transparency: screenshot screenshot

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.