From 7d01e0349b341a987dfbbe3725ac189240091e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EB=8B=A4=EB=8B=88=EC=97=98=28Daniel=20Cho=29?= Date: Fri, 7 Jul 2023 17:54:04 +0900 Subject: [PATCH] Fix rendering issue when using DoF --- filament/src/materials/dof/dof.mat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filament/src/materials/dof/dof.mat b/filament/src/materials/dof/dof.mat index cdf59458cd..b6bb5b1ea7 100644 --- a/filament/src/materials/dof/dof.mat +++ b/filament/src/materials/dof/dof.mat @@ -477,6 +477,7 @@ void fastTile(inout vec4 color, inout float alpha, } alpha = cocToAlpha(kernelSize); color *= rcp(sampleCount(ringCountFast)); + color = min(vec4(MEDIUMP_FLT_MAX), color); } void foregroundTile(inout vec4 foreground, inout float fgOpacity, @@ -658,6 +659,7 @@ void postProcess(inout PostProcessInputs postProcess) { // the downside of doing this is that we couldn't use a different upscaler for each // layer, but this is a lot less costly postProcess.color = foreground + (1.0 - fgOpacity) * background; + postProcess.color = min(vec4(MEDIUMP_FLT_MAX), postProcess.color); postProcess.alpha = fgOpacity + (1.0 - fgOpacity) * bgOpacity; }