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/edit_normals_vert.glsl
Brecht Van Lommel c06bd2d184 Fix T64499: edit mode display glitch on Intel HD 4x00 and Windows 7/8
There may well be more vertex shaders that need this, but I couldn't find them
in my testing.

Differential Revision: https://developer.blender.org/D4921
2019-05-22 08:32:39 +02:00

37 lines
593 B
GLSL

uniform float normalSize;
in vec3 pos;
#ifdef LOOP_NORMALS
in vec3 lnor;
# define nor lnor
#elif defined(FACE_NORMALS)
in vec4 norAndFlag;
# define nor norAndFlag.xyz
#else
in vec3 vnor;
# define nor vnor
#endif
flat out vec4 v1;
flat out vec4 v2;
void main()
{
GPU_INTEL_VERTEX_SHADER_WORKAROUND
vec3 n = normalize(normal_object_to_world(nor));
vec3 world_pos = point_object_to_world(pos);
v1 = point_world_to_ndc(world_pos);
v2 = point_world_to_ndc(world_pos + n * normalSize);
#ifdef USE_WORLD_CLIP_PLANES
world_clip_planes_calc_clip_distance(world_pos);
#endif
}