Encode71 and Decode71 in DeferredShadingCommon.ush are functions that convert 8-bit values to 7-bit values and mask values, and licensees have reported that the accuracy is insufficient when using the Decode71 function.
According to licensees, correct results can be obtained by changing the return part of Decode71() to the same processing as Encode() as shown below.
// return (Scalar - 0.5f * Mask) * 2.0f; return (Scalar - (128.0f / 255.0f) * Mask) * (255.0f / 127.0f);
Results
Input scalar: 0.7777, mask: 0
Output scalar: 0.7777, mask: 0
[Image Removed]
Input scalar: 0.7777, mask: 1
Input scalar: 0.7777, mask: 1
Results
Input scalar: 0.7777, mask: 0
Output scalar: 0.7746, mask: 0
[Image Removed]
Input scalar: 0.7777, mask: 1
Output scalar: 0.7785, mask: 1
[Image Removed]
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-294750 in the post.
0 |
Component | UE - Rendering Architecture - Shaders |
---|---|
Affects Versions | 5.6 |
Created | Jun 5, 2025 |
---|---|
Updated | Jun 6, 2025 |