Vray to Unity Lightmapping Example

Vray to Unity3D Lightmapping

Real-time lighting and shadows are expensive in terms of processing power and speed.  In addition  it never looks as good as a pre-rendered image, which is the primary reason I have been  exploring baking lighting detail, from a pre-rendered image, onto a 3D model which can be used in a real-time engine.

The image on the left is a test scene rendered in 3dsMax with Vray whilst the image on the right is a baked version of the scene in the Unity3D engine.  I was exploring this as part of a solution for an interactive object viewer which I am in the process of developing, but more on that in a later post. This test is using the Unity3d lightmap shader with VrayDiffuseMap in the diffuse slot andVrayRawTotalLightingMap in the lightmap slot.

I have found it difficult to achieve an accurate result due to the awkward work flow

  • Unwrapping and Multiple UV setup
  • Determining best bake map
  • Making sure toning and gamma was translated across
  • Testing out different shaders in Unity
Baked city model in Unity3D with lightmap only

I am getting closer to an accurate result but I think there is still some tweaking and fiddling to be done.

17 Comments

Join the discussion and tell us your opinion.

jujaroo singh
March 21, 2012 at 6:00 am

are you using unity 3d for sarbloh warriors

Taran
May 12, 2012 at 12:16 am
– In reply to: jujaroo singh

Yes we are swaying towards Unity because of its easier entry level but still exploring unreal engine 3 – but as beautiful as unreal3 is we just dont have the manpower to realistically be able to produce anything with it.

juujaroo singh
May 12, 2012 at 9:38 am

What about UDK it has the same power as the unreal engine 3 but much cheaper Unreal engine is about $500,000 but udk only $50,000 Cry engine is also great but probably the same price as unreal engine 3 :p but it is very nice to see you guys doing hardwork to create game based on sikh history by the way which platform is sarbloh warriors going to be available on.

Taran
May 12, 2012 at 11:58 am
– In reply to: juujaroo singh

We have tested out udk and crysis but the development time and complexity increases considerably. I would love to use either one because the quality is amazing. Unity 3d provides a decent enough quality with a less intensive development process so is the most realistic option. But if our funding and team situation ever changed we would adopt udk immediately.

Fourthedesign
September 30, 2012 at 10:49 pm

Hello, from your experience till now with unity3d and max what do you think is better, bake the light with vray in max and then import the model to unity or bake the light in unity? What do you think is the better solution both in visual results and memory problems…

Taran
October 1, 2012 at 9:45 am
– In reply to: Fourthedesign

In my opinion, you have more control and a better result by using vray, but it won’t work on all things. For example unity terrains with foliage and trees cannot be exported for output so is best baked using the internal engine. But models that are being imported into unity definately benefit from the advanced capabilities of vray.

xullr
November 15, 2012 at 11:39 pm

Hi,

Does this approach work for liquids (detergent) too?
If I model a box in 3ds max, create a material for it that visualizes detergent and render it with vray; can I create a realistic detergent liquid in a cube in Unity3D?

felix dodd
February 22, 2013 at 10:36 am

Hi,
Im currently exploring export from MAX to Unity using baked lighting and wondered if I might be able to get a head start by asking you for a simple breakdown of the process.
cheers,

aanimation
March 7, 2013 at 4:36 pm

hi, im from indonesia, n learning about game dev using 3dsmax and unity 3D,
im interest too about vray renderer, so when i read this post, i think it about object created in unity 3D using material as diffuse | render to texture by 3dsmax | so baked material is it?

Taran
March 18, 2013 at 9:25 am
– In reply to: felix dodd

hi

basically I setup the lighting as normal using vray area lights, when i am ready to bake i setup render to texture and add an additional texture to unwrap channel 2 to hold the baked data. The key with unity 3D models is that they hold the main texture in map channel 1 and require the baked texture to be in map channel 2 – (you can copy swap map channels around by using the TOOLS > CHANNEL INFO dialog box in max. i would recomend setting up a test like i did and experimenting with diferent outputs. The LightMap in Unity hasnt worked as we expected so we have had to tweak our workflow to get the best quality output.

Taran
March 18, 2013 at 9:33 am
– In reply to: xullr

not so much for liquids as liquids change, this process is only good for static objects

Andrew Holdun
August 26, 2013 at 8:08 pm

Hey Taran,

Have you done anything more with the Vray to Unity explorations? They look awesome and I am doing work now that would really benefit a good pipeline of Vray to Unity3d.

Thanks,
Andrew

Taran
August 27, 2013 at 10:27 am
– In reply to: Andrew Holdun

been working on some newer stuff, will try to detail the process in a new tutorial.

Andrew Holdun
September 11, 2013 at 5:25 pm

Hey Taran,
Sorry to bother you but I could use this right about now…: )
Anything yet?
Thanks!
Andrew

Jagjeet Singh
October 9, 2013 at 8:19 am

HI Taran…good to see ur stuff…
I’m a 3d artist and exploring Unity3D these days…

and I’m developing a 3d game on learning purpose…

Do u also do Script stuff in Unity?

Taran
October 10, 2013 at 9:11 am
– In reply to: Jagjeet Singh

Yes Jagjeet I have been learning JavaScript and have been using Unity3D for real time walkthroughs, engineering applications and games.

eslam aboalo
January 6, 2015 at 1:21 am

Thanx Taran .. Can you make this in Tut Video

Leave a reply