add triangle with normal

Started by Thomas., April 14, 2012, 10:11:41 PM

Previous topic - Next topic

Thomas.

Please, could you add method for set normals? Something like this:

addTriangle(SimpleVector vert1, SimpleVector norm1,  float u,  float v,
      SimpleVector vert2, SimpleVector norm2, float u2, float v2,
      SimpleVector vert3, SimpleVector norm3, float u3,  float v3);

EgonOlsen

No. If you want to change the normals that the engine has calculated (why do you want to do that?), you have to implement an IVertexController that do it that way.

Thomas.

Particle system contains hundreds of particles, every particle has same normals and just one triangle. Calculation of normals and triangle strip is unnecessary and causes delay of loading process...

EgonOlsen

Quote from: Thomas. on April 14, 2012, 11:41:54 PM
Calculation of normals and triangle strip is unnecessary and causes delay of loading process...
You are really nano-optimizing here...creating a single polygon Object3D, adding one triangle + build() takes 1.6ms on my Nexus S. Even if you create 500 particles, it'll finish in under a second. Thinking about this "problem" takes more time than all of your users will ever spend waiting for this to happen. If you are really concerned about this, you can create one particle and create the others by doing a cloneObject() (that's not memory friendly anyway). That will bring down the time it takes to create on particle to around 0.5ms on my device. With that, you can also share the compiled data with the blue print, so that you save compilation time and gpu memory in addition.

The triangle strip isn't calculated. The object is just checked, if it is one and that's part of the compilation process. Printing the log message takes more time than the actual process. If you don't want this, do a Config.glTriangleStrips=false and the check won't be done.