All Projects → HectorMF → BRDFGenerator

HectorMF / BRDFGenerator

Licence: MIT license
BRDF LUT generation for PBR Pipelines

Programming Languages

HTML
75241 projects
C++
36643 projects - #6 most used programming language
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
CMake
9771 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to BRDFGenerator

Vxr
General purpose engine written in C++ with emphasis on materials rendering (PBR, clear coat, anisotropy, iridescence)
Stars: ✭ 181 (+86.6%)
Mutual labels:  graphics-programming, pbr, physically-based-rendering
pbrtbook
pbrt 中文整合翻译 基于物理的渲染:从理论到实现 Physically Based Rendering: From Theory To Implementation
Stars: ✭ 221 (+127.84%)
Mutual labels:  pbr, physically-based-rendering, pbrt
Cluster
Clustered shading implementation with bgfx
Stars: ✭ 180 (+85.57%)
Mutual labels:  pbr, physically-based-rendering
gamedevguide
Game Development & Unreal Engine Programming Guide
Stars: ✭ 314 (+223.71%)
Mutual labels:  graphics-programming, graphics-rendering
Softwarerenderer
Software rendering engine with PBR. Built from scratch on C++.
Stars: ✭ 323 (+232.99%)
Mutual labels:  graphics-programming, physically-based-rendering
Quartz
Vulkan RTX path tracer with a declarative ES7-like scene description language.
Stars: ✭ 367 (+278.35%)
Mutual labels:  pbr, physically-based-rendering
Pbr
An implementation of physically based shading & image based lighting in D3D11, D3D12, Vulkan, and OpenGL 4.
Stars: ✭ 722 (+644.33%)
Mutual labels:  pbr, physically-based-rendering
xfg-rs
eXtensible Framegraph
Stars: ✭ 34 (-64.95%)
Mutual labels:  graphics-programming, graphics-rendering
isosurface
Isosurface extraction using Marching Cubes and pure WebGL.
Stars: ✭ 66 (-31.96%)
Mutual labels:  graphics-programming, graphics-rendering
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+2108.25%)
Mutual labels:  graphics-programming, pbr
Renderer
A shader-based software renderer written from scratch in C89
Stars: ✭ 1,366 (+1308.25%)
Mutual labels:  graphics-programming, pbr
Godot Texture Painter
A GPU-accelerated texture painter written in Godot 3.0
Stars: ✭ 155 (+59.79%)
Mutual labels:  graphics-programming, physically-based-rendering
ElkEngine
Simple graphics engine used as submodule in many of my projects
Stars: ✭ 54 (-44.33%)
Mutual labels:  graphics-rendering, physically-based-rendering
Pbr White Paper
⚡️基于物理的渲染(PBR)白皮书 | White Paper of Physically Based Rendering(PBR)
Stars: ✭ 780 (+704.12%)
Mutual labels:  pbr, physically-based-rendering
Hybridrenderingengine
Clustered Forward/Deferred renderer with Physically Based Shading, Image Based Lighting and a whole lot of OpenGL.
Stars: ✭ 563 (+480.41%)
Mutual labels:  graphics-programming, physically-based-rendering
Arcane Engine
3D C/C++ Game Engine - Created By Brady Jessup
Stars: ✭ 242 (+149.48%)
Mutual labels:  graphics-programming, physically-based-rendering
software-development-resources
Collection of links to great software development resources!
Stars: ✭ 20 (-79.38%)
Mutual labels:  graphics-programming, graphics-rendering
nautilus
another graphics engine
Stars: ✭ 16 (-83.51%)
Mutual labels:  graphics-programming
RayTracing
Realtime GPU Path tracer based on OpenCL and OpenGL
Stars: ✭ 120 (+23.71%)
Mutual labels:  pbr
harfang3d
HARFANG 3D source code public repository
Stars: ✭ 173 (+78.35%)
Mutual labels:  pbr

BRDF Generator

This is a simple program that generates Smith GGX BRDF lookup tables for the split sum approximation of the UE4-based PBR pipeline. These lookup tables are stored in KTX or DDS texture. The program generates two channel(RG) images using either 16 bit or 32 bit floating point precision.

Note: It is important to use a floating point image to prevent clamping of values in your PBR pipeline.  
For most applications 16 bits is sufficient.  

Since this table is used for an approximation, some errors are introduced into the final renderings. The top image shows the reference path traced rendering, the middle shows a split sum approximation and the bottom shows the full approximation where N=V.

When loading the texture into OpenGL, use the following filters to ensure that values are read correctly.

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

More Reading:

Usage

BRDFGenerator -f [filename] -s [size] -n [samples] -b [bits]

Options:

-f [filename] The location and filename of the output image.  Must have an extension of ktx or dds.
-s [size] The size of the image in pixels per side. i.e. 512 will generate a 512x512 image. 
-n [samples] The number of BRDF samples per pixel. 
-b [bits]  The number of floating point bits used to store the data.  Can be either 16 or 32.

Algorithm

For each pixel (x, y):
   Compute roughness (0 to 1.0) based on pixel x coordinate.
   Compute NoV (0 to 1.0) based on pixel y coordinate.
   Set view as float3(sqrt(1.0 - NoV * NoV), 0, NoV).
   Set normal as float3(0, 0, 1). 
   For each sample:
        Compute a Hammersely coordinate.
        Integrate number of importance samples for (roughness and NoV).
        Compute reflection vector L
        Compute NoL (normal dot light)
        Compute NoH (normal dot half)
        Compute VoH (view dot half)
        
        If NoL > 0
          Compute the geometry term for the BRDF given roughness squared, NoV, NoL
          Compute the visibility term given G, VoH, NoH, NoV, NoL
          Compute the fresnel term given VoH.
          Sum the result given fresnel, geoemtry, visibility.
   Average result over number of samples.

Built With

The project has two header based dependencies, GLI and GLM, they are currently stored in the ext folder.

  • GLM - Math Functions
  • GLI - Image Saving

License

This project is licensed under the MIT License - see the LICENSE file for details

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