• 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 Jesper Rasmussen · Jan 17, 2011 at 11:39 AM · 2d3dgraphicsisometric

Isometric game: 2D background mixing with 3D models

Hi there.

We're developing an isometric game for the iPhone.

Graphically the game will have a 2D static background (carefully drawn to match the camera angle), a number of 2D static objects (trees, columns, etc) and 3D dynamic objects moving around between the static objects.

The problem: make sure our dynamic 3D objects are shown properly behind or in front of the static objects.

I see a few possible solutions:

1) Put each static object into a billboard (plane?). Either place these by hand or by having some python script work thru the background image.

2) Render dynamic objects as 2D sprites. Draw bg and all sprites in order of the screen y coordinate of footpoint.

3) Use some "magic" pixel shader on all dynamic object to make sure each pixel is either occluded or shown.

Is there an easier / faster method? What will be the easier? What will be faster?

Cheers, Jesper Rasmussen

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 Jessy · Jan 17, 2011 at 01:45 PM 0
Share

Unity doesn't support Python. Boo is the closest.

avatar image azzogat · Jan 17, 2011 at 01:54 PM 0
Share

using planes for your static pre-rendered or drawn background is the most common (and easy) way of doing this.

2 Replies

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

Answer by Jessy · Jan 17, 2011 at 02:09 PM

For iOS, your best bet is probably to use a non-alpha testing shader, render all of your 2D dynamic objects after 3D dynamic objects, and employ your own sorting method so that they render back-to-front. You can use Shader.renderQueue to do that dynamically. I say "for iOS" because alpha testing on the POWERVR GPUs is slow.

If you don't want to do that, you can use a combination alpha testing/blending shader, or just an alpha testing shader. Be aware that they tried to foolproof alpha testing on iOS, so your darkest greys will get cut off just slightly faster than you would anticipate; you'll have to apply a Curves line, where 0 = .01 (i.e. 3 if we're talking 0-255), and 1 = 1, for your alpha. AlphaTest Greater 0 isn't recognized in Unity iOS anymore. >:-(

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 Jesper Rasmussen · Jan 25, 2011 at 02:19 PM

Thanks for your answer Jessy.

I think I get your shader idea ... I would have to use the z-buffer to mix in the 2d with the 3d objects, right? Guess I have to study shader magic first to fully understand it :o)

I just had another idea: maybe one could set the Shader.renderQueue for all object based on the screen.y position of their footpoint. In that way alle objects (2d or 3d) would get rendered in the right order.

Would this work?

Cheers, Jesper

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Looking for a simple way to Add an Image or text to a 3d Model 1 Answer

3D Isometric Grid Based System, a feast of questions; 1 Answer

Do I make an isometric game in 2D mode or 3D mode? 1 Answer

UDP app signature? 1 Answer

New sprites in 2D projects only? Cannot add in 3D project 0 Answers


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