Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Michael

Pages: [1]
1
Support / Re: Another question regarding lighting a sprite
« on: March 18, 2013, 11:51:16 am »
Sorry for resurrecting this topic back all of a sudden, but we only just noticed an issue with the lighting now that our characters are running through really light varying environments.

The back side of the sprite seems to be lit much brighter than the front. Would there be anything else that could be the cause of this ?

2
Support / Re: Another question regarding lighting a sprite
« on: December 11, 2012, 03:11:04 pm »
Thanks very much, that worked great :)!


3
Support / Re: Another question regarding lighting a sprite
« on: December 11, 2012, 11:59:26 am »
Thank you for the quick response, in regards to the options mentioned, the second option seems the one that will be most useful, so I've been tinkering with getting that to work, but I must be making quite some silly mistakes here.

Going through the SpriteCollectionBuilder, it seems to me that the polygons are being set up in the UpdateVertexCache() ? (line 1246). The positions just set up the points of the rectangle (Ignoring the custom geometry part, as that's not being used ), and the actual polygons are instantiated at
1525: if (!thisTexParam.customSpriteGeometry): Which sets up the indices.

Thinking in DirectX terms, the indices would be ones that actually set up the polygons, as the 6 indices basically relate to 2 triangles with each 3 points. So with that in mind I changed the following part to create more indices than the standard front side

            // build sprite definition
            if (!thisTexParam.customSpriteGeometry)
            {
               coll.spriteDefinitions.indices = new int[ 6 * (positions.Count / 2) ]; //(/4 became /2) Get double of indices instead of only 6, so the back can be created as well
               for (int j = 0; j < positions.Count / 4; ++j)
               {
                  //Triangles
                  //0,3,1
                  //2,3,0
                  coll.spriteDefinitions.indices[j * 6 + 0] = j * 4 + 0;
                  coll.spriteDefinitions.indices[j * 6 + 1] = j * 4 + 3;
                  coll.spriteDefinitions.indices[j * 6 + 2] = j * 4 + 1;
                  coll.spriteDefinitions.indices[j * 6 + 3] = j * 4 + 2;
                  coll.spriteDefinitions.indices[j * 6 + 4] = j * 4 + 3;
                  coll.spriteDefinitions.indices[j * 6 + 5] = j * 4 + 0;
                  
                  //Triangles
                  //1,0,3
                  //0,2,3
                  coll.spriteDefinitions.indices[j * 6 + 6] = j * 4 + 1;
                  coll.spriteDefinitions.indices[j * 6 + 7] = j * 4 + 0;
                  coll.spriteDefinitions.indices[j * 6 + 8] = j * 4 + 3;
                  coll.spriteDefinitions.indices[j * 6 + 9] = j * 4 + 0;
                  coll.spriteDefinitions.indices[j * 6 + 10] = j * 4 + 2;
                  coll.spriteDefinitions.indices[j * 6 + 11] = j * 4 + 3;
               }
               coll.spriteDefinitions.complexGeometry = false;
            }



Sadly no cigar. Am I looking in completely the wrong place, or just missing something extra perhaps ?

4
Support / Another question regarding lighting a sprite
« on: December 10, 2012, 02:34:09 pm »
Hello everyone,

I was hoping someone could help me with the generation of the normals for our sprites:
The spritesheets used have the option normals only enabled, and that works from one side, however it only seems to be generating them for the front side of the sprite, and not the back. Our sprites are getting flipped continuously, so I was wondering if there is any way to tell tk2d to generate the invert normals for the mesh as well, so both sides work ?
Thanks very much!

Pages: [1]