Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by Cricket88 · Aug 16, 2014 at 11:11 AM · 2dgraphicsbackgroundimporting

Background Image in a 2D game: problems of size/quality importing. What's the right workflow?

Hi everyone.

Recap is in bold.

Developing a 2D game we have a large (width) background image which is the result of different drawings merged together. I've forced the size to be a power of 2 for dxt5 compression (i've just adjusted the canvas size) and the image format is .png: 32768 x 4096. (argh xD)

The resulting imported image in unity is of terrible quality and till now, attempting to change parameters (sprite(2d/ugui), advanced, max size to 4096, etc...) didn't that difference.

Obviously slicing to smaller chunk the original image results in better single ones, but also (predictable) in a total growing size...wich become unbearable for a single image up to 8 mb (about 10 images made the bigger one we're talking about...).

So my question is quite simple: I don't have a clear idea of a workflow for producing 2D images and use them for a 2D game (especially extended backgrounds). Do I have to keep the long image approach? or build the background out of several smaller images?

Whichever the case, which is the right approach to import with a satisfying quality/size(Mb)/dimension(width/height)?

thanks in advance

Comment
Add comment · Show 2
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 robertbu · Aug 16, 2014 at 06:53 PM 0
Share

Unity Forums is a better place for design/discussion questions.

No expert in this area, but to solve a similar problem, I broke things into 2k x 2k chunks and loaded and unloaded them using Resources.Load() and Resources.Unload. In other words, I focused on the memory footprint and did not worry (much) about file footprint.

avatar image Cricket88 · Aug 18, 2014 at 06:51 PM 0
Share

thanks for the advice :) I'll try to post later on the forums too!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by smoggach · Aug 16, 2014 at 09:16 PM

Robertbu has mostly the right answer. You wont get a quality image that large into memory. You'll probably end up with something similar to what my application does with high quality renders of 3d animations. It stores all the frames on disk as .pngs and decompress/load them into memory one at a time. We had to slow our frame rate down to 12 fps on mobile but for our purposes that was acceptable.

In your case you'll probably want to break them up into slices 512 or 1024 in width. Then have some script using Resources.LoadAsync or a WWW request to create a texture out of it as your application requires.

As for your answer: You can go down the path of trying to get quality out of compressed-in-memory formats like dxt and pvr, or you can find efficient ways of getting high quality raw images in/out of memory.

Comment
Add comment · Show 3 · 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 Cricket88 · Aug 18, 2014 at 06:56 PM 0
Share

mmm this is still blurry for me XD the slicing operation you're talking about is a 'preprocessing' of the image (I manually cut the background into several pieces for ex with photoshop, and load them at runtime as different objects) or ther's a way to do this in a smoother fashion? like load the entire image as a file with his native quality and then managing his parts one by one?

avatar image smoggach · Aug 20, 2014 at 04:52 AM 0
Share

Technically you could do it all by script at runtime if you wanted to but it might be faster to slice it up manually.

avatar image Cricket88 · Aug 21, 2014 at 08:40 AM 0
Share

http://forum.unity3d.com/threads/background-image-in-a-2d-game-problems-of-size-quality-importing-whats-the-right-workflow.263015/

I've transfered the topic on the forums as robertu suggested :)

yep that's what I'm gonna try to find out...XD the workflow I was speaking of :)

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.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How would I go about constructing a layered scene? 2 Answers

Background Bitmap 3 Answers

How can I unfocus and fade my background in a 2D game? 0 Answers

How to make a simple "That's all folks!" effect in 2D? 1 Answer

Material is destroying sprite`s quality 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges