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

eevee_surface_gpencil_vert.glsl « shaders « eevee « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: afb79dfcd9c1c825b8bad3b2271dcf87ebfe51fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

#pragma BLENDER_REQUIRE(common_view_lib.glsl)
#pragma BLENDER_REQUIRE(common_attribute_lib.glsl)
#pragma BLENDER_REQUIRE(common_gpencil_lib.glsl)
#pragma BLENDER_REQUIRE(eevee_surface_lib.glsl)

/* Globals to feed the load functions */
vec2 uvs;
vec4 color;

/* TODO(fclem) remove use of macro. use interface block instead. */
RESOURCE_ID_VARYING

void main(void)
{
  vec4 sspos;
  vec2 aspect;
  vec2 thickness;

  gl_Position = gpencil_vertex(ma,
                               ma1,
                               ma2,
                               ma3,
                               pos,
                               pos1,
                               pos2,
                               pos3,
                               uv1,
                               uv2,
                               col1,
                               col2,
                               fcol1,
                               vec4(drw_view.viewport_size, drw_view.viewport_size_inverse),
                               interp.P,
                               interp.N,
                               color,
                               uvs,
                               sspos,
                               aspect,
                               thickness);

  PASS_RESOURCE_ID
  attrib_load();
}

vec3 attr_load_orco(vec4 orco)
{
  vec3 lP = point_world_to_object(interp.P);
  return OrcoTexCoFactors[0].xyz + lP * OrcoTexCoFactors[1].xyz;
}

vec4 attr_load_tangent(vec4 tangent)
{
  /* TODO */
  return vec4(0.0, 0.0, 0.0, 1.0);
}

/* Only have one uv and one color attribute layer. */
vec3 attr_load_uv(vec3 dummy)
{
  return vec3(uvs, 0.0);
}
vec4 attr_load_color(vec4 dummy)
{
  return color;
}

/* Not supported. */
vec4 attr_load_vec4(vec4 attr)
{
  return vec4(0.0);
}
vec3 attr_load_vec3(vec3 attr)
{
  return vec3(0.0);
}
vec2 attr_load_vec2(vec2 attr)
{
  return vec2(0.0);
}