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_empty_image_vert.glsl

37 lines
650 B
GLSL
Raw Normal View History

uniform vec2 aspect;
uniform float size;
uniform vec2 offset;
2017-05-20 22:57:47 +10:00
#ifdef USE_WIRE
uniform vec3 color;
2017-05-20 22:57:47 +10:00
#else
uniform vec4 objectColor;
2017-05-20 22:57:47 +10:00
#endif
in vec2 texCoord;
in vec2 pos;
2017-05-20 22:57:47 +10:00
flat out vec4 finalColor;
#ifndef USE_WIRE
out vec2 texCoord_interp;
#endif
void main()
{
vec3 pos = vec3((pos + offset) * (size * aspect), 0.0);
vec3 world_pos = point_object_to_world(pos);
gl_Position = point_world_to_ndc(world_pos);
2017-05-20 22:57:47 +10:00
#ifdef USE_WIRE
gl_Position.z -= 1e-5;
finalColor = vec4(color, 1.0);
2017-05-20 22:57:47 +10:00
#else
texCoord_interp = texCoord;
finalColor = objectColor;
2017-05-20 22:57:47 +10:00
#endif
2019-01-26 15:00:03 +11:00
#ifdef USE_WORLD_CLIP_PLANES
world_clip_planes_calc_clip_distance(world_pos);
2019-01-26 15:00:03 +11:00
#endif
2017-05-20 22:57:47 +10:00
}