EEVEE Next: Subsurface Scattering #107407
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#107407
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "pragma37/blender:pull-eevee-next-sss"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Port of subsurface scattering from the eevee-rewrite branch to EEVEE Next.
https://projects.blender.org/fclem/blender/src/branch/eevee-rewrite
Other changes:
Known Issues:
@ -392,0 +395,4 @@
if (closure_bits_ & CLOSURE_SSS) {
inst_.subsurface.end_sync();
subsurface_ps_.init();
This subsurface pass should go inside
SubsurfaceModule
.Note that, currently, the subsurface algorithm is quite simple, we might extend it in the future. Making everything in one place will avoid much trouble later on.
You can init the pass in all cases and only submit it if the closure bit is present.
@ -183,0 +184,4 @@
.define("SSS_TRANSMITTANCE")
.sampler(SSS_TRANSMITTANCE_TEX_SLOT, ImageType::FLOAT_1D, "sss_transmittance_tx");
GPU_SHADER_CREATE_INFO(eevee_subsurface_eval)
Move subsurface infos to their own file.
e26cef6b9d
to1d28e81235
The PR has been discussed on blender.chat.
I find the code to a level that it is fine to land in main.
It is a bit difficult to guess what is causing this energy difference. I would say add a corrective factor that you empirically fit the best you can and leave a comment saying this is a workaround and should be fixed at some point.
There were many places where I did that in the past. It is better to break scenes by correcting a 2% energy error than a 50% energy error (given it is only a scaling issue).
I would also like to point out that it is still broken on Metal. But it is a problem for the Metal backend and should not hold this patch from landing.
@ -97,2 +97,4 @@
#define SHADOW_RENDER_MAP_SLOT 13
#define RBUFS_UTILITY_TEX_SLOT 14
#define HIZ_TEX_SLOT 15
#define SSS_TRANSMITTANCE_TEX_SLOT 16
Do not use slot 16 (or anything above slot 15). It is not available in all implementations.
@ -0,0 +50,4 @@
subsurface_ps_.bind_texture("gbuffer_closure_tx", &inst_.gbuffer.closure_tx);
subsurface_ps_.bind_texture("gbuffer_color_tx", &inst_.gbuffer.color_tx);
subsurface_ps_.bind_ubo(RBUFS_BUF_SLOT, &inst_.render_buffers.data);
subsurface_ps_.bind_image(RBUFS_COLOR_SLOT, &inst_.render_buffers.rp_color_tx);
Also bind
RBUFS_VALUE_SLOT
otherwise it will trigger a warning / validation error.I've added a workaround so the values are closer to the Cycles ones, and mentioned the issue in the code comments. :(
I've also set the default thickness value to 0 so the result for very thin geometry matches Cycles and the current EEVE implementation better.
I've also "fixed" the texture slots issue, but I think we should look for a better solution.
I've opened another PR with one possible option: #108984
I am not sure if changing the default thickness to 0 is a good thing. This thickness it to avoid the ringing artifact caused by shadow map imprecision. The default is a good one for default settings and object size. Maybe we can make it 0.05 but clearly not 0.
Otherwise the patch can land.
WIP: EEVEE Next: Subsurface Scatteringto EEVEE Next: Subsurface Scattering