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
1
Question by xmcdeath · Feb 21, 2013 at 03:58 AM · 2dgameobjecttextureperformance

2D Side Scroller Background

I'm working on a game with a 2D background that borders the level. The border is very high res, so we are using numerous planes with portions of the background image on them snapped together. the result is this:

each piece is a separate plane with a portion of the texture

So my question is... is there a better way to do this? The planes and extremely high res textures are resource consuming and extremely messy. I'm looking for a cleaner method to draw the background throughout the whole level.

Thank you in advance for any solutions or suggestions.

  • xmcdeath

planes.jpg (168.9 kB)
Comment
Add comment · Show 4
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 · Feb 21, 2013 at 06:04 AM 0
Share

What platform? How big are the texture for each panel and how many total panels? Are you having memory issues with your current solution?

avatar image xmcdeath · Feb 21, 2013 at 07:21 AM 0
Share

There are about 30 planes, each with a 512 x 512 texture. The game is being built for the PC at the moment. I haven't run into any major performance problems, although I would like to find the best way to do this, and my current method strikes me as incredibly "messy".

avatar image xmcdeath · Feb 23, 2013 at 08:02 PM 0
Share

No more suggestions?

avatar image robertbu · Feb 23, 2013 at 08:36 PM 0
Share

One thought (and I'm not sure it buys you anything) is to combine all of your textures into a single atlas. The atals would "only" be 2$$anonymous$$ x 4$$anonymous$$. Then for display you build a mesh and use UV coordinates into the atlas to display. This would give you a single game object for display. Given the PC as the platform, building a single plane with a 2$$anonymous$$ x 4$$anonymous$$ or even a 4$$anonymous$$ x 4$$anonymous$$ texture with some transparency should work fine.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by flamy · Feb 21, 2013 at 05:31 AM

This sure is one of the dirtiest method possible. there are different ways to do it ,

Make a plane by yourslef in maya or max, that has only 2 tris and 4 veritices. like the one in this image

alt text and apply texture over it. If you take an alpha blended png, you dont have to worry much about empty space!! The whole bg will now have mesh data size of 4 verts.

you can download the plane I used from this link


1x1.png (452.5 kB)
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 xmcdeath · Feb 21, 2013 at 07:23 AM 0
Share

I've considered this, although the problem with using a single plane is that the texture would be very large... I have 30 planes, each with a 512x512 texture on them, so merging these into one would be difficult.

avatar image
0

Answer by Kiloblargh · Feb 23, 2013 at 08:19 PM

Ok, one more suggestion, but I don't think you are going to like it... Scratch the idea of drawing your entire level as a single massive image, and switch to a set of small reusable tiles for the background. Make detail bits that you can place separately from the repeating parts, and overlay low-detail, enlarged transparent images for things like the shadows.

From your picture, you've got so many megabytes (gigabytes?) of pixels used to get an effect you could have achieved in so much less, if assembled with more cleverness and care. Study how they did things back when a whole game had to fit into a SNES cartridge. Of course you don't have to take it that far, but a megabyte saved is a megabyte earned and you could easily save enough space to use true-color textures instead of ugly compressed ones.

Your game may be brute-force playable on a PC as it is, but it will never port to mobile, which you may soon find yourself wanting to do.

Comment
Add comment · 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
0

Answer by steinbitglis · Feb 23, 2013 at 08:50 PM

Here are three strategies I would consider:

  • Do the texturing in a 3d editor. (This maps well with what the GPU needs to do).

  • Use some mesh building tool to build you world pieces within Unity (Autotile, Ex2D etc...)

  • Build your own tool and generate a mesh based on a single or a few textures

If you're doing a small project, you're already doing what you should be doing. Optimizing these things might be very time consuming.

Comment
Add comment · 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

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

11 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

Related Questions

A node in a childnode? 1 Answer

Why do I get those green lines? 0 Answers

How to create a circle around a selected game object? 1 Answer

Crunched texture compression - when to use? 2 Answers

Floor Blood Splatter? 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