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 /
This question was closed May 08, 2013 at 09:25 AM by Fattie for the following reason:

Problem is not reproducible or outdated

avatar image
1
Question by RalphTrickey · May 04, 2013 at 06:00 AM · graphicsmaps

Blending textures for a random 2D(ish) map?

Is there any better way to do this or any input on which way is more likely to work, or some entirely new approach suggested for that matter?

I'm looking at designing a simple procedurally generated random 2D like outdoor map using hexes, a bit stylized like a board game map.

Ideally, I would like to be able to define the hexes with 'overlays' of textures, overlay 1 might be ground, overlay 2 might be some trees in the NW corner, overlay 3 might be a road from N to S, overlay 4 might be a river from the SE to the W, etc. I want to use a texture atlas for each layer and modify the UV values to pick a different part of that atlas for the specific graphic.

In DOS/Windows, the way to do this is to take over the entire screen and paint the first layer, then the second layer, then the third layer, etc. Pixel by Pixel. Works great on a PC, but I'd really like to take advantage of the GPU for smooth panning and zooming. (Plus some 3D decals, etc.)

One way to do this would be to do this the DOS way and paint into a shared texture atlas (or several atlases) and use that on the hexes and let the GPU do it's magic.

A different way would be to give them slightly different depths (which would limit how closely the camera could zoom, but it might be OK if I limit the camera) I haven't seen any way to do this without many meshes/objects (one per layer per hex)

Thanks in advance

Comment
Add comment · Show 8
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 Benproductions1 · May 04, 2013 at 06:10 AM 1
Share

Just making sure this is related to Unity: Are you using Unity? (It's impossible to tell from your question and your karma/history)

avatar image RalphTrickey · May 04, 2013 at 05:07 PM 1
Share

Yes, I expect to use Unity. I'm just starting with Unity (already read/worked through Unity Game Development Essentials), and I'm an experienced C++/C# developer. When I was looking OpenGL, the same issue seems to exist there.

avatar image Benproductions1 · May 05, 2013 at 08:40 AM 0
Share

I think it would be easiest to just make layered objects, btw in Unity you don't have access to the rendering code, so you can't implement your own OpenGL stuff, but you can write shaders

avatar image Fattie · May 08, 2013 at 09:12 AM 0
Share

DID THIS HELP? PLEASE "TIC$$anonymous$$" ANY ANSWER TO CLOSE THE QUESTION - THAN$$anonymous$$S!

avatar image Benproductions1 · May 08, 2013 at 09:21 AM 1
Share

@Fattie Why do people like this exist. They come asking questions and don't have the courtesy to maintain their posts...

Show more comments

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by Fattie · May 05, 2013 at 08:58 AM

Ralph, it is absolutely trivial to do this in Unity. It would be as if asking, in Illustrator, can I add type?" - heh

Imagine square images say 10m x 10m. (A "sprite" if you will.) So you would simply have a trivial plane (in unity click "add plane", resize it to the size you want) and drop that texture on it. So you might have say a dozen different such images, perhaps.

You'd simply sit them next to each other. You mentioned you might want the adges to blend, if so no problem, just have them somewhat overlapped, and the edges would blend. Nothing to it.

What you said about different layers on top, road etc - again nothing to it.

This sort of "2.5D" thing is absolutely commonplace:

alt text

notice the three flat planes there, each with different images ... actually it's nothing more than a "drop shadow" - heh. the yellow image is a drawing of a cat, and the red/black are just a frame around the image. they are a meter apart or whatever (the camera would be on your right in this example)

doing 2.5D in unity is great, it's fantastic. Once you do it you'll likely never ho back to another metaphor/pipeline. Apart from anything else you can completely use 3D physics normally, and so on. Everything is a breeze. Note you may choose to use an orthographic camera in (just look at "camera" in the inspector and click to orthographic, if you want).

You are right that it is somewhat confusing "how the hell do I do 2D in a 3D engine" until you have a quick play, then it all makes sense.

(JUst TBC you would not have to touch shaders, etc, in the slightest to do a whole project like this. It's totally taken care of.)

you should definitely grab 2DToolkit (and the other such competing products) from the asset store, and decide which one you like.

2DTK offers an unbelievable amount of development already done. You just drop PNGs in a folder and it does everything, optimises sprite sheets, even makes them for different resolutions, etc etc. It completely and utterly handles 2D animations, sprites, colliders, blah blah, it sets up proper two-triangle planes and so on and so forth.

(Regarding what you say about shaders, again for 2.5D, 2DToolkit completely takes care of it, offering a selection of the typical shaders you would use in a side-scroller, overhead game as you describe, etc.)

PS when you get to wanting to add type, here is exactly the pipeline we now use having suffered greatly trying to find the best approach: http://answers.unity3d.com/questions/384623/setting-font-size-according-to-screen-dpi.html?sort=oldest

hope something helps ! Enjoy Unity !


2.5d.png (18.3 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 RalphTrickey · Jun 08, 2013 at 03:23 PM 0
Share

Thanks for promoting this to an answer ins$$anonymous$$d of a comment. It's a well thought answer and I hope it helps someone.

It looks like an excellent approach for some games, but I've decided for my game to do a slightly different route. I'm going to try using the HexTech engine as a starting point. While it's not being actively developed, I believe that it's far enough along to give me a good start. It seems incredibly inefficient for my purposes, but that is actually a good thing, since if I clean it up, I may be able to use a simple approach and still get good performance.

The main difference with that approach is that I should be able to move the camera around and zoom in without artifacts, which I don't think would work with a 2.5D approach. I'm going to try doing multiple layers and hand generating meshes to see if that will give me the performance I want without Z fighting.

Follow this Question

Answers Answers and Comments

14 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

Related Questions

Geometry shader output to mesh in Unity 4 0 Answers

How can you represent overlapping energy fields? 0 Answers

Is it possible to import maya mental ray light effects in unity without using baking?? 2 Answers

Specific texturing 1 Answer

Does using "half res" in the quality settings reduce texture RAM usage? 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