diff options
author | Bastiaan Olij <mux213@gmail.com> | 2022-11-16 13:32:42 +1100 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2022-11-17 00:32:42 +1100 |
commit | 616ba8745fb475fa626dbbffbd34ebc47ae3dbea (patch) | |
tree | 6bf67bacd645cbb05238808015acb3882acbe769 /servers/rendering/renderer_rd/shaders/effects | |
parent | 5993209b2649c93b56789bfc243c5a6046ee77ce (diff) |
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 */ } |