mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-24 12:42:32 +00:00
[vulkan] Clear position.w to zero
This puts pixels that have not been rendered at infinity. I was rather surprised to see fog in my test scene, but it depended on my position relative to the origin, so something was definitely off (the pixels were at the origin).
This commit is contained in:
parent
c1b38196d1
commit
085f56367d
2 changed files with 5 additions and 2 deletions
|
@ -2074,6 +2074,9 @@ renderpasses = {
|
|||
@inherit = $attachment_base;
|
||||
format = $images.cube_position.format;
|
||||
view = cube_position;
|
||||
clearValue = {
|
||||
color = { int32 = ( 0, 0, 0, 0); };
|
||||
};
|
||||
};
|
||||
light = {
|
||||
@inherit = $attachment_base;
|
||||
|
|
|
@ -25,10 +25,10 @@ main (void)
|
|||
vec3 c = subpassLoad (color).rgb;
|
||||
vec3 l = subpassLoad (light).rgb;
|
||||
vec3 e = subpassLoad (emission).rgb;
|
||||
vec3 p = subpassLoad (position).xyz;
|
||||
vec4 p = subpassLoad (position);
|
||||
vec3 o = max(BlendFrags (vec4 (c * l + e, 1)).xyz, vec3(0));
|
||||
|
||||
float d = length (p - camera.xyz);
|
||||
float d = p.w > 0 ? length (p.xyz - camera.xyz) : 1e36;
|
||||
o = FogBlend (vec4(o,1), fog, d).xyz;
|
||||
o = pow (o, vec3(0.83));//FIXME make gamma correction configurable
|
||||
frag_color = vec4 (o, 1);
|
||||
|
|
Loading…
Reference in a new issue