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

Pages: [1]
1
Support / Re: Speed and Sprite Meshes
« on: February 10, 2014, 06:01:01 am »
Ok I got a solution.

After the sortingOrder did nothing, a friend suggested trying to remove the depth check in the shader. That did it. I edited my additive shaders and now it all batches perfectly. My draw calls are now as low as 14 :)

Thank you unikron for all the support on this matter, I have learned a lot from all this.

2
Support / Re: Speed and Sprite Meshes
« on: February 10, 2014, 05:20:31 am »
That makes sense, I didn't know that was the case.

Well, I tried:

renderer.sortingLayerName = collectionId.ToString();
renderer.sortingOrder = collectionId;

and it doesnt seem to be doing anything :(
 


3
Support / Re: Speed and Sprite Meshes
« on: February 09, 2014, 06:28:03 pm »
Ah you mean via code. I thought it was exposed somewhere.

That's no problem. I will let you know how that goes. I still can't get batching to work when the sprites move. (I just don't understand why moving them breaks it).

Thank you so much for the help so far!

4
Support / Re: Speed and Sprite Meshes
« on: February 09, 2014, 04:57:49 am »
I have been searching and looking for a while now and cannot figure out where you set the sorting layers for sprite collections.

Any hints? :)

5
Support / Re: Speed and Sprite Meshes
« on: February 08, 2014, 06:37:33 pm »
Oh the multi-selection works great! I am also thinking that a fine diced mesh will also work. So far so good, making progress :)

Batching... I have 3 sprite collections: General stuff, player army, enemy army.

I am using a perspective main camera, the battlefront is viewed at an angle from above, while the army units are flat on the XY plane. I am not using transparency, my materials are additive (transparent materials have slower performance). I have 3 cameras and all 3 are visible at the same time on the screen:

1)Main camera, perspective. Shows the battlefield. Clear flags= solid color.
2)tk2dCamera, perspective, with Sort mode= perspective. Displays the UI and HUD on top of the battlefield. Clear flags=Depth only.
3)Minimap camera, orthographic. Shows minimap in the corner. Clear flags = Depth only. Only certain objects render to this camera (army units but no special effects or GUI).

Should I be using tk2DCameras for all of them?


6
Support / Re: Speed and Sprite Meshes
« on: February 08, 2014, 08:44:45 am »
Hi thank you for your reply.

Sprite dicing is probably not going to help me, I am dealing with small animated sprites, not large areas.

As for mesh shapes, that's exactly what I was asking for, but I could not find a way to get the shape done automatically (like in Unity sprites or Uni2D). Doing them by hand is no use, as I have more than 300 frames of animation.

Is there a way to automate the mesh generation? Or if at least there was a way to copy the mesh of the first frame in the first sprite of the animation to the rest of the frames.

My game is about armies, so I have lots of army units for the player and for the enemy. Besides the mesh optimization which could help deal with the fill rate bottleneck, I am also experiencing problems with batching.

For some reason, batching will work fine as long as I don't change the transform.position of the sprites. But the army units have to move :) As soon as I call transform.position = x, batching stops working, and the draw calls ramp up from 30 to 250.

Any ideas?

7
Support / Speed and Sprite Meshes
« on: February 04, 2014, 05:33:39 pm »
Hi,

I am relatively new to 2D toolkit. I have been using it to build a game for mobile devices so I have been trying to squeeze as much performance out as possible.

Right now I am using a bunch of additive shaded sprites (own custom shader), so basically my sprites have no alpha, but black areas act as transparent. I was wondering if there is a way to get 2Dtk to create a custom polygonal mesh for the sprites so that I can save time on rendering portions of the sprite.

From my tests, the native Unity sprites perform 20% faster than 2Dtk sprites, using rectangular meshes. I am using 2Dtk for the atlasing, but I would love to have the same performance as with the Unity sprites. I also have Uni2D and it did render faster when using polygonal meshes in another game.

If this is not possible, are there any suggestions for speeding up rendering to the max?

(I am probably using all the tricks already but I ask just in case I am missing some)

Thank you in advance!

8
Support / Avoid UI elements moving with Main Camera
« on: November 30, 2013, 08:20:56 pm »
Hi,

I am new to 2D toolkit, so bear with me :)

I have 3 cameras:

Main: perspective, game objects
Minimap: ortho wide view of playing field
UI: tk2dUICamera

When I place UI elements in my hierarchy, they show up properly, but they only react if I have the tk2dUI script attached to my main camera, they seem to ignore the UI camera (which has a tk2DUI script attached).

Is there a way to fix it?

Pages: [1]