Skip to content

Commit 3d04eb8

Browse files
Fixed the emissive being overriden by ray traced sub-surface scattering (case 1364456). (#5636)
* Fixed the emissive being overriden by ray traced sub-surface scattering (case 1364456). * updating doc * Fix formatting Co-authored-by: sebastienlagarde <[email protected]>
1 parent ff16acf commit 3d04eb8

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3636
- Fixed error when disabling opaque objects on a camera with MSAA.
3737
- Fixed double camera preview.
3838
- Fixed the volumetric clouds cloud map not being centered over the world origin (case 1364465).
39+
- Fixed the emissive being overriden by ray traced sub-surface scattering (case 1364456).
3940

4041
### Changed
4142
- Visual Environment ambient mode is now Dynamic by default.

com.unity.render-pipelines.high-definition/Documentation~/Ray-Traced-Subsurface-Scattering.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ Ray traced subsurface scattering uses the [Volume](Volumes.md) framework, so to
1919
| Property | Description |
2020
| -------------- | ------------------------------------------------------------ |
2121
| **Sample Count** | Defines the number of samples that are cast per pixel to evaluate the subsurface scattering lighting. |
22+
23+
## Limitations
24+
* Emissive surfaces are incompatible with ray traced sub-surface scattering.

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRayTracingSubSurface.hlsl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ void ClosestSubSurface(inout RayIntersectionSubSurface rayIntersection : SV_RayP
3030
bool isVisible;
3131
GetSurfaceAndBuiltinData(fragInput, -incidentDirection, posInput, surfaceData, builtinData, currentVertex, rayIntersection.cone, isVisible);
3232

33-
// make sure we output the normal and the indirect diffuse lighting value
33+
// make sure we output the normal
3434
rayIntersection.outNormal = fragInput.tangentToWorld[2];
35-
rayIntersection.outIndirectDiffuse = builtinData.bakeDiffuseLighting;
35+
// Make sure to output the indirect diffuse lighting value and the emissive value
36+
rayIntersection.outIndirectDiffuse = builtinData.bakeDiffuseLighting + builtinData.emissiveColor;
3637
}

0 commit comments

Comments
 (0)