Skip to content

Commit 7c03a8d

Browse files
authored
Merge pull request #264 from De-Panther/chromakeyunlit_lighting_threshold
Lighting after threshold test in ChromaKeyUnlit
2 parents be2a2cb + 1a512f7 commit 7c03a8d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Packages/webxr-interactions/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Added
1010
- An option to set pickup buttons in ControllerInteraction.
1111

12+
### Fixed
13+
- Lighting after threshold test in ChromaKeyUnlit.
14+
1215
## [0.16.3] - 2023-02-08
1316
### Fixed
1417
- SceneHitTest right controller issue.

Packages/webxr-interactions/Runtime/Shaders/ChromaKeyUnlit.shader

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ Shader "WebXR Mixed Reality Capture/Chroma Key Unlit" {
5858
fixed4 frag (v2f i) : SV_Target
5959
{
6060
fixed4 ligthing = tex2D(_LightingTex, i.texcoord2);
61-
fixed4 color = tex2D(_MainTex, i.texcoord) * ligthing * _Color;
61+
fixed4 color = tex2D(_MainTex, i.texcoord) * _Color;
6262
if (_ThresholdMin.r <= color.r && color.r <= _ThresholdMax.r
6363
&&_ThresholdMin.g <= color.g && color.g <= _ThresholdMax.g
6464
&&_ThresholdMin.b <= color.b && color.b <= _ThresholdMax.b)
6565
{
6666
color.a = 0;
6767
}
68+
color = color * ligthing;
6869
UNITY_APPLY_FOG(i.fogCoord, color);
6970
return color;
7071
}

0 commit comments

Comments
 (0)