Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Tonight I learned about texture compression types for Texture2D objets in Unity. Why? Because due to iOS's handling of PNG files, instead of having a massively bloated app size on disk I'm loading all of my images in at runtime. This isn't really a problem...unless you're talking about getting things running on older devices like the iPhone 4 which we definitely need to. The problem is that upon loading a 2048x2048 texture atlas into memory sometimes the iPhone 4 just chokes and dies.

I figured the problem was probably the fact that in memory a Texture2D object with ARGB32 compression being a resource hot at 32 megs per atlas. So I did some reading about
Textures: http://docs.unity3d.com/Documentation/Manual/Textures.html
Reducing File Size: http://docs.unity3d.com/Documentation/Manual/ReducingFilesize.html

And based on that I decided to use DTX5 compression instead. Should this be okay and a fairly good replacement? A quick play through my game tells me it looks okay and the memory profiler says it's now using 8 megs per Texture2D instead of 32 but is there anything else I should use?


e: wait what the hell if i play in the Unity Editor in iOS mode it says DTX5 is 8 megs per atlas but if i actually run on-device and check the profiler it's saying it's actually 32 megs. so what am i supposed to use then and why is there a discrepancy between on-device and in-editor?

Yodzilla fucked around with this message at 06:15 on Aug 27, 2013

Adbot
ADBOT LOVES YOU

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Shalinor posted:

Regardless, I will grant you that doing noir with forward-shaded point lights is effectively impossible
Not really, considering probably the easiest way to achieve the noir aesthetic is limit absolutely everything to being affected by a single light.

Grocer Goodwill
Jul 17, 2003

Not just one kind of bread, but a whole variety.

Yodzilla posted:

e: wait what the hell if i play in the Unity Editor in iOS mode it says DTX5 is 8 megs per atlas but if i actually run on-device and check the profiler it's saying it's actually 32 megs. so what am i supposed to use then and why is there a discrepancy between on-device and in-editor?

DXT isn't supported on iOS. You need to use PVRTC.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Doesn't matter. Every version of PVRTC I was telling Unity to use was resulting in full 32 meg uncompressed images on my iOS device. I don't know if this a bug in Unity or if I was just going insane from tiredness last night or what. I'll have to give it another shot this afternoon. :\

KoRMaK
Jul 31, 2012



endlosnull posted:

I had absolutely no clue on a game concept for probably 90% of the development and it was mostly me throwing in things that looked cool and easy to do within the time frame.
Oh, which AAA studio do you work at?

HiriseSoftware
Dec 3, 2004

Two tips for the wise:
1. Buy an AK-97 assault rifle.
2. If there's someone hanging around your neighborhood you don't know, shoot him.

Yodzilla posted:

Doesn't matter. Every version of PVRTC I was telling Unity to use was resulting in full 32 meg uncompressed images on my iOS device. I don't know if this a bug in Unity or if I was just going insane from tiredness last night or what. I'll have to give it another shot this afternoon. :\

Are you using Unity for Windows? Maybe it doesn't have the compression tools installed. I read that the OSX version does by default.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
I'm running Unity in both OSX and Windows but I was in OSX last night. Regardless, the compression is working in-editor and when building for platforms other than iOS, it's just not working on my iPhone 5 itself. And besides, you can't build or push for iOS devices from Windows and this is a runtime problem, not an asset issue.

e: i'm just going to have to punt for now i guess since i don't have my laptop available to run these tests. it's just super frustrating


e: wait a loving second, i just noticed there are two sets of PVRTC compression options
PVRTC_RGB2, PVRTC_RGB4, PVRTC_RGBA2, PVRTC_RGB4
and
PVRTC_2BPP_RGB, PVRTC_4BPP_RGB, PVRTC_2BPP_RGBA, PVRTC_4BPP_RGBA

i think i was only trying the first set last night?? should i be using PVRTC_4BPP_RGBA for lower memory but still decent image compression on iOS?

Yodzilla fucked around with this message at 15:21 on Aug 27, 2013

HiriseSoftware
Dec 3, 2004

Two tips for the wise:
1. Buy an AK-97 assault rifle.
2. If there's someone hanging around your neighborhood you don't know, shoot him.
I would use the 4BPP for textures with alpha and the 2BPP for textures without. That first set of options doesn't look like it actually compresses the texture, it's still raw data but with a lower # of bits per component.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Yeah I'm starting to think I probably had a severe case of the Up Too Late Stupids.

endlosnull
Dec 29, 2006

KoRMaK posted:

Oh, which AAA studio do you work at?

What if the AAA studio was all in my mind? I think I could hear someone in a suit breathing down my neck asking if that cool new feature was in. The horror.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
OK no I'm not going crazy, the Texture2D TextureFormat options PVRTC_2BPP_RGB, PVRTC_4BPP_RGB, PVRTC_2BPP_RGBA, PVRTC_4BPP_RGBA are deprecated and don't even appear as options in Monodevelop on OSX. It wasn't until I tried messing with things in Visual Studio in Windows that I saw them BUT it doesn't matter because if you try to use them they'll just be converted at runtime to the corresponding PVRTC_RGB2, PVRTC_RGB4, PVRTC_RGBA2, PVRTC_RGB4 value...

...WHICH ALL STILL TAKE UP AS MUCH SPACE IN MEMORY AS ARGB32!!


What the hell is going on here? Is there just no good option for texture compression in iOS or is Unity just bugging out or what? The Unity docs I linked above specifically say to use one of those compression types to lower your memory footprint in iOS just like DXT5 in Android, Windows and OSX so...guh??

Yodzilla fucked around with this message at 23:10 on Aug 27, 2013

Grocer Goodwill
Jul 17, 2003

Not just one kind of bread, but a whole variety.

Yodzilla posted:

What the hell is going on here? Is there just no good option for texture compression in iOS or is Unity just bugging out or what? The Unity docs I linked above specifically say to use one of those compression types to lower your memory footprint in iOS just like DXT5 in Android, Windows and OSX so...guh??

All iOS devices support all four PVRTC types, so this must be something related to your Unity setup. Unfortunately, I don't know anything about Unity so I can't help you there.

One possibility for the discrepancy would be if you're running in the simulator, as opposed to on the actual device. Your Mac computer certainly wont support PVRTC so it'll have to be decompressed at runtime there.

Also, you mentioned Android. I don't know if you're targeting Android or if Unity handles this automatically, but DXT support is not universal across Android devices.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
I have no idea what Unity settings could be causing this as I don't see anything in the player settings that could pertain to my problem. And as far as Android goes, I didn't realize that but for the devices I have it seems to be working fine. I'll keep that in mind though, thanks.


And ignore what I say about in-editor stuff, that's obviously garbage and has no bearing on what's actually going on with my iOS device. What I can say is that for whatever reason I can 100% confirm that all textures I try to assign any variant of PVRTC compression to are just being created as ARBG32 instead. I have absolutely no idea why and this issue is really starting to exhaust me.

e: the code in question
code:
Texture2D texture = new Texture2D(0, 0, TextureFormat.PVRTC_RGBA4, false);
texture.filterMode = FilterMode.Point;
texture.LoadImage(imageBytes.bytes);
Debug.Log(texture.format.ToString());
writes out ARGB32 on all iOS devices I've tested on. frustrating

Yodzilla fucked around with this message at 00:29 on Aug 28, 2013

Flownerous
Apr 16, 2012

Yodzilla posted:

code:
texture.LoadImage(imageBytes.bytes);

This doesn't mention any support for runtime PVRTC conversion, only DXT: http://docs.unity3d.com/Documentation/ScriptReference/Texture2D.LoadImage.html

If these are static textures that you're hosting, you could try building the iOS assets into an AssetBundle instead of sending as PNG/JPG.

If they're dynamic it doesn't look like Unity has any support for runtime PVRTC texture creation, even if you did the conversion yourself.

Edit: Codehead's reply here hints that it might be possible with some native OpenGL calls to overwrite the data after having Unity create a placeholder, but they've only done an Android version.

Flownerous fucked around with this message at 05:29 on Aug 28, 2013

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Oh geez :psyduck:

I have no idea PVRTC had that much of an overhead. gently caress that's confusing but knowing definitely that what I'm attempting to do is basically impossible sort of puts my mind at rest. Kind of.

Thanks man.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Okay so I've been doing some more research into PVRTC and I feel like I have a much better handle on exactly what it is now. The gamedev reddit was actually pretty helpful about this and there are some guides for working with it but I was wondering now how best to introduce PVRTC compression into my game workflow.

Currently I'm packing all of my sprites into atlases with TexturePacker and then loading them into Futile's atlas manager to be used in my game. Would the best thing to do be create two sets of atlases, one PVRTC for iOS and one standard PNG/ARGB32 for Android and desktop? I see that TexturePacker supports PVRTC but I wasn't sure if it would be better for me to handle creating those versions in another program if it yields better looking images.

stramit
Dec 9, 2004
Ask me about making games instead of gains.
FYI Unite Keynote is about to go live:
http://unity3d.com/unite/unite2013/keynote

It should be a good one this year :) We are announcing some nice new features.

Papercut
Aug 24, 2005

Strumpy posted:

FYI Unite Keynote is about to go live:
http://unity3d.com/unite/unite2013/keynote

It should be a good one this year :) We are announcing some nice new features.

This new 2D system looks really nice.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

Strumpy posted:

FYI Unite Keynote is about to go live:
http://unity3d.com/unite/unite2013/keynote

It should be a good one this year :) We are announcing some nice new features.

UI stuff looks great and I hope it's better than NGUI so I don't have to buy it.
The 2d stuff also looks great and it looks a ton easier pipeline-wise than 2dtoolkit.

I didn't see it mentioned, but will there be a 2d particle effect? Getting the 3d one to work in 2D requires a material, a box shape, and you don't get to use the "fire in random directions" feature.

Zizi
Jan 7, 2010

poemdexter posted:

UI stuff looks great and I hope it's better than NGUI so I don't have to buy it.
The 2d stuff also looks great and it looks a ton easier pipeline-wise than 2dtoolkit.

I didn't see it mentioned, but will there be a 2d particle effect? Getting the 3d one to work in 2D requires a material, a box shape, and you don't get to use the "fire in random directions" feature.

uGUI is being developed by the guy that did NGUI, so it should be at least as good-- likely better, due to the engine integration-- I know for a fact that there have already been some fixes made to Unity specifically for uGUI that cause problems in NGUI (mostly dynamic font stuff, IIRC).

Razzek
Jun 6, 2012

Mug posted:

Hahah, Black Annex is cancelled gently caress yooouuuuu nah I just make levels and sprites for it all the time now. I hunger for code, though, so I make different stuff sometimes.

Who knows when it'll come out, next year I guess.

Congrats on passing greenlight! I look forward to seeing Black Annex on the front page of steam!

xzzy
Mar 5, 2009

Razzek posted:

Congrats on passing greenlight! I look forward to seeing Black Annex on the front page of steam!

Along with the inevitable "installing QBasic runtime library" the first time you double click it.

stramit
Dec 9, 2004
Ask me about making games instead of gains.

Zizi posted:

uGUI is being developed by the guy that did NGUI, so it should be at least as good-- likely better, due to the engine integration-- I know for a fact that there have already been some fixes made to Unity specifically for uGUI that cause problems in NGUI (mostly dynamic font stuff, IIRC).

* Sprite based (same as the 2d system)
* Cutouts (via stencil buffer now)
* Unity dynamic font rendering
* Sorting (new rendering path)
* New persistent delegate system

I've worked on the font stuff and the delegate system. Michael (NGUI creator) on the gui framework and the design/components. The design is similar to ngui but really tightly integrated into unity with many things made a nicer and easier to use :)

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice
Is there a timeline for when we might see 4.3? Also, will any of the other talks be live streamed or is that all reserved for conference goers?

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!
On this new Unity update with better 2D stuff, is it going to have a "gently caress you physics, I only want 2D" option that will simplify everything down to 2D, like automatically disabling rotation and movement in the other dimension, or even having a completely separate 2D physics engine? Because that would be nice. So many indie games want to be 2D and ... well, Unity is already still one of the easiest options, but if you could get rid of the unwanted third dimension it would be much better.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

roomforthetuna posted:

On this new Unity update with better 2D stuff, is it going to have a "gently caress you physics, I only want 2D" option that will simplify everything down to 2D, like automatically disabling rotation and movement in the other dimension, or even having a completely separate 2D physics engine? Because that would be nice. So many indie games want to be 2D and ... well, Unity is already still one of the easiest options, but if you could get rid of the unwanted third dimension it would be much better.

The live stream mentioned a seperate physics engine for 2d and explicitly mentioned it should make it easier to do physics without having to worry about your objects falling forward or backward off your other objects.

DancingPenguin
Nov 27, 2012

I ish kakadu.

poemdexter posted:

The live stream mentioned a seperate physics engine for 2d and explicitly mentioned it should make it easier to do physics without having to worry about your objects falling forward or backward off your other objects.

Bad Rats: The United Revenge.

No but honestly, this update seems very solid, and I'm happy it's coming since 2D seems pretty messed up in Unity.

stramit
Dec 9, 2004
Ask me about making games instead of gains.

poemdexter posted:

Is there a timeline for when we might see 4.3? Also, will any of the other talks be live streamed or is that all reserved for conference goers?

None of the other talks will be streamed, but they normally become available on the website soonish after the conference. I'll be putting up slides / demos from my talk before i give it even.

roomforthetuna posted:

On this new Unity update with better 2D stuff, is it going to have a "gently caress you physics, I only want 2D" option that will simplify everything down to 2D, like automatically disabling rotation and movement in the other dimension, or even having a completely separate 2D physics engine? Because that would be nice. So many indie games want to be 2D and ... well, Unity is already still one of the easiest options, but if you could get rid of the unwanted third dimension it would be much better.
It's box 2d in 2d mode, so it's completely separate. If you don't use any 3d physics systems and enable build stripping it will be removed from the executable even :) As for tools ect we will be leaving the transforms ect in 3d, it's so you can create hybrid games with both 2d and 3d content :)

Heisenberg1276
Apr 13, 2007
How annoyed am I that I JUST bought 2D Toolkit

stramit
Dec 9, 2004
Ask me about making games instead of gains.
Well you can start making your game now with 2d toolkit whereas you might have to wait a few months to start with Unity4.3. It's generally a bad idea to wait for tech imo :)

Papercut
Aug 24, 2005

Heisenberg1276 posted:

How annoyed am I that I JUST bought 2D Toolkit

Probably about as annoyed as I am for buying NGUI. But considering the value Unity offers overall for free, I can't be too mad.

Zizi
Jan 7, 2010

Strumpy posted:

* Sprite based (same as the 2d system)
* Cutouts (via stencil buffer now)
* Unity dynamic font rendering
* Sorting (new rendering path)
* New persistent delegate system

I've worked on the font stuff and the delegate system. Michael (NGUI creator) on the gui framework and the design/components. The design is similar to ngui but really tightly integrated into unity with many things made a nicer and easier to use :)

Nice to hear some added detail on this. I'm super-excited for the new features(2d and GUI, mostly, but a lot of the other stuff, like Cloud and Unity Games are also super-exciting). Kinda has me eyeing that Product Evangelist job in SF a little :ohdear: But I digress. Really can't wait to see this stuff released.

seiken
Feb 7, 2005

hah ha ha

xzzy posted:

Along with the inevitable "installing QBasic runtime library" the first time you double click it.

Even if there is no such thing as a "QBasic runtime" (I have no idea I wasn't born in nineteen loving sixty) please make it say this anyway ala "reticulating splines"

xzzy
Mar 5, 2009

There has to be something, qbasic hasn't shipped with windows since the 90's I think.

I was mostly making a joke how every first run of Steam game installs the c++ runtimes, even if you've installed them a million times before.

Paniolo
Oct 9, 2007

Heads will roll.
There's a million different versions of the runtime so to avoid DLL hell each application nowadays just installs its own copy and uses winsxs to reference it. It's why dll conflicts are no longer a super common thing when installing software.

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

xzzy posted:

There has to be something, qbasic hasn't shipped with windows since the 90's I think.

I was mostly making a joke how every first run of Steam game installs the c++ runtimes, even if you've installed them a million times before.
The real joke is how every Steam game comes with its own copy of DirectX/VC++/etc so you end up with a million copies on disk.

Chance
Apr 28, 2002

Papercut posted:

Probably about as annoyed as I am for buying NGUI. But considering the value Unity offers overall for free, I can't be too mad.

Yeah that was a well timed sale. But I'm sure I can get that value out of it before this is fully out.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Yeah I payed under $40 for TexturePacker, 2D Toolkit and NGUI somewhat recently and I don't regret it one bit. Solid pieces of software.



Quick Unity question though, is there any way to prevent items in the resources folder from being copied into a certain platform's build? Now that I'm creating separate PVRTC atlases for iOS and PNG for everything else I really don't want the PNG files going into the iOS app bundle.

Synthbuttrange
May 6, 2007

I got a game finished out of 2d Toolkit. Some bits are clunky, like editing frames, but otherwise its pretty solid. I did get it for half off though, so no complaints.

Adbot
ADBOT LOVES YOU

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice
2dtoolkit is worth the purchase because I can do stuff like this.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply