Unity: Real-Time Rendering Fail!

Unity Logo

I am trying to use game engine to do real-time rendering for Visualization. Game Engine such as Unreal and Unity uses pre-baked lighting and shader. Theoretically, it can render up to 60 frames/ second.  while v-ray for maya may take up 10 minutes to render single image.

V-ray is very  powerful in terms of creating render passes for composting . But Game Engine prevails at time-saving.

Unreal Engine provides very powerful tools for real-time rendering. But in Unity, I have to attached to a script manually to render, and it is very buggy.

The script is like following, attach it to the camera to use:

———————————-

using UnityEngine;
using System.Collections;

public class CameraCapture : MonoBehaviour {

// Set the render directory and frame-rate.

public string folder = “C:/Users/******”;
public int frameRate = 25;

void Start()
{
// Set the playback framerate (real time will not relate to game time after this).
Time.captureFramerate = frameRate;

// Create the folder
System.IO.Directory.CreateDirectory(folder);
}

// Update is called once per frame
void LateUpdate ()
{
// Append filename to folder name (format is ‘0005 shot.png”‘)
string name = string.Format(“{0}/{1:D04} shot.png”, folder, Time.frameCount);

// Capture the screenshot to the specified file.
Application.CaptureScreenshot(name);
}
}

—————————————

IT DOESN”T WORK !!!!!  You get this:

0003 shot

The only way to render it out is to turn off anti-alias setting (menu: Edit > Project Settings > Quality): Disabled

0002 shot

We are loosing the quality for not getting smoothing contours from the geometry.  Bummer!

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s