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/modes/shaders/object_outline_prepass_vert.glsl
Clément Foucault 3a08153d7a DRW: Refactor to support draw call batching
Reviewers: brecht

Differential Revision: D4997
2019-09-17 15:16:43 +02:00

30 lines
545 B
GLSL

in vec3 pos;
#ifdef USE_GEOM
out vec3 vPos;
out int objectId_g;
# define objectId objectId_g
#else
flat out int objectId;
#endif
void main()
{
vec3 world_pos = point_object_to_world(pos);
#ifdef USE_GEOM
vPos = point_world_to_view(world_pos);
#endif
gl_Position = point_world_to_ndc(world_pos);
/* Small bias to always be on top of the geom. */
gl_Position.z -= 1e-3;
/* ID 0 is nothing (background) */
objectId = resource_handle + 1;
#ifdef USE_WORLD_CLIP_PLANES
world_clip_planes_calc_clip_distance(world_pos);
#endif
}