Project

General

Profile

« Previous | Next » 

Revision e8925fcd

Added by Leszek Koltunski almost 4 years ago

Big change to MeshBase:
1) split the list of Components into two: 'texture map' components and 'effect' components.
Reason: imagine the Rubik Cube with a Solver. When setting up a initial position in the Solver, we need to be able to set texture maps of each individual face of each cubit.
Thus previously (when there was only one Component which kept info both about Effect associations and Texture Maps) a 5x5x5 Rubik Cube would have to have 98*6 = almost 600 components.
This alone would mean 1200 uniforms in the Vertex Shader --> more than the guaranteed 1024.
Splitting the Component into two parts lets us merge the 6 'Effect' components of each Rubik Cubit into one (thus leaving only 98 Effect Components in the Verteex Shader --> 196 uniforms) while still allowing for change of the texture map of each individual face.
2) (re-) add the 'apply a matrix effect' (this time with associations)

View differences:

src/main/java/org/distorted/library/mesh/MeshJoined.java
22 22
///////////////////////////////////////////////////////////////////////////////////////////////////
23 23

  
24 24
public class MeshJoined extends MeshBase
25
  {
25
{
26 26
///////////////////////////////////////////////////////////////////////////////////////////////////
27 27
/**
28 28
 * Join a list of (probably already changed by Vertex Effects) Meshes into one.
......
56 56
   {
57 57
   return new MeshJoined(this,deep);
58 58
   }
59

  
60
///////////////////////////////////////////////////////////////////////////////////////////////////
61
/**
62
 * Return how many basic Meshes is this Mesh joined from.
63
 */
64
  public int getNumComponents()
65
     {
66
     return numComponents();
67
     }
68
  }
59
}

Also available in: Unified diff