add variant of reinhard-jodie similar looking to linear that dies on bright stuff

This commit is contained in:
Xonk
2025-09-06 22:02:27 -04:00
parent 7f925237ea
commit 3333e4caaf
+12 -4
View File
@@ -197,10 +197,6 @@ vec3 Full_Reinhard_Edit(vec3 C){
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
vec3 reinhard_jodie(vec3 color)
{
// i edited it to add whitepoint control
// float whitePoint = 10.0;
// color *= (1.0 + color / (whitePoint*whitePoint));
color *= 1.5;
vec3 tonemapLuminance = color / (1.0 + dot(color, vec3(0.21, 0.72, 0.07)));
vec3 tonemapRGB = color / (1.0 + color);
@@ -208,6 +204,18 @@ vec3 reinhard_jodie(vec3 color)
// small weight because i dont want bright colors to be *too* colorful
return mix(tonemapLuminance, tonemapRGB, tonemapRGB*0.8+0.2);
}
vec3 reinhard_jodie_ruined(vec3 color)
{
// i edited it to add whitepoint control
float whitePoint = 1.0;
color *= (1.0 + color / (whitePoint*whitePoint));
vec3 tonemapLuminance = color / (1.0 + dot(color, vec3(0.21, 0.72, 0.07)));
vec3 tonemapRGB = color / (1.0 + color);
// small weight because i dont want bright colors to be *too* colorful
return mix(tonemapLuminance, tonemapRGB, tonemapRGB*0.8+0.2);
}
vec3 no_tonemapper(vec3 color){
return color;