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 Sandstorm · Jul 19, 2013 at 08:08 PM · shaderterrainsphere

How to generate a smooth spherical world?

Hi

First a description of what I'm trying to achieve. I'm trying to make a game where you can modify the spherical world you're standing on. Such as the old game Populous 3 / Populous the beginning.

Populous 3 screenshot

Now I read on wikipedia that the maps you play on in that game, aren't actual spheres but instead composed of a real projective plane

Wikipedia article on real projective plane

So based on this, I tried to make a vertex shader which warps the plane to a spherical view. This looks fine for the sphere itself, but it fails horribly when I attempt to attach stuff like trees on it as i get distanced to these objects. They simply don't follow the surface.

Close up of objects Objects in distance

Notice how the tree hovers above the ground, and the 45 degree turned cube which has the same vertex bent shader applied to it also hover slightly above the ground despite both the plane and the cube being at y = 0.0

So I tried looking for an answer in the forums, and the closest thing I came across was this article:

Article involving a spherical world

Now the possible solutions I can come to think of is:

1. Finding a way to use the shader with a terrain My ideal way of using unity was to take advantage of the built in terrain engine, which I am aware is optimized to do stuff based on its height. My shader won't work on that though.

2. Finding a way to get a nice evened-out sphere If I shouldn't use a terrain or plane due to the problems described, I might as well just have an actual sphere instead of a shader-manipulated plane. However that introduces another problem; A sphere mesh usually has vertices very far apart in the center, with a very high concentration of vertices at its poles. Any idea on how to get an evened out spherical mesh?

I did also consider modifying the camera, to have a fish-eye-ish effect. I don't know how to achieve that either though.

So, if anyone has any suggestions on how I can achieve that populous 3 effect - either by the methods I described, or a completely different approach - I would very much appreciate it :)

screenshot1.jpg (37.0 kB)
screenshot2.jpg (56.5 kB)
Comment
Add comment
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

1 Reply

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

Answer by Kiloblargh · Jul 19, 2013 at 08:16 PM

Try combining the mesh of the 'tree' and 'house' with the planet mesh. If that works, then try keeping the tree and house transforms at (0,0,0) and just moving the vertices of their mesh around to place them.

There's a spherical map setup for a geodesic dome / buckyball shaped world on the asset store, and there's also a horizon-warping effect intended for "endless runner" games that could probably also apply to a sphere world if you don't need to zoom out that far. Don't know what they cost, but if either solution works then it's worth it if your goal is to get this game done, less worth it if your goal is to expand your knowledge.

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 Sandstorm · Jul 19, 2013 at 08:39 PM 0
Share

Aha! A geodesic dome! Thanks :)

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

15 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

Related Questions

Billboard trees glow white in dark scene. 2 Answers

Adding a static fog in the bottom of a terrain 1 Answer

Using custom vertex shader for terrain? 0 Answers

FX/Flare is always on top 0 Answers

How to change terrain shader 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