diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-18 16:19:22 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-18 16:19:22 +0100 |
commit | 58cb11b396fa3c424bec35d201df5e3d123c466a (patch) | |
tree | fde387980da0289d3dc3a90391a31d8c5586d624 /servers/rendering/renderer_rd/shaders/effects | |
parent | b1605c6d35139dab8b17eff3a6ce38fbdadaf89f (diff) | |
parent | 616ba8745fb475fa626dbbffbd34ebc47ae3dbea (diff) |
Merge pull request #68710 from BastiaanOlij/fix_vrs
Fix VRS issues
Diffstat (limited to 'servers/rendering/renderer_rd/shaders/effects')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/effects/vrs.glsl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/shaders/effects/vrs.glsl b/servers/rendering/renderer_rd/shaders/effects/vrs.glsl index 5ef83c0b44..b450bb9fe9 100644 --- a/servers/rendering/renderer_rd/shaders/effects/vrs.glsl +++ b/servers/rendering/renderer_rd/shaders/effects/vrs.glsl @@ -63,10 +63,18 @@ void main() { #ifdef MULTIVIEW vec4 color = textureLod(source_color, uv, 0.0); + frag_color = uint(color.r * 255.0); #else /* MULTIVIEW */ vec4 color = textureLod(source_color, uv, 0.0); -#endif /* MULTIVIEW */ - // See if we can change the sampler to one that returns int... - frag_color = uint(color.r * 256.0); + // for user supplied VRS map we do a color mapping + color.r *= 3.0; + frag_color = int(color.r) << 2; + + color.g *= 3.0; + frag_color += int(color.g); + + // note 1x4, 4x1, 1x8, 8x1, 2x8 and 8x2 are not supported + // 4x8, 8x4 and 8x8 are only available on some GPUs +#endif /* MULTIVIEW */ } |