Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411511 Posts in 69375 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 01:26:44 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Ocean Globe Effect in Unity
Pages: [1]
Print
Author Topic: Ocean Globe Effect in Unity  (Read 1041 times)
codekitchen
Level 0
**


View Profile WWW
« on: February 25, 2017, 10:39:33 AM »

I was really curious how Daniel Linssen implemented the "ocean globe" effect for his GGJ17 entry Polka Dot Pirate, since this is an area far outside my expertise. So for my own education I analyzed it and reproduced something like it in Unity.

Here's a short clip of the effect in his game: https://twitter.com/Managore/status/824662047203876864

And here's the reproduction of the technical effect that I've created:



I believe Polka Dot Pirate was made with Gamemaker, which is a 2D engine, so he also had to build up a model/view projection and map his 2D tilemap onto it. I wouldn't be surprised if much of that was done in shader code, I chose to do this all in-engine since I could just use Unity's 3D support. I have no idea how my approach compares, but after some research and fiddling around I settled on using Gerstner Waves and then projecting my flat tilemap around a semi-sphere, moving the tiles to simulate movement of the player.

The Unity project is available on Github.

If anybody would find it useful I could do a short writeup on how I implemented my version, since I was very much learning it all myself as I was going along. Otherwise, my curiosity is satisfied, now I can get back to my own projects.  Cheesy
Logged
DireLogomachist
Level 4
****



View Profile
« Reply #1 on: February 25, 2017, 03:04:42 PM »

Hey very cool. I was also curious how Daniel had made that. Nice to see it replicated
Logged


Living and dying by Hanlon's Razor
laserdog
TIGBaby
*


View Profile
« Reply #2 on: February 26, 2017, 08:44:39 AM »

If anybody would find it useful I could do a short writeup on how I implemented my version, since I was very much learning it all myself as I was going along. Otherwise, my curiosity is satisfied, now I can get back to my own projects.  Cheesy

I'd be VERY interested in reading this writeup.
« Last Edit: February 26, 2017, 10:53:58 AM by laserdog » Logged
managore
TIGBaby
*



View Profile WWW
« Reply #3 on: March 07, 2017, 09:30:45 AM »

I believe Polka Dot Pirate was made with Gamemaker, which is a 2D engine, so he also had to build up a model/view projection and map his 2D tilemap onto it. I wouldn't be surprised if much of that was done in shader code, I chose to do this all in-engine since I could just use Unity's 3D support. I have no idea how my approach compares, but after some research and fiddling around I settled on using Gerstner Waves and then projecting my flat tilemap around a semi-sphere, moving the tiles to simulate movement of the player.

Hey, just came across this, it's fantastic! I can answer a few questions if you like.

You're right in that it was made with Gamemaker, but I didn't use a shader to wrap the dots around the sphere (I did use a shader to wrap the clouds around, though). The position of each dot (as well as its alpha) is calculated using trig functions (which is why they stay as perfect circles). Then the waves are done by adding an offset that moves around in a small circle. I'm not sure whether that's the same or different to Gerstner waves, to be honest!
Logged
oahda
Level 10
*****



View Profile
« Reply #4 on: March 07, 2017, 09:35:01 AM »

Pretty!
Logged

codekitchen
Level 0
**


View Profile WWW
« Reply #5 on: March 07, 2017, 12:49:03 PM »

You're right in that it was made with Gamemaker, but I didn't use a shader to wrap the dots around the sphere (I did use a shader to wrap the clouds around, though). The position of each dot (as well as its alpha) is calculated using trig functions (which is why they stay as perfect circles). Then the waves are done by adding an offset that moves around in a small circle. I'm not sure whether that's the same or different to Gerstner waves, to be honest!

Thanks Daniel! I appreciate the further details. Makes sense about the dots now that I look more closely at them, they do retain their circle shape. I guessed that it was Gerstner waves because that was the simplest sum-of-sines wave model I found in my research that had a horizontal movement component, not just vertical movement, and I think the horizontal movement is a big part of what makes the waves look interesting on the globe.

Thanks for making a fun little game, and inspiring me to brush up on all my rusty trig.  Toast Left
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic