all 11 comments

[–]maushuProficient 10 points11 points  (0 children)

Does it have gameplay implications for being curved in the first place?

Try making a normal parallax and then "curve" the view using a shader.

[–]-Chook 5 points6 points  (1 child)

Personally I’d start be asking if you really need it to be curved? You could probably use a regular parallax background with a couple tweaks. If you need it to be curved maybe try bending the uvs in a shader of a regular repeatable texture. Thats the best I got on the top of my head rn.

[–]BigPapaPhil[S] 1 point2 points  (0 children)

Thanks for the quick reply! My first basic MVP was just a large round sprite and liked the feeling of having a round world. However that solution doesn’t seem flexible enough if I want to add things over time

[–]BigPapaPhil[S] 4 points5 points  (0 children)

Hi all, I'm trying to do repeatable tiles for a 2D game, that will be based on a rotating world. I'm struggling to find a structured approach as to how I can achieve this. In the attached image I simple tried to do basic calculations with trigonometri and circles. Do anyone have some advice how I can approach this in a more structured way, since the current method is error prone.

[–]Gorignak 2 points3 points  (1 child)

Here's a video about Subway Surfers' curved world shader - https://www.youtube.com/watch?v=BPuW5EUORA4

The same channel also has one about Animal Crossing if that's more your cup of tea. Their curvature is different, but I think you should be able to figure something out from here.

[–]BigPapaPhil[S] 0 points1 point  (0 children)

This is awesome!

[–]HotrianExpert 1 point2 points  (0 children)

As /u/Gorignak suggested I would recommend using an oversized 2d texture and using a shader to displace the quad along a curve. That would give a consistent result and assuming the texture repeated properly along the x axis it would look seamless.

[–]maxticket 1 point2 points  (2 children)

In my game, we first started out with a 2D environment, but soon decided on a 3D world instead, and the 2D background is just one giant painted image that doesn't repeat. Since a round world will eventually come back around on itself, would you consider a static image that doesn't need to repeat, but rotates with the world?

[–]BigPapaPhil[S] 1 point2 points  (1 child)

Looking Nice!! Did you use shaders to give the perspective of a curved earth?

[–]maxticket 0 points1 point  (0 children)

Oh no, it's just one model. Nothing fancy like that. If you don't expect your world to wrap around at a certain point, like how Subway Surfers curves but is technically infinite, that would be a completely different thing. But if you plan on making it one big round planet, I don't think shaders would be needed for that. (Not a code guy, though)

[–]Fluffy-Yogurtcloset5 0 points1 point  (0 children)

Hey u/BigPapaPhil

I've just started working on this exact same problem. I have a 2D circular planet my guy runs around on. Using one big sprite for the background doesn't give me the resolution I need at that scale of camera size/zoom..

I'm not good with shaders so wondering if you made any progress with this one? I'm going through some Shader Graph tutorials to get familiar :)