Optimizing Low Poly Style Shading in Unity 3D 2017

I started to work on a VR game project with Low Poly Style graphics. I am going to announce the new project next months. It’s very crazy and something never been tried. We are realy excited to work on it!

Eventhough, I used to work on Low poly style graphics in 3ds max ( I have even a tutorial post in previous pages), it is quite tricky when working in Unity 3D. When it comes to creating 3D models for VR experiences, keeping the vertex count low is very important. Models must be really low poly and the scene must be very well optimized for a fluid experience.

However, when i export my low poly models with individual smoothing groups per polygon, vertex counts in Unity increases to astronomical numbers. I was very surprised when i realized smooth objects are more performance friendly rather than flat objects (Low poly style). Because i was expecting the opposite.

So I wanted to test what is actually happening.

I created this two geosphere above in 3Ds Max. They are absolutely same, clone geospheres. I named them as “smooth” and “flat”, then i added smooth modifier to the “flat”. Then i lower the smooth treshold like picture below.

Then I exported them to Unity 3D 2017

Keep in mind that an empty scene in Unity 3D causes 5k vertex eventhough there is no object around. It is because of the skybox in the scene. If you clear the skybox from lighting panel you can decrease default vertex count to 4, I assume. 

As you see the picture above, you will notice that flat is 4 times more, compare to smooth. In larger scenes, this difference will be beyond acceptable limits.

What is the correct way to create Low Poly Style Scenes?

The best way to solve that issue is creating the low poly style in shaders. Exporting 3D Models with 1 smoothing group is best for performance. Then you can give it low poly look with shader below.

http://www.shaderslab.com/demo-90—flat-shading.html

As you see in the picture below, object “smooth” has flat shading material which i downloaded from the link above, has no vertex difference compared to its default.

The result is absolutely wonderful for me.

I hope the post was clear and helpful for the people who stuck in that problem.

 

Advertisements

I Was In Arles How To

I Was In Arles from gunisigicihangir on Vimeo.

This is an artwork which I created as my graduation project for Marmara University-Istanbul. Digitalizing a classic artwork always excites me. While I was working on Microsoft Kinect that idea appeared in my mind. How great it would be to see unpainted areas in Van Gogh’s Bedroom painting. After the graduation exhibition in Marmara University, it also exhibited in amberFest 13′.

This work looks quite complicated but actually it is one of the simplest projects that I made.

I started by searching how to adding skeleton data taken by kinect into a Unity 3D project. I found a sdk which is released by Microsoft for Unity. You can download it from website below.

http://wiki.etc.cmu.edu/unity3d/index.php/Microsoft_Kinect_-_Microsoft_SDK

You will need to install kinect developer toolkit and kinect SDK too. Just after the download has finished, open the Unity3D and run “Kinect1.7UnityPackage.unitypackage”. Make sure all the packages are selected then press import. This will import a package consist of some codes and an example project.

1

We can work inside the example project by modifying it. When you import all the package you will see KinectSample in the Project window below. Full path is Assets>Scene>KinectSample.8-01

To create the feeling of looking at inside the picture I decided to create a main camera with a target point which is always looked at. Because if you dont use a target point the camera always look the same direction.

I found this code from reference tab from Unity3D’s website.

var target : Transform;

function Update() {
transform.LookAt(target);
}

I copied and pasted this codes as a javascript code in Unity and simply linked it into the camera by dragging and droping. You can create a Java Script file by right clicking in the project window and create>Javascript. You must see the component in inspector menu when you select the camera. Then I created a cube front of the camera for the target and attached it to the “target tag” of the component that i just created inside the camera. You can reach the target tag inside the inspector menu and you can add an object by clicking the circle beside it.

9

The distance between the camera and the target point is important to make the movement more natural. But it depends on the project.

5Second, I attached the camera to the “03_Head” inside the “KinectPointMan”. The project has 2 skeleton. rainbowMan_v06 and KinectPointMan. I used “PointMan” because the other one vibrating the camera while Point man is smoother.

 

 

 

 

To finalize the project delete the “rainbow man” which we didn’t use and move the camera until the KinectPointMan disappears from the screen. Then you can create your own scene to look inside. I would love to share my 3D model for Van Gogh’s bedroom but unfortunately it was erased with many project which I didn’t sync to cloud after the burned hard disc disaster.

I created a couple of cubes to realize the movement as you can see below. I preserved the skeleton just to show you my body movements.

7

 

You can manipulate the distance to see the difference.

I hope you enjoyed this tutorial. See you next time.