This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl
Clément Foucault 5c67ac2236 Eevee: Add special shader for depth prespass.
This way we can extend it to output more data (like motion vectors).
Add a variation that uses clip distances.
2017-06-19 10:47:56 +02:00

19 lines
375 B
GLSL

uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelMatrix;
#ifdef CLIP_PLANES
uniform vec4 ClipPlanes[1];
#endif
in vec3 pos;
void main()
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
#ifdef CLIP_PLANES
vec4 worldPosition = (ModelMatrix * vec4(pos, 1.0));
gl_ClipDistance[0] = dot(worldPosition, ClipPlanes[0]);
#endif
/* TODO motion vectors */
}