简体   繁体   中英

Möbius effect in Unity

This morning I've seen the following animation on Twitter. It is a kind of Möbius strip effect.

It's cool! Isn't it? So I've decided to build something similar using Unity, just for fun. I want to build the effect using just the cameras, as this way we can use it for any rotating scene. The first step has been to create a circle scene and make it rotate:

Note that the camera uses an ortographic projection so perspective does not deform it. This is important so we can merge different views later.

Then I've replaced the main camera by two different ones, located in opposite positions (horizontal and vertical) and rendering to textures. A simple Canvas with two panels (divided vertically) shows the partial result (one camera texture per panel):

I know this is cool, but not perfect yet, as the center of the rendered output shows clearly where a panel finishes and the other one starts. Look at the center of the rendered output above.

The original inspiration video shows no perspective in the center, and I think that is the trick, but I cannot achieve that with an orthographic camera (or I don't know how).

Do you know any approach to distort the camera or something similar, so the cameras are perpendicular in the middle of the scene (and only in the middle)? Are you able to think a solution to dissimulate the joint of both camera views?

Note:

As a first approach (dismissed for the moment) I've tried to add another camera, perpendicular to the scene so there is no perspective in that point. Then I render its output in the UI in another panel on top of the previous ones. And it is not too bad, but again the joint is too obvious and now I have two joints instead of one:

Funny challenge, right? Any idea to solve the problem?

After some effort, and thanks to @joreldraw's suggestion, I've found a better approach for the moment: overlapping the panels and using a shader mask to combine both images in the middle.

Anyway I'm sure there must be a way to make the camera perpendicular in the middle and not on the sides. Hopefully somebody can give us some ideas about how to do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM