IRCSS / 3D-Moebius-Transformations-Vertex-shader-in-Unity-3D

Moebius Transformations of 3D spaces on 4D sphere in Vertex shader and C# in Unity 3D

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Moebius Transformation Shaders

This repo contains shader code for 4d Moebius transformation of 3d space both in GLSL vertex shade as well as C#.

screenshot

Open the Sample Scene and press play. You can fly around as you do in editor by clicking right click mouse and WSAD, press shift to accelerate. You can press T to rotate the hyper Sphere and G to rotate in the other direction. This baisicly means with T and G you can increase and decrease the effect strenght. Your control center is in Manager Gameobject and Master script. There you can set some balanacing parameters. The most interesting is probably Camera Centeric.

Camera Centeric looks like this:

screenshot

Where as non Camera centeric looks like this:

screenshot


If you just want to have a look at the shader, you find the file in Assets/Shaders/Resources/Moebius3D.shader. All relevant code is in the vertex shader.

If you want to grab the C# version, have a look at the Master.cs, MobieusTrasnform(Vector3 pos).

There are more axis along the 4D sphere you can rotate the mesh at. You can add those yourself for more control.


The code is based on the work from Daniel Piker. If you would like to have more info about this type of transformation, this video is a fantastic visualisation and Daniel has written about his code here.

All the meshes in the video and the mesh in the repo are my meshes licensed under Creative Common, you can grab the meshes on my Sketchfab.

About

Moebius Transformations of 3D spaces on 4D sphere in Vertex shader and C# in Unity 3D

License:MIT License


Languages

Language:C# 71.5%Language:ShaderLab 28.5%