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 - drkucho

Pages: [1] 2 3 ... 5
Support / Mesh Type Custom-Automatic or Improved Diced Sprite
« on: June 06, 2018, 07:51:14 am »

Not sure I have the latest version of Tk2D , but I believe that this feature still is not supported? it would be great for performance.

In case its too complicated to implement, you might consider to improve the diced sprite system by joining together the dices that are next to other in a single bigger dice which will mean the same pixels to process but the less triangles.


Support / Re: Extra transparent border in atlas?
« on: December 30, 2015, 12:12:23 pm »
i have found where i made the hack!, its on tk2dSpriteCollectionBuilder search for

         int w1 = x1 - x0 + 1;
         int h1 = y1 - y0 + 1;

that should be in line 377 (latests tk2d version), leave that untouched, and right after those two lines write these

         x0 --;
         y0 --;
         w1 = w1 + 2;
         h1 = h1 + 2;

those 4 new lines will make the sprite trimmer to include one more line of transparent pixels on each side, up, down , left and right so you can make your sprite sheets with enough free space on each cell, don't you worry about wasted memory cause the trimming will cut that away but now leaving one pixel on each side.

ISSUE: if you make a sprite which it's border touches the limit of the document or the cell (in a sprite sheet), meaning you don't leave any transparent pixels on its sides, you will not only get the usual stupid rotation artifacts but also the sprite won't show correctly sized by one pixel all of it.

Support / bug in tk2dTextMesh?
« on: December 30, 2015, 11:54:55 am »
i recently updated from unity 4.5 to 5.3 and also updated from my old tk2d to the latests on the asset store, all at the same time

i found that text meshes gets solid pink when a new level is loaded , it gets fixed by activating and deactivating them

Support / Re: Extra transparent border in atlas?
« on: November 20, 2015, 10:53:36 am »
yeah , the 1% opacity trick makes a lot of sense, the problem is you have to add that extra pixel for each sprite in photoshop which is a lot of work

unless... now that you i read again , you say you add 1 pixel at the border of the sheet document? that will make the tk2d trimming useless and you will waste a lot of space in the atlas, if you want that better go to collection settings and click "Disable Triming"

Support / Re: Extra transparent border in atlas?
« on: November 20, 2015, 12:10:19 am »
i ended up modified tk2d code , the part where it trims the sprite sheets to add a transparent pixel (or did i add 2? i can't remember), i can't even find where i did the hack now.

i still have to add extra transparent pixels for each cell in the sprite sheet so the hack works properly but at least it works, it can trim the collection now the same as before but with an extra transparent border of 1 pixel

Support / Color/Tint of sprites
« on: May 27, 2015, 09:45:34 pm »

i have changed the material/shader of my sprites to a custom one that does special things , problem is i was using tk2dSprite.color.a to make my hero transparent when received a hit and it does not work anymore

how is this tint color applied to the sprite? i might do a little hack to make it work with my custom shader...

Support / tk2d:LitBlendVertexColor Vs Unity:Sprites/Diffuse
« on: March 24, 2015, 06:10:10 pm »
these shaders seem to work exactly the same, what are the differences ?

Support / Re: Multiple materials for all sprites in collection
« on: March 24, 2015, 02:22:23 pm »
it works, thank you very much! :)

Support / Re: Sprite Attach Point small GC Alloc?
« on: March 16, 2015, 12:42:11 pm »
i guess that is a yes but , right, thanks for reminding that, will profile the build

Support / Re: Sprite Attach Point small GC Alloc?
« on: March 16, 2015, 09:20:58 am »
im reading your code, sorry i am not good reading other ppl code and mostly if it is C , but if i am reading it ok ,you search for the right attach point to update for its name , you even suggested the dictionary in a comment

            // A dictionary would be ideal here, but could end up in an indeterminate state due to
            // user deleting things at runtime. Hopefully the user won't have that many attach points
            // that a linear search becomes an issue

i don't plan to delete attach points at runtime so , is this search what i need to change?

Support / Re: Sprite Attach Point small GC Alloc?
« on: March 15, 2015, 10:06:34 pm »
if it is tk2dSpriteAttachPoint then you mean to create the dictionary in tk2dSpriteAttachPoint , so modifying your code?

Support / Re: Sprite Attach Point small GC Alloc?
« on: March 15, 2015, 09:50:11 pm »
well the thing is i am not asking for any object name , i might be skip something but i have reviewed my code so many times and the is no asking for anything with a name

its not happening every frame but every few frames and its going to be on every character in the game

this is the suspicious code

if (goodClip != anim.CurrentClip || main.CurrentFrame != anim.CurrentFrame){

goodClip is --> private var goodClip:tk2dSpriteAnimationClip;
anim and main are both tk2dSpriteAnimator

Support / Re: Sprite Attach Point small GC Alloc?
« on: March 15, 2015, 05:44:04 pm »
not sure to understand, are you suggesting i should create a dictionary or that you would rewrite SpriteAttachPoints code with a dictionary?

i just thought that might be one of those cases that it allocates only if you run it from editor, i spent several hours after a 0.5k allocation on GetComponent and then i found on the net explanation for it, it only happens in editor and only when the component is not found , the allocation is to be able to display the error message as far as i understood, i made the test profiling the built and indeed it does not happen , i will try this with the AttachPoint , hopefully it's a similar case and won't happen in a build.

Support / Sprite Attach Point small GC Alloc?
« on: March 15, 2015, 02:00:01 pm »
hello, i am optimising my code to avoid all unnecessary allocations, there was a lot of it generated on tk2d cause i was calling animation by string name of the clip for example, all the big allocation went away when getting all clips at start and calling Play with the tk2dSpriteAnimationClip

but still there is an small amount of alloc happening , this time seems to be related to Attach Point code?

as you see right below the highlighted line there is a Object.get_name() , don't know why is that, i am not calling clips by name anymore and don't think sprite attach point uses the names of the sprites/clips ...?

the allocation is not much for just one sprite but i need hundreds of them in my scene so any idea how to get rid of it?

Support / Re: updating coliders , performance
« on: March 11, 2015, 09:23:30 pm »
Actually, you do indeed get some spikes when moving colliders via transform instead of rigidbody.MovePosition(). At least from my profile tests. There's a physics "UpdateTransform" (or something like that, I don't recall exactly) call that is expensive (relatively speaking) that doesn't happen if you move via rigidbody. This is regardless if the collider is a trigger or not.

That said, you probably wouldn't notice anything unless you had a ton at once.

thanks, i have read a couple of forums and articles about this, since then i changed my code and now uses rigidbody2D.MovePosition i even made my tests with a loop of 30.000 iterations and saw the differences , thats all ok for the rigid body in the main GO, but in my hero i have different colliders as children and depending he is  walking or crouch or he is KO i need to change shape or at least move the children colliders

even if it is not noticeable cause very few colliders to be altered, i am worried about the garbage collection , i am rewriting my code to avoid the GC collect call that happens sometimes and in my game, for unknown reason is making a huge spike.

im not expert so i don't know how to read the profiler information exactly but seems that the garbage is generated cause 59 calls that change collider transform in my player script ...? is that correct?

i need to clean this as i plan to use the same script for other 20 or 30 characters in the game all running at once...

Pages: [1] 2 3 ... 5