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

Pages: [1]
1
Support / Feature request: 8192-sized atlases
« on: March 05, 2015, 09:57:38 pm »
Hello. I just have a very quick feature request:

Unity 5 supports 8192x8192 textures, so I'd like 2D Toolkit to have support for them too.

It looks like a verrrry easy feature to add too. I just searched for 4096 in the sources, added 8192 to allowedAtlasSizes, and changed the importer.maxTextureSize to 8192 in three places, and that seems to have worked fine! :)

Thanks!

2
Support / Re: Large memory spike when loading PNG atlases
« on: December 02, 2014, 11:24:49 pm »
I just realized that I had a bug that was causing an extra sprite collection to be loaded inappropriately, so that might actually be the source of my trouble, and I'm no longer seeing that distinctive memory spike when loading levels. I'm still investigating, but please take everything I said earlier with a big grain of salt now. Sorry!

3
Support / Re: Large memory spike when loading PNG atlases
« on: December 02, 2014, 12:58:38 pm »
Thanks very much for the reply. I saw an older thread about PNG atlases taking up double memory which you fixed by adding the call to Texture2D.Apply to make Unity discard its uncompressed copy of the texture from memory. I suspect that doesn't take effect until the end of the frame, and unfortunately I'm loading three large atlases on the same frame, so their unnecessary uncompressed copies are all in memory at the same time.

Perhaps I could do something fancy to make them load on consecutive frames so that only one of the duplicate copies is in memory at a time, and avoid crashing that way. Otherwise the native idea I had in mind is how you described it using Texture2D.CreateExternalTexture. I found a post on the Unity forum from someone who was doing something similar. Obviously that might get a bit messy, but I'll let you know how it works out if I do ending trying that option.

Thanks again!

4
Support / Large memory spike when loading PNG atlases
« on: November 30, 2014, 11:27:31 pm »
Updated: As I mentioned below, I had a bug that makes me think I was misinterpreting what I was seeing and probably invalidates this, so please ignore this for now.

Hi there. When I'm using PNG atlases I'm seeing a very large momentary memory spike when my atlases are loading (please see attached screenshot), which unfortunately is enough to exhaust memory and crash some iOS devices. When I use ordinary uncompressed Unity textures I get a much smaller spike.

Is that expected, and is there anything I can do about it? I was thinking it would be due to the data being shuffled from native to managed and back to native again, and I'm considering writing a Unity plugin that would load the textures using native code instead. Do you think that would help with the memory issue?

5
Support / Re: Is the late execution of tk2dUIManager necessary?
« on: October 02, 2013, 12:02:26 am »
That's great. Thanks very much.

6
Support / Is the late execution of tk2dUIManager necessary?
« on: October 01, 2013, 07:17:36 pm »
Hi there. I'm trying out using tk2dUIItem for an on-screen gameplay control where latency is important. I notice that tk2dUIManager has a script execution order of 100 which has the effect that it runs after my gameplay code and so the gameplay code is using the last frame's input. I tried setting tk2dUIManager's order to -100 instead, and that seems to work and removes the one-frame latency, but is that supported, or might it break something else?

7
Hello.

I'm trying to use 2D Toolkit in a lit scene, and I'm using premultiplied alpha to get rid of dark fringes around transparent parts, so I have the 'Premultiplied Alpha' box checked in the sprite collection settings, and the LitPremulVertexColor shader assigned in the atlas material.

Everything looks fine when the scene camera is set to the VertexLit rendering path, but when I set it to use the Forward rendering path I get fringes around the edges of my transparent sprites as seen in the first attachment. Is this to be expected? The shader looks fine to me but it seems that something in Unity's forward rendering path is not premultiplied alpha-friendly. At first I thought it might be that I'm using a point light which adds another draw call in forward rendering, but I tried changing it to a directional light and that does get rid of the extra draw call but doesn't prevent the fringing.

I've attached a minimal test project that demonstrates the problem.

Pages: [1]