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/volumetric_geom.glsl
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00

73 lines
1.1 KiB
GLSL

#ifdef MESH_SHADER
/* TODO tight slices */
layout(triangles) in;
layout(triangle_strip, max_vertices = 3) out;
#else /* World */
layout(triangles) in;
layout(triangle_strip, max_vertices = 3) out;
#endif
in vec4 vPos[];
flat out int slice;
#ifdef MESH_SHADER
/* TODO tight slices */
void main()
{
gl_Layer = slice = int(vPos[0].z);
# ifdef USE_ATTR
pass_attr(0);
# endif
gl_Position = vPos[0].xyww;
EmitVertex();
# ifdef USE_ATTR
pass_attr(1);
# endif
gl_Position = vPos[1].xyww;
EmitVertex();
# ifdef USE_ATTR
pass_attr(2);
# endif
gl_Position = vPos[2].xyww;
EmitVertex();
EndPrimitive();
}
#else /* World */
/* This is just a pass-through geometry shader that send the geometry
* to the layer corresponding to it's depth. */
void main()
{
gl_Layer = slice = int(vPos[0].z);
# ifdef USE_ATTR
pass_attr(0);
# endif
gl_Position = vPos[0].xyww;
EmitVertex();
# ifdef USE_ATTR
pass_attr(1);
# endif
gl_Position = vPos[1].xyww;
EmitVertex();
# ifdef USE_ATTR
pass_attr(2);
# endif
gl_Position = vPos[2].xyww;
EmitVertex();
EndPrimitive();
}
#endif