Skip to content
Snippets Groups Projects
Unverified Commit fe8a9799 authored by Alexander Rose's avatar Alexander Rose Committed by GitHub
Browse files

add exposure parameter (#751)


* add exposure parameter

* add missing uniform

---------

Co-authored-by: default avatarDavid Sehnal <dsehnal@users.noreply.github.com>
parent 4f181546
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ Note that since we don't clearly distinguish between a public and private interf
- Fix occlusion artefact with non-canvas viewport and pixel-ratio > 1
- Update nodejs-shims conditionals to handle polyfilled document object in NodeJS environment.
- Ensure marking edges are at least one pixel wide
- Add exposure parameter to renderer
- Only trigger marking when mouse is directly over canvas
- Fix blurry occlusion in screenshots
......
......@@ -160,6 +160,7 @@ export const GlobalUniformSchema = {
uMarkerAverage: UniformSpec('f'),
uXrayEdgeFalloff: UniformSpec('f'),
uExposure: UniformSpec('f'),
uRenderMask: UniformSpec('i'),
uMarkingDepthTest: UniformSpec('b'),
......
......@@ -104,6 +104,7 @@ export const RendererParams = {
markerPriority: PD.Select(1, [[1, 'Highlight'], [2, 'Select']]),
xrayEdgeFalloff: PD.Numeric(1, { min: 0.0, max: 3.0, step: 0.1 }),
exposure: PD.Numeric(1, { min: 0.0, max: 3.0, step: 0.01 }),
light: PD.ObjectList({
inclination: PD.Numeric(150, { min: 0, max: 180, step: 1 }),
......@@ -242,6 +243,7 @@ namespace Renderer {
uMarkerAverage: ValueCell.create(0),
uXrayEdgeFalloff: ValueCell.create(p.xrayEdgeFalloff),
uExposure: ValueCell.create(p.exposure),
};
const globalUniformList = Object.entries(globalUniforms);
......@@ -787,6 +789,10 @@ namespace Renderer {
p.xrayEdgeFalloff = props.xrayEdgeFalloff;
ValueCell.update(globalUniforms.uXrayEdgeFalloff, p.xrayEdgeFalloff);
}
if (props.exposure !== undefined && props.exposure !== p.exposure) {
p.exposure = props.exposure;
ValueCell.update(globalUniforms.uExposure, p.exposure);
}
if (props.light !== undefined && !deepEqual(props.light, p.light)) {
p.light = props.light;
......
/**
* Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2017-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*
......@@ -65,4 +65,6 @@ export const apply_light_color = `
#ifdef dXrayShaded
gl_FragColor.a *= 1.0 - pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);
#endif
gl_FragColor.rgb *= uExposure;
`;
\ No newline at end of file
......@@ -72,6 +72,7 @@ uniform vec3 uInteriorColor;
bool interior;
uniform float uXrayEdgeFalloff;
uniform float uExposure;
uniform mat4 uProjection;
......
......@@ -75,6 +75,7 @@ uniform vec3 uFogColor;
uniform float uAlpha;
uniform bool uTransparentBackground;
uniform float uXrayEdgeFalloff;
uniform float uExposure;
uniform int uRenderMask;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment