Skip to content

Conversation

riccardobl
Copy link
Member

Khronos PBR Neutral Tone Map for jme. It is basically just this shader put in a filter with some adaptations.

It is a another standard algorithm for tone mapping, that is available also in blender, making it a better choice to have renders that are consistent with what you see in blender.

private static final float DEFAULT_GAMMA = 1.0f;

private final Vector3f exposure = new Vector3f(DEFAULT_EXPOSURE, DEFAULT_EXPOSURE, DEFAULT_EXPOSURE);
private final Vector3f gamma = new Vector3f(DEFAULT_GAMMA, DEFAULT_GAMMA, DEFAULT_GAMMA);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've used vectors here so it gives more artistic control, kinda doubling as color correction


float g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);
color = mix(color, newPeak * vec3(1, 1, 1), g);
color = pow(color, gamma);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik this is the order used in blender to apply gamma and exposure, but i am not 100% sure on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant