Project

General

Profile

« Previous | Next » 

Revision 46d463a4

Added by Leszek Koltunski about 3 years ago

Make per-component centers optional, controlled by API MeshBase.setUseCenters()

View differences:

src/main/res/raw/main_vertex_shader.glsl
39 39
uniform float u_Inflate;              // how much should we inflate (>0.0) or deflate (<0.0) the mesh.
40 40
uniform int u_TransformFeedback;      // are we doing the transform feedback now?
41 41

  
42
#ifdef COMP_CENTERS
42 43
layout (std140) uniform componentCenter
43 44
  {
44 45
  vec4 vComCenter[MAX_COMPON];        // centers of mesh components. 4 floats: (x,y,z,unused)
45 46
  };
47
#endif
46 48

  
47 49
#if NUM_VERTEX>0
48 50
uniform int vNumEffects;              // total number of vertex effects
......
117 119
void main()
118 120
  {
119 121
  int component = int(a_Component);
120
  vec3 v = a_Position + u_Inflate*(a_Position - vComCenter[component].xyz);
121 122
  vec3 n = a_Normal;
123
#ifdef COMP_CENTERS
124
  vec3 v = a_Position + u_Inflate*(a_Position - vComCenter[component].xyz);
125
#else
126
  vec3 v = a_Position + u_Inflate*a_Position;
127
#endif
122 128

  
123 129
#if NUM_VERTEX>0
124 130
  int effect=0;

Also available in: Unified diff