Differential D4786 Diff 15447 source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl
| #if defined(DEPTH_OFFSET) | |||||
| uniform mat4 ModelViewMatrix; | |||||
| uniform mat4 ProjectionMatrix; | |||||
| uniform float ofs; | |||||
| #else | |||||
| uniform mat4 ModelViewProjectionMatrix; | uniform mat4 ModelViewProjectionMatrix; | ||||
| #endif | |||||
| in vec3 pos; | in vec3 pos; | ||||
| in vec4 color; | in vec4 color; | ||||
| out vec4 finalColor; | out vec4 finalColor; | ||||
| void main() | void main() | ||||
| { | { | ||||
| #if defined(DEPTH_OFFSET) | |||||
| mat4 projmat = ProjectionMatrix; | |||||
| projmat[3][2] -= ofs; | |||||
| gl_Position = projmat * (ModelViewMatrix * vec4(pos, 1.0)); | |||||
| gl_Position.z -= 3e-4 * ((ProjectionMatrix[3][3] == 0.0) ? 1.0 : 0.0); | |||||
| #else | |||||
| gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); | gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); | ||||
| #endif | |||||
| finalColor = color; | finalColor = color; | ||||
| } | } | ||||