I think that game in the video was actually built on a rotating cylinder or other curved geometry. I don’t think the curved effect is from a post-process. From what I see, I don’t see how simply applying a post effect would replicate what is happening in this game.
The GLSL shader devMidgard appears to actually displace vertices before rendering. So that approach is viable if you can find a way to do it in PlayCanvas.
It may seem like it’s actually built on a rotating cylinder or something like that, but that’s actually the magic of shaders.
Just imagine how complex would a game like that be to design, because if you build everything on a rotating cylinder, setting up colliders and other stuff is quite tricky.
However with a shader like the one I found you can simply design the game like any other, on a flat scene, then the shader would take care of making the illusion and tricking you into believeing it’s actually been built like that.
No games would choose the “build directly on an actual rotating cylinder” approach because of the difficulty on design.
Now, another question that raised in my mind while looking up shaders that curve the world like in Animal Crossing or any mobile game, is what happens with colliders? If you displace the vertices then the collider volume you’ve set up in the editor simply won’t be on the right spot, because it doesn’t know what the shader is doing, right?
But actually, it’s all fine! Because by the time the player is about to collide with the object in question, the displace of the vertices is minimal or even nothing, because the distance to the player is very near, so the shader has stopped displacing its vertices.
It’s a very neat and genius approach to making game worlds like that, I was pretty surprised reading about it and have long wanted to make a “curved world” game. Maybe in the future
I am doing exactly this for my current project with just an easy code that curves the vertices downwards the further they are in world space (you could change that, eg. distance from camera etc).
This code is part of a vertex shader (vec4 getPosition() to be exact, in transformVS chunk)
Hi Karel, thank you for sharing the code!
How can I change it so it use z distance to camera instead of z-value of it’s position?
I’m newbie at shaders)
Here is my try on it, on a single direction (move around by clicking the mouse and using WASD or arrow keys). It takes into account the active camera position to calculate the curve center.
Hi @Leonidas I am trying to use curve shader in my game, but not all entities in the hierarchy are being effected by the same. Could you please help me? Here is the link to the test project.