Revision bc208a9c
Added by Leszek Koltunski almost 4 years ago
src/main/res/raw/main_vertex_shader.glsl | ||
---|---|---|
25 | 25 |
in vec3 a_Inflate; // This vector describes the direction this vertex needs to go when we 'inflate' the whole mesh. |
26 | 26 |
// If the mesh is locally smooth, this is equal to the normal vector. Otherwise (on sharp edges) - no. |
27 | 27 |
in vec2 a_TexCoordinate; // Per-vertex texture coordinate. |
28 |
in float a_Tag; // Per-vertex tag. Connects the vertex (really the mesh component the vertex is a member of) to a vertex effect. |
|
29 |
// An effect will only be active on a vertex iff (a_Tag & vTag[effect]) != 0. ( see VertexEffect.retSection() ) |
|
28 | 30 |
|
29 | 31 |
out vec3 v_Position; // |
30 | 32 |
out vec3 v_endPosition; // for Transform Feedback only |
... | ... | |
46 | 48 |
uniform vec4 vUniforms[3*NUM_VERTEX];// i-th effect is 3 consecutive vec4's: [3*i], [3*i+1], [3*i+2]. |
47 | 49 |
// The first vec4 is the Interpolated values, |
48 | 50 |
// second vec4: first float - cache, next 3: Center, the third - the Region. |
51 |
uniform int vTag[NUM_VERTEX]; // Tags of the vertex effects. Tags are used to connect an effect to a Mesh component. |
|
49 | 52 |
|
50 | 53 |
////////////////////////////////////////////////////////////////////////////////////////////// |
51 | 54 |
// HELPER FUNCTIONS |
Also available in: Unified diff
Introduce 'tags' (soon to be renamed to 'associations') to Mesh and VertexEffect.
A 'tag' is a way to associate a Vertex Effect only to a subgroup of a given Mesh's vertices (more precisely, only to an arbitrary subset of its Components)