Solution after dimming after edl

Since edl is similar to ssao, it will become darker. At this time, when adjusting the brightness, it can be similar to hdr, high dynamic range to LDR, but without tone mapping, and the rgb components can be increased by the same ratio at the same time. This will both brighten and not spill, or not change the color. (Of course, there may be something like dark green turning light green, but the visual effect is okay.)

This is what learn opengl looks like,
vec3 mapped = hdrColor / (hdrColor + vec3(1.0));

From now on, you can learn from it, and you can calculate the three components of rgb separately

比如
vec3 hdrColor=vec3( r* 10,g10,b10),
float scaleA = hdrColor.r / (hdrColor.r+1);
float scaleB = hdrColor.g / (hdrColor.g+1);
float scaleC = hdrColor.b / (hdrColor.b+1);

Obviously, scaleA, scaleB, and scaleC are often not equal. Just take the same value, such as the smallest
float scale = min(min(scaleA,scaleB),scaleC);

vec3 finalColor = (scaler,scaleg,scale*b);

Alternatively, it is possible to pass the shadow factor at the alpha of the edl, without multiplying the factor within a certain threshold, (say, <0.25) to keep sharp edges at the end.

Guess you like

Origin blog.csdn.net/directx3d_beginner/article/details/132095715