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/effectqueue/EffectQueuePostprocess.java
126 126
    String mainVertHeader= version + ("#define NUM_VERTEX "   + ( numV>0 ? DistortedLibrary.getMax(EffectType.VERTEX  ) : 0 ) + "\n");
127 127
    String mainFragHeader= version + "\n";
128 128

  
129
    mainVertHeader += "#define MAX_COMPON " + MeshBase.getMaxComponents() + "\n";
129
    mainVertHeader += "#define MAX_COMPON " + MeshBase.getMaxEffComponents() + "\n";
130 130

  
131 131
    String enabledEffectV= VertexEffect.getGLSL();
132 132

  

Also available in: Unified diff