Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gpu_shader_gpencil_stroke_vert.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f9bb0d224030abdb10505fd667c204e5db5d0daa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

float defaultpixsize = gpencil_stroke_data.pixsize * (1000.0 / gpencil_stroke_data.pixfactor);

void main(void)
{
  gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
  geometry_in.finalColor = color;

  if (gpencil_stroke_data.keep_size) {
    geometry_in.finalThickness = thickness;
  }
  else {
    float size = (ProjectionMatrix[3][3] == 0.0) ? (thickness / (gl_Position.z * defaultpixsize)) :
                                                   (thickness / defaultpixsize);
    geometry_in.finalThickness = max(size * gpencil_stroke_data.objscale, 1.0);
  }
}