quakeforge/libs/video/renderer/vulkan/shader/infplane.finc
Bill Currie fde1ef0159 [vulkan] Add infinite plane rendering
The grid calculations are modified from those of Inigo Quilez
(https://iquilezles.org/articles/filterableprocedurals/), but give very
nice results: when thin enough, the lines fade out nicely instead of
producing crazy moire patterns. Though currently disabled, the default
planes are the xy, yz and zx planes with colored axes.
2023-07-21 11:59:25 +09:00

5 lines
109 B
Text

vec4 plane_st (mat3 plane, mat3 cam, vec3 vec)
{
vec3 i = plane * (cam * vec);
return vec4 (i/i.z, i.z);
}