This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/gpu/shaders/material/gpu_shader_material_camera.glsl
Clément Foucault b568f445a5 Fix T98647: EEVEE: Camera Data Node's View Vector Broken
Fix regression and remove duplicated computation.
2022-06-07 18:14:16 +02:00

9 lines
215 B
GLSL

void camera(out vec3 outview, out float outdepth, out float outdist)
{
vec3 vP = transform_point(ViewMatrix, g_data.P);
vP.z = -vP.z;
outdepth = abs(vP.z);
outdist = length(vP);
outview = normalize(vP);
}