fix an issue where the reinhard tonemapper reacted to the rendering progress indicators
parent
f02f0ac801
commit
cd435d8166
|
@ -1727,6 +1727,9 @@ void MainWindow::onWorkBegin(const RenderJob *job, const RectangularWorkUnit *wu
|
||||||
void MainWindow::drawVisualWorkUnit(SceneContext *context, const VisualWorkUnit &vwu) {
|
void MainWindow::drawVisualWorkUnit(SceneContext *context, const VisualWorkUnit &vwu) {
|
||||||
int ox = vwu.offset.x, oy = vwu.offset.y,
|
int ox = vwu.offset.x, oy = vwu.offset.y,
|
||||||
ex = ox + vwu.size.x, ey = oy + vwu.size.y;
|
ex = ox + vwu.size.x, ey = oy + vwu.size.y;
|
||||||
|
if (vwu.size.x < 3 || vwu.size.y < 3)
|
||||||
|
return;
|
||||||
|
|
||||||
const float *color = NULL;
|
const float *color = NULL;
|
||||||
|
|
||||||
/* Use desaturated colors to highlight the host
|
/* Use desaturated colors to highlight the host
|
||||||
|
@ -1754,17 +1757,22 @@ void MainWindow::drawVisualWorkUnit(SceneContext *context, const VisualWorkUnit
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vwu.size.x < 3 || vwu.size.y < 3)
|
float scale = .7f * (color[0] * 0.212671f + color[1] * 0.715160f + color[2] * 0.072169f);
|
||||||
return;
|
|
||||||
|
|
||||||
drawHLine(context, ox, oy, ox + 3, color);
|
float ncol[3] = {
|
||||||
drawHLine(context, ex - 4, oy, ex - 1, color);
|
color[0]*scale,
|
||||||
drawHLine(context, ox, ey - 1, ox + 3, color);
|
color[1]*scale,
|
||||||
drawHLine(context, ex - 4, ey - 1, ex - 1, color);
|
color[2]*scale
|
||||||
drawVLine(context, ox, oy, oy + 3, color);
|
};
|
||||||
drawVLine(context, ex - 1, oy, oy + 3, color);
|
|
||||||
drawVLine(context, ex - 1, ey - 4, ey - 1, color);
|
drawHLine(context, ox, oy, ox + 3, ncol);
|
||||||
drawVLine(context, ox, ey - 4, ey - 1, color);
|
drawHLine(context, ex - 4, oy, ex - 1, ncol);
|
||||||
|
drawHLine(context, ox, ey - 1, ox + 3, ncol);
|
||||||
|
drawHLine(context, ex - 4, ey - 1, ex - 1, ncol);
|
||||||
|
drawVLine(context, ox, oy, oy + 3, ncol);
|
||||||
|
drawVLine(context, ex - 1, oy, oy + 3, ncol);
|
||||||
|
drawVLine(context, ex - 1, ey - 4, ey - 1, ncol);
|
||||||
|
drawVLine(context, ox, ey - 4, ey - 1, ncol);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onWorkCanceled(const RenderJob *job, const Point2i &offset, const Vector2i &size) {
|
void MainWindow::onWorkCanceled(const RenderJob *job, const Point2i &offset, const Vector2i &size) {
|
||||||
|
|
|
@ -3,9 +3,10 @@ uniform float multiplier;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 color = texture2D(source, gl_TexCoord[0].xy);
|
vec4 color = texture2D(source, gl_TexCoord[0].xy);
|
||||||
float luminance = multiplier * (color.r * 0.212671 + color.g * 0.715160 + color.b * 0.072169);
|
float luminance = color.r * 0.212671 + color.g * 0.715160 + color.b * 0.072169;
|
||||||
if (luminance < 0.0 || luminance != luminance || luminance == 1024.0)
|
if (luminance < 0.0 || luminance != luminance || luminance == 1024.0 || abs(luminance-.7) < 1e-4)
|
||||||
luminance = 0.0; // catch NaNs, negatives, and the Mitsuba banner
|
luminance = 0.0; // catch NaNs, negatives, and the Mitsuba banner
|
||||||
|
luminance = luminance * multiplier;
|
||||||
float logLuminance = log(1e-3 + luminance);
|
float logLuminance = log(1e-3 + luminance);
|
||||||
gl_FragColor = vec4(logLuminance, luminance, 0.0, 1.0);
|
gl_FragColor = vec4(logLuminance, luminance, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue