• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by roamcel · Jan 10, 2012 at 09:39 PM · imageformatexecutable

ARGB32 ... why how?

Hi,

I have a script that writes on a texture that works perfectly in editor mode, yet when I compile the texture stops updating. I believe this might come from the fact that the original texture is a psd that's been overriden as argb32 in import settings, so I'd like to simply create the texture in that format, without the need to override it.

But I'm struggling to find information on HOW or WHAT creates textures in that format. Simply put: what's the extension of an ARGB32 file? I've tried using photoshop and the dds exporting tool, to no avail: the texture format is reported correctly, but the image properties can't be seen in the inspector like so...

Please help, I can't find a reason why it works in editor mode and doesn't work in executable mode.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image roamcel · Jan 11, 2012 at 06:54 AM 0
Share

to anybody stumbling upon this: the problem was not image-format related. info below.

1 Reply

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by MartinCA · Jan 11, 2012 at 12:38 AM

I'm not sure as to why your scripts works in the editor and not when compiling as executable.

That said, ARGB32 is not a file type (hence, no specific extension to that), it represents the "raw" data format of your image, it stands for "alpha,red,green,blue 32bit", that is if you visualize your actual image data as a long array of bytes (which it is really), each pixel is represented by 4 bytes where the first byte is the alpha value, the second is red, third is green and fourth is blue - hence the 32bits per pixel.

The image file itself contains additional information besides the raw data, it has various headers and meta information stored in the file, and often the raw data itself is compressed and not stored as an actual linear array of bytes. The ARGB32 refers to the format of the raw data you extract from the file after going through the file-type specific mechanisms - luckily for us, Unity handles all the file type specifics for us when we import assets or load them at runtime, and we are left with only the actual image data.

That said, as for which file types support ARGB32 - pretty much anything that can encode images in 32bpp color depth and supports alpha layer, PSDs and PNGs come to mind.

Also, make sure you're accessing the data of the texture using GetPixel32/SetPixel32, these methods use the Color32 class that supports 32bit colors. Another thing that comes to mind would be to see if you haven't selected any options to compress the textures in the build settings - I know these features are available when targeting iOS and Android, but there might be a similar setting for Standalone apps as well.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image roamcel · Jan 11, 2012 at 06:53 AM 0
Share

Thanks for the detailed reply. Turns out the problem stemmed for what seems a bug rather than anything image-related: to retrieve the texture I was using 'material.mainTexture', and this didn't work in executable. After I dragged the texture directly into the public variable, without using mainTexture to retrieve it, the function worked on executable too.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

GameObject problem 1 Answer

SVG vs other formats for GUI 0 Answers

[meta] What is the problem? I cannot upload image. 0 Answers

Export objects to a .3DS file at runtime 1 Answer

Best Image Format for Unity Game Textures? 4 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges