Introduction to Vray Part 1 – Lighting

28 04 2011

As it’s getting close to finals in architecture schools across the USA, I felt it was a good idea to create a small tutorial to help all those students pulling their hair out because of rendering issues.  In this tutorial, I hope to shed some light (literally) on some of the nuances to my favorite render engine.  This tutorial is based on the course that I taught while I was a student at Washington University from 2008-2010.  I have modeled this scene in Rhino and will be using VRay for Rhino, but rest assured that these are basics that translate across programs, so if you’re using VRay for Sketchup or 3ds Max, the fundamentals are the same, I simply used an existing model I created in Rhino.

I will start with an interior model, with furniture and windows.

The initial model from Rhino

The next major step is to place lights in the scene.  The reason to implement the lights before adding material is simple, with good lighting the materials will fall into their own. Once the lighting is set correctly, you will then have a realistic feeling for what the materials are doing and how they react to subtle changes.  I then add an exterior light to simulate the sun coming in from each window.  To do so, I use the sun tool that comes with Vray for Rhino.  This allows the user to have advanced control over the exact sun angle given a particular time of day and geographic location, or you can manually place the angle of the sun if specifics aren’t important.

The exact location that the sun is placed in the scene doesn’t matter at all because, like in the real world, the sun shoot an infinite number of rays in a parallel direction to each other throughout the entire scene.  It should be noted that this sunlighting system works only when using the Vray Physical Camera in the Camera settings, but I will go more in depth about this later.

The next step is to add rectangular lights at the openings to supplement the sunlight system.  This helps to create additional light as well as add a bit of realism to the scene by focusing more light at the openings, a phenomena that also occurs in nature.  To do so, create a rectangular light that is slightly larger than the opening, ensuring that the light is pointing into the room.

To manipulate the lighting settings for the rectangular lights, select the light and in the properties tab, select the roll down and change it from “Object” to “Light”.  The multiplier value for these rectangular lights will depend on a few factors (camera settings, and size of the light mostly), but a few things to keep in mind, that you should select “light portal”.  This tells the program that it is to be used to supplement the existing light from the exterior, similar to the way a light comes into a window.  We also want to ensure that the light is “invisible”, so we can see through it and see the exterior of our scene. In this case, we don’t need to have the light be double sided because we’re only interested in focusing the light’s energy to the interior of the scene.

Light Multiplier settings:

Light Multiplier Values change intensity of light source

Visible Light vs. Invisible Light Source, notice the intensity doesn’t change:

Visible Light Source vs. Invisible Light Source

One sided light source vs. double sided:

One sided vs. Double sided Light Source

Below is the settings that I used for this scene, but note that your values may need to change depending on your particular scene.

Rectangular Light Properties - careful, these are scene dependent!

To ensure that I’m not getting any material interference, I have added a neutral material to the material override in the vray option settings.  In this case I check the overrride material box under the “Global Switches” tab.

Override Material with color over 128-128-128, a medium grey

In order to allow the light to come through the openings, I must hide the windows in the Rhino model, even if we’ve added a glass material to the windows because the material override will override all materials including the glass.

This seems like a good time to do a test render, but first we must look at some of the other rendering settings in our render options.  The first tab that we should focus on is the Global Switches tab.  We want to ensure that lighting is checked, letting the program know that it needs to calculate the lighting.  We however don’t want to have the Hidden Lights boxed checked because if we hid some lights in the scene, we shouldn’t have those calculate, we just want to see the effect of the lights that are shown in our scene.  We also don’t want to select the Default Lights box because we have placed lights in our scene and want to use only the lights that we have placed and have control over.

Global Switches Tab

The next tab in our options that we should be concerned with is the Camera tab.  Because we are using the sunlight system, we should ensure that the physical camera box is selected.  If we forget to check this box, the scene will be WAY too bright because we’re not allowing the calculations to compensate for the incredible intensity from the sun.  For those who have used a digital SLR camera or a film camera should quickly recognize the controls over the physical camera.  Here you have the ability to control the camera’s shutter speed, the F-stop number, and the film speed.  These three numbers work in conjunction with each other to create how the camera compensates for the exposure of the lighting.  This may take some time to get comfortable with if you have never used a SLR camera before, but the Vray manual has a very through explanation of how each of these controls works.  It can be found at ASGVIS.com under the software and support tab.

Camera Tab

The Output tab allows a user to override the size of the image that they wish to output.  If, for example, I know that I need an image that is 1500 pixels by 800 pixels, this is the place to input that information.  It also allows a user to obtain the aspect ratio from the existing scene for easy scaling, by first selecting the “Get View Aspect”, locking the ratio, and then changing the pixel size.  This is useful if a user wants to ensure what they see on the screen is what is rendered for a given size.  If I set up my scene and like how it looks on my screen, I’ll use this technique and then tell the program that I need a maximum of (for example) 1500 pixels wide.  However if I’m simply doing test renders, the output size isn’t an issue yet.

Output Tab with ability to change rendering size

The Environment tab gives the user the ability to create the environmental lighting (not the direct sunlight, but the light from the sky) and control how it is handled in the scene.  Because we have created a sunlight system, it’s possible to link the position of the sun light to the environmental light.  By linking the two, we will get a reddish light as the sun approaches the horizon as occurs in nature, as the light comes closer to noon, the environmental light will become more blueish.  To link the sunlight position to the environmental lighting, select the little “m” next to the GI (skylight) check box.

Select the little "m" to apply a map

When this is selected, a new Map texture editor pop up will appear.  Change the type from “none” to “Sky”.

Before selecting apply, we must make sure that the program knows which light source we want the sun to be.  Select the button next to “Sun-light source”.  A new pop up menu appears and now allows us to select the sunlight we previously created.  If we leave this at “Default”, we will not create a link between the sun light and the environmental light.  Once we select the proper light, click apply, to get back to the the Vray Texture editor.  Make sure that you unselect the check box next to “Override Sun’s parameters” and finally click “apply”.

We have now created a link between the light from the environment (in this case the sky) and the sun’s position in the sky.  The next option in the environment tab is the Background.  We can follow the same process that we just went through to add a background that matches the sun’s position in the sky, or we can add a background image if we have a jpeg that we want to use as a background.  This can be helpful if we have a site photo, a stock image of a nice sky with some clouds, etc.  Since I am creating an imaginary scene, I’m going to apply the link to the sun’s position as previously mentioned following the same processes.  At the end of this process your Environment tab should look similar to that below.

Completed Environment Tab with mapped GI and Background

The next tab we’ll talk about it the Indirect Illumination tab.  First, ensure that the box under GI is turned on.  The allows the light waves to bounce off of geometry and give reflected light, ensuring that light bounces off the floor and continues to bounce and light the scene.  If this isn’t turned on, the only thing we will see in our scene is the direct light from our light sources which will cause a very harsh and yucky (yes, that’s a technical term) lighting results.  Next we get to select what types of rendering engines we will use.  These deal with the way that the program calculates how the light reacts in our scene.  Some teams way smarter than I am created various algorithms for how light reacts and that’s essentially what we will be selecting.  I won’t go into the boring details of each one right now, but I will tell you that I use the Irradiance Map (IR Map) as the primary engine and the Light Cache (LC) as the secondary engine.  I have found that these two in combination give me the best quality and the lowest render time.

Indirect Illumination tab

For test renders I use the following value under my IR Map tab, in the next tutorial I will further explain what these mean and how to control quality output:

IR Map settings

And the following are the typical LC settings I use for test renders, please note depending on the scene the subdivs can be between 100 (quicker, less accurate) and 500 for tests:

LC settings - note: subdivs can vary between 100 and 500 for tests

We can now run a quick test render to ensure that our exterior lighting is working correctly and with a short render time we get decent results.  It’s a bit grainy, but we will take care of that later.  At this point, we’re strictly focusing on the lighting.  Notice the blueish tint that we are getting on the floor close to the windows as a result of linking the environmental lighting to the sun’s position.  This is what we might expect in nature.

Test Quality Rendering - Exterior Lights Only (16.6 second render time)

We can now continue adding lights to our scene.  In the wall sconces, I prefer to add double sided rectangular lights because 1) they are faster at render time and 2) that’s the way the light actually comes out of a sconce like this, primarily from the top and bottom (yes, I know the shade will glow, but we’ll take care of that in the next lesson when we talk about materials).  Finally because there is a door opening and I want to add a bit of life to the scene, I add a rectangular light at the ceiling level of the adjacent room, giving a slight amount of light added to the room that our scene is focused on.  When all is said and done, we have the images below:

Test Quality Rendering - all lights (27 second render time)

Medium Quality Rendering - all Lights (1 min 29.3 seconds)

Come back soon to learn how to add materials to create this rendering:

Final Rendering with Materials


Actions

Information

17 responses

6 07 2011
Michael Lama

Hi Matt,
Thanks for posting your lighting tutorial to the VRay forum. I was wondering if I might bother you with a quick question. I am having trouble modifying my sunlight source. Under the environment tab I set the GI to “Sky”. I have placed several lights in my rhino environment . However, if I click on the button next to “Sky-Light source” I get a menu to select a light source but “Default” is the only option. What should I do to enable created light sources ex. Light 01 to serve as my sunlight source? I would appreciate any suggestions you might have. Thanks for your time!

-Michael Lama

7 07 2011
lilmac024

Michael,

Thanks for stopping by and checking out my little piece of the web. Sorry that I haven’t had a chance to update things lately…I hope that within the next month I’ll be able to make up for it and upload a whole bunch of new tutorials, rants, tips, tricks, etc.

First thing’s first, you need to understand that there is a fundamental difference between a light and a sunlight. While they both look the same in the viewports, there IS a major difference. A sunlight system, represented by a golden little asterisk in the Vray for Rhino toolbar. The sunlight system not only creates a directional light (that acts as the sun light source) but it also let’s Vray know that this light is acting as a sun and will therefore have the potential for linking to the sky attributes that you’re looking for. My initial guess would be that you created a stand alone directional light (or other light source) through the Rhino toolbar or the “Render menu drop down” and wanted it to act as a sunlight. If you have worked with 3D studio max, it’s a similar concept.

While I think that I mentioned in the tutorial, the sun is a good conceptual representation of a directional light, I may not have been clear that as far as the program is concerned there is a fundamental difference, especially when it comes into linking the background and environment to the light source. Actually I think that’s the only difference, although I may be wrong. Since you have already created a few directional lights in the scene that I’m assuming you want to use, you can look up a script by Fernando Pedrogo (I believe, it’s been a long time since I’ve downloaded it) that converts directional lights into sunlight systems. Either way, I would HIGHLY suggest checking out the forums at chaosgroup.com. It seems that since the integration since Chaos Group has bought ASGVIS, the forums, tutorials, etc have all now been transferred, so there is a tremendous amount of knowledge being shared on a daily basis!

Sorry, to recap and give you a short answer, ensure you’re using sunlight system, not plain old directional lights. This should solve the problem. If not, please let me know and we’ll delve deeper into the issue!

Thanks again for stopping by,

~Matt

7 07 2011
Michael Lama

Hi Matt,
Thanks for the quick reply and thorough answer. I had not realized that I needed to place the sun system light after specifying the particular position setting. All is clear now and I have been happily experimenting with exterior renders. Thanks for the tip, I was stuck on that small step for some time!
-Mike

28 07 2011
Johnny

Thanks lot for this tutorial Matt !
I’ve just a problem with my rectangular lights wich are not visible, though i uncheck “invisible” in Light…

Then i’ve try to render my scene with materials (i’ve uncheck “Overide Materials” in Global Switches) but it take soooooooooo long time Buildin Light Cache so I give up this rendering.
Maybe you’ll give some tips for that in you next tutorial ! 🙂

I’m a newbie on Vray and it’s hard to find some tutorials for Vray/Rhino

Thanks.

-Johnny

28 07 2011
lilmac024

Johnny,

Thanks for coming to visit my blog. As I have previously said, I must apologize for not updating the other tutorials yet, but rest assured this week I have made some headway on the tutorial about materials (which will likely be a 2 or 3 part tutorial). As far as the issue regarding the light, sometimes I have noticed that you need to restart a rendering once or twice for a light to show up (or turn invisible). I’m not sure why this is the case, but I’d give that a shot. If that still doesn’t work, make sure that your light isn’t being blocked by any other objects.

The reason that your renderings take so long when unchecking the material overrride have to do with the materials that you have already assigned to objects. I will discuss materials and how they deal with lighting, reflectivity, and transparency in this week’s tutorial. More than likely, the reason the calculations are taking so long is that the computer is trying to figure out the correct brightness of an object (you’ll often find this to be the case with VERY light colors, something over 200,200,200 in the RGB values), with a high level of reflection, or refraction. The other reason could be that your LC settings are too high. Remember that for a test render, the sample setting doesn’t need to be over 300 (I generally use 100) .

If you’re still having issues, let me know and I can take a look at the individual file.

Thanks again!

~Matt

19 09 2011
hamed

very useful thank you very mach
waiting for more 😉

28 01 2012
Vray Materials Part 5 – Emissive « macdesignstudio

[…] go both up and down, I simple click on the check box that makes this light double sided.  See the Lighting Tutorial for more info)  Because I wanted the lamp shade to be something semi-transparent (a linen in this […]

30 01 2012
Bruno

Thanks a lot for this helpful blog!
Did you try the new VfR? I am trying to follow your tutorial but It seems…pritty weird the “Sun light source” option inside GI.
First option: its a long code…none sense to me.
Second option: Rhino Document Sun.

Do you know which do I have to choose?

Another question, if it’s possible.
How do I determinate which parameter rides the scene.
Camera setting or sun parameters? If the scene is burn out: Sun intensity or exposure from the camera????

(stupid question I know)

About ChaosGroup. Its not possible to post something If you dont have permission…so..not a good option for everyone…
Do you know how to get this permission?

30 01 2012
lilmac024

I have been working with the new Beta version for VfR v2.0. I really like it’s new changes for the most part. It begins to align VfR with Chaos Group’s previous work on vf3DS. They still have a ways to go to catch it up, but I’d imagine that the way things are going, that will be their workflow. Roll out new features in Max, then work on it to adapt it to Sketchup and Rhino.

I have noticed that the sun is a bit weird and while I haven’t really worked with it, I believe that the long code is actually the sun. The code actually relates to the Object ID of the direct light used as a sun light. Double check this by selecting the light and looking at the object properties.

I’m not sure that I understand your other question. The sun setting and physical camera work in conjunction with each other. My next tutorial will actually dive into this relationship a bit more, exploring the camera’s sensitivity and the light.

Unfortunately, as I’ve mentioned, when Chaos Group took over the development of VfR, they followed a stricter forum policy. If you have signed up as a beta tester from Chaos Group, I would email them to see if you could be given permission to post to the forums as a way to work best within the new beta because there is no documentation of the beta…what’s the worst they can say? No??

30 01 2012
Bruno

I forgot: THANKS A LOT! YOUR BLOG IS REAAAAALLLY GOOD.
yOUR WORK INSIDE PORTFOLIO ALSO

31 01 2012
Bruno

Thanks Mac! Yes you were right about the light.
About camera: In real world you can burn out an image if you tweak wrong the Aperture or shutter Speed.
I found a bit weird to think an SLR camera inside 3D. Beacuse in 3d you dont have time of shutter and also its always like a trypod camera.
Sorry my english isnt good. I think I will wait for your tutorial
Thanks a lot!

4 02 2012
lilmac024

While you are working in a 2D world, ending up with a 2D rendering inside the computer program, you still use and work with the same effects as you would with a Digital SLR. The ISO and Shutter Speed primarily are used in combination to allow more or less light into the camera and will therefore affect the overall brightness or darkness of the lights that are in your scene. I’m going to hopefully try to get to this tomorrow before the Super Bowl!

11 02 2012
Bruno

Thanks MAC!

I’ll be waiting…!
Any tutorial of the new Vray for Rhino???

Thanks!

11 02 2012
lilmac024

I know, I know….I’m running behind on these things. 🙂 Please accept my apologies, it’s been a very busy few weeks. I’m in the middle of testing and exploring the beta and will post some of my findings. Because there is no manual or existing knowledge base, I’m just exploring and making it up as I go to try to figure out some of these new features. In the interim, check out the youtube videos that Matus at flying architecture has pulled together. http://bit.ly/y3Lrsq and http://bit.ly/AceVJt I hope to get this stuff pulled together and posted by the end of the weekend.

24 07 2013
vivi

I just wanted to thank you very much for this tutorial you uploaded. it is very useful!

24 08 2013
3D Workflow Tips | Annotary

[…] macdesignstudio.wordpress.com […]

18 12 2013
VRay Lighting Setting | berita dan informasi arsitektur

[…] ) Introduction-to-vray-lighting if (typeof(addthis_share) == "undefined"){ addthis_share = {"url_transforms":{"shorten":{"twitter":"bitly"}},"shorteners":{"bitly":""}};} […]

Leave a comment