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.


Topics - ivomarel

Pages: [1]
1
Support / Round corners
« on: April 09, 2014, 11:04:30 pm »
Hi all,

I am trying to create a tiled sprite with round corners with a dynamic width. See image.

The challenge here is the fact that the tiling goes on until the corner itself. Here's the thoughts I have so far:

1 - Mask shader http://wiki.unity3d.com/index.php/TextureMask . But this doesn't work because I want to stretch my image. Somehow I'd like to 9-slice the shader... If that were possible.

2 - Round-corner shader. I'm no shader expert but I guess I could draw/not draw pixels based on the y-coordinate, using a sine-function to make it round. That's what I'll try to figure out now.

Any idea which way would be better? Or is there a third way?ß

Cheers

2
Support / Create tk2dSpriteCollection on runtime
« on: August 13, 2013, 09:58:58 am »
Hey all,

This seems to be a pretty obvious problem. I have no experience with creating atlases on runtime and I fear it will be incredibly slow on mobile devices. However, it would save an immense number of drawcalls for me (currently on 200) so I am willing to look into it.

Question 1:
Can I create an atlas of several PNG's on runtime, like I can in the editor? I'm looking into tk2dSpriteCollectionData.CreateFromTexture, but it seems to only be useful when there's one texture which is the atlas.

Question 2:
Can I even, instead of recreating the complete atlas, replace only certain elements in the PNG?

Shot in the dark, but perhaps you guys can help me out.

Cheers!

Ivo

3
Support / Creating atlas which is not to the power of 2
« on: July 04, 2013, 10:53:53 am »
Hey all,

Simple question and hopefully a simple solution. When I create a sprite collection it will always save as an image to the power of 2. Not sure why, but I am wasting some space here since I have some very small atlases (I found that in some cases saving images separately will increase performance).

Who can tell me how I can save the sprite collection to not be to the power of 2?

Cheers,

Ivo

4
Support / Randomized Isometric Map with material tiling
« on: July 03, 2013, 08:40:16 am »
Hey guys!

I'm currently creating an isometric grass map for my game. It's a grass field, tiled. Right now I use the tile-texture added to this post. I simply tile it on the material. This way it only costs me two polygons and the whole map is tiled. However, it looks very repetitive. I am hoping to be able to somehow use more than just these two tiles and still stay low on the polycount (Tilemap of 2D Toolkit seems to cost 2 polys/tile).

Any idea if this is possible? Otherwise I'll find a mid-way solution, with 3 bigger tile-blocks which I will place randomly screen (both memory cost and performance will only suffer a bit)

Cheers,

Ivo

5
Support / Getting a triangular shape from atlas
« on: June 13, 2013, 02:48:21 am »
Hey guys,

I am currently working with a map, with triangular corners and a tiled center. I am using 2DToolkit to create the atlas for me and (as expected) it saves the four corners next to each other, all as if they were four rectangles (please see attachment). Is there any way to save this in a different way and save half the space? I was thinking to use shaders, but I work for mobile device and I am not sure if that would work.

Would be easiest if I can get a triangular shape out of the atlas instead of a rectangle.

One solution I have - if I get the shapes in the atlas they way I want, I can just load the two rectangles twice and make the tiles overlap them. I am just wondering if there are other / better ways to do this.

Edit: And obviously it's easy to get the shapes in the atlas, I just put them together as one image..
Cheers,

Ivo

6
Support / Drawcall efficient Z-sorting with multiple atlases
« on: May 27, 2013, 04:41:54 am »
Dear all,

Currently I am working on an mobile isometric strategy game, with multiple animated buildings. Since there are many buildings and they are quite detailed (high resolution) I can't fit all buildings in one atlas. In fact, I need 3 atlases (2048*2048) for all buildings. However, the user can move the buildings around and put them behind and in front of other buildings. This is easily done by z-sorting, but by having multiple atlases z-sorting, the drawcalls increase dramatically. Since it's a mobile game, I'm trying to decrease the number of drawcalls to 25, but now, every overlapping building (of a different atlas) costs one extra drawcall.

Does anyone have a smart solution to this problem? I'd get a 4096*4096 atlas, but I'd like an Ultra HD atlas as well, which would then require a 8192*8192 atlas and Unity doesn't seem to accept that.

Any help is greatly appreciated!

Cheers,

Ivo

Pages: [1]