Fix: EEVEE: runtime-generated BSDF LUT does not match the precomputed LUT #111632

Merged
Weizhen Huang merged 4 commits from weizhen/blender:recompute-eevee-bsdf-lut into main 2023-08-29 15:22:44 +02:00
Member
  • RUNTIME_LUT_CREATION is disabled by default, but if set to true,
    the new bxdf_lut_frag.glsl should generate the LUT that is submitted
    in this commit. This new LUT is very close to the previously stored one.
  • Generate the LUT by Monte-Carlo sampling with I = 1/N\sum\frac{f}{p},
    except that the samples are not random, but mapped from a regular grid,
    following previous approach to avoid interpolation artefacts caused by
    noise.
  • Added comments to make the computed quantities and the LUT usage more
    clear.
  • Glass with IOR < 1 is now slightly darker due to single-scattering.
    The lost energy will be recovered in a future commit.
  • The special cases of IOR == 0, roughness == 0 and roughness == 1
    are handled well during microfacet sampling and evaluation, no need to
    clamp.
  • When IOR == 1, in theory BRDF is zero and BTDF is one, but we do not
    make it a special case to allow smooth transition.
* `RUNTIME_LUT_CREATION` is disabled by default, but if set to `true`, the new `bxdf_lut_frag.glsl` should generate the LUT that is submitted in this commit. This new LUT is very close to the previously stored one. * Generate the LUT by Monte-Carlo sampling with \(I = 1/N\sum\frac{f}{p}\), except that the samples are not random, but mapped from a regular grid, following previous approach to avoid interpolation artefacts caused by noise. * Added comments to make the computed quantities and the LUT usage more clear. * Glass with `IOR < 1` is now slightly darker due to single-scattering. The lost energy will be recovered in a future commit. * The special cases of `IOR == 0`, `roughness == 0` and `roughness == 1` are handled well during microfacet sampling and evaluation, no need to clamp. * When `IOR == 1`, in theory BRDF is zero and BTDF is one, but we do not make it a special case to allow smooth transition.
Weizhen Huang added 1 commit 2023-08-28 20:32:12 +02:00
eb268dcaee Fix: EEVEE: runtime-generated BSDF LUT does not match the precomputed LUT
* `RUNTIME_LUT_CREATION` is disabled by default, but if set to `true`,
the new `bxdf_lut_frag.glsl` should generate the LUT that is submitted
in this commit. This new LUT is very close to the previously stored one.
* Generate the LUT by Monte-Carlo sampling with I = 1/N \sum f/pdf,
except that the samples are not random, but mapped from a regular grid,
following previous approach to avoid interpolation artefacts caused by
noise.
* Added comments to make the computed quantities and the LUT usage more
clear.
* Glass with `IOR < 1` is now slightly darker due to single-scattering.
The lost energy will be recovered in a future commit.
Weizhen Huang added the
Module
EEVEE & Viewport
label 2023-08-28 20:35:32 +02:00
Weizhen Huang requested review from Clément Foucault 2023-08-28 20:35:44 +02:00
Clément Foucault reviewed 2023-08-28 20:46:45 +02:00
Clément Foucault left a comment
Member

Code looks good. Maybe you could use square in many places in these files. I still have to test the changes.

Code looks good. Maybe you could use `square` in many places in these files. I still have to test the changes.
Clément Foucault approved these changes 2023-08-29 13:44:53 +02:00
Weizhen Huang added 2 commits 2023-08-29 14:48:01 +02:00
Clément Foucault approved these changes 2023-08-29 14:49:54 +02:00
Clément Foucault approved these changes 2023-08-29 14:50:03 +02:00
Weizhen Huang added 1 commit 2023-08-29 15:20:53 +02:00
Weizhen Huang merged commit 9fba9f418d into main 2023-08-29 15:22:44 +02:00
Weizhen Huang deleted branch recompute-eevee-bsdf-lut 2023-08-29 15:22:46 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111632
No description provided.