|
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 |
# ? Aug 27, 2013 05:58 |
|
|
# ? May 18, 2024 07:39 |
|
Shalinor posted:Regardless, I will grant you that doing noir with forward-shaded point lights is effectively impossible
|
# ? Aug 27, 2013 06:02 |
|
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.
|
# ? Aug 27, 2013 07:45 |
|
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. :\
|
# ? Aug 27, 2013 14:36 |
|
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.
|
# ? Aug 27, 2013 14:45 |
|
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.
|
# ? Aug 27, 2013 15:00 |
|
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 |
# ? Aug 27, 2013 15:05 |
|
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.
|
# ? Aug 27, 2013 15:29 |
|
Yeah I'm starting to think I probably had a severe case of the Up Too Late Stupids.
|
# ? Aug 27, 2013 15:46 |
|
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.
|
# ? Aug 27, 2013 19:20 |
|
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 |
# ? Aug 27, 2013 23:06 |
|
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.
|
# ? Aug 27, 2013 23:45 |
|
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:
Yodzilla fucked around with this message at 00:29 on Aug 28, 2013 |
# ? Aug 28, 2013 00:17 |
|
Yodzilla posted:
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 |
# ? Aug 28, 2013 03:21 |
|
Oh geez 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.
|
# ? Aug 28, 2013 03:32 |
|
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.
|
# ? Aug 28, 2013 15:25 |
|
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.
|
# ? Aug 28, 2013 17:09 |
|
Strumpy posted:FYI Unite Keynote is about to go live: This new 2D system looks really nice.
|
# ? Aug 28, 2013 18:16 |
|
Strumpy posted:FYI Unite Keynote is about to go live: 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.
|
# ? Aug 28, 2013 18:51 |
|
poemdexter posted:UI stuff looks great and I hope it's better than NGUI so I don't have to buy it. 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).
|
# ? Aug 28, 2013 19:08 |
|
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. Congrats on passing greenlight! I look forward to seeing Black Annex on the front page of steam!
|
# ? Aug 28, 2013 19:15 |
|
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.
|
# ? Aug 28, 2013 19:17 |
|
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
|
# ? Aug 28, 2013 19:19 |
|
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?
|
# ? Aug 28, 2013 19:24 |
|
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.
|
# ? Aug 28, 2013 19:24 |
|
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.
|
# ? Aug 28, 2013 19:28 |
|
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.
|
# ? Aug 28, 2013 19:31 |
|
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.
|
# ? Aug 28, 2013 19:38 |
|
How annoyed am I that I JUST bought 2D Toolkit
|
# ? Aug 28, 2013 19:42 |
|
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
|
# ? Aug 28, 2013 19:43 |
|
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.
|
# ? Aug 28, 2013 19:49 |
|
Strumpy posted:* Sprite based (same as the 2d system) 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 But I digress. Really can't wait to see this stuff released.
|
# ? Aug 28, 2013 21:26 |
|
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"
|
# ? Aug 28, 2013 23:50 |
|
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.
|
# ? Aug 28, 2013 23:58 |
|
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.
|
# ? Aug 29, 2013 00:25 |
|
xzzy posted:There has to be something, qbasic hasn't shipped with windows since the 90's I think.
|
# ? Aug 29, 2013 00:53 |
|
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.
|
# ? Aug 29, 2013 02:45 |
|
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.
|
# ? Aug 29, 2013 05:04 |
|
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.
|
# ? Aug 29, 2013 05:12 |
|
|
# ? May 18, 2024 07:39 |
|
2dtoolkit is worth the purchase because I can do stuff like this.
|
# ? Aug 29, 2013 05:21 |