Total Pageviews

Sunday, October 23, 2011

HDRI exterior lighting with Vray


An outline of the techniques used for rendering an exterior scene using Autodesk 3ds Max and Chaos Group Vray. A HDR image will be used to light and reflect the environment and VraySun as the direct light source for a typical sunny day scene.
HDRI stands for high-dynamic-range imaging, which is a 32bit float image format that allows a greater dynamic range of luminance between the lightest and darkest areas of an image.
A HDR image holds enough information to light a scene, where as images such as JPEGs do not hold enough information to light a scene successfully. HDR images can produce good results, but the intensity is still not enough to give realistic hard shadows that would come from the sun. By adding in VraySun as a direct light source, the two methods combined will allow for easy control over time of day and various types of weather conditions.
Before I start, I would like to point out that I will be using a linear workflow with a gamma 2.2 setup within 3ds Max and Vray. I strongly recommend setting this up as it will improve many areas within your workflow. You can find an easy to follow, step by step guide here. This tutorial will not go through the Vray render settings, but you can find a detailed explanation of how to set up the Vray renderer here.

Finding the right HDR image

The choice for time of day and weather conditions will determine what HDR image is required. Within this tutorial it will be a sunny midday scene with minimal cloud. There are various shapes and sizes of HDR images out there on the web. You will need to make sure that the HDR image is a 360 degree spherical image and the higher the resolution the better. When a spherical HDR image has been applied as an environment, Autodesk 3ds Max wraps the HDR image around a sphere. None spherical HDR images will not wrap around the sphere correctly and produce incorrect results. Resolution matters only if you are planning to use the HDR image as a back plate. If the HDR image is only to be used to light a scene, you can get away with a much smaller resolution.
You would want a HDR image that has maximum sky and a hint of a horizon. Typically a HDR image is pure black under the horizon and therefore will not cast any light. In theory it will also be covered up by geometry.
You can also find HDR images that are pure sky with no horizon. This type of HDR image allows for maximum light, there is no pure black present.

Aligning the HDR image in the viewport

A 360 degree spherical image has a narrow aspect ratio. By default the 3ds Max viewport is 4:3 (1.33) which is a standard resolution of 640 x 480 pixels. As a result of this, you will not be able to see the full height of the HDR image no matter what aspect ratio you choose and this is due to the nature of a computer screen. The majority of exterior visualisations are viewed from a person’s eye line. If the sun is high up in the sky, it will not be visible within the viewport.
Start by setting your 3ds Max standard environment to a VrayHDRI.
Next drag and drop the material from the environment rollout to an empty slot in your material editor. Choose instance and then load in your HDR image. Here you can select spherical for the mapping type.
Go to views, viewport background and tick use environment background and display background. Under apply source and display to change the view type to all views.
HDR images are typically over exposed and may appear blown out in your viewport. To fix this, lower the overall multiplier so that you can clearly make out brightest spot within the HDR image, in this case it is the sun with no clouds. The render multiplier is there if you only wish to affect the map upon render time and not in the viewport.
Next add a Vray physical camera to your scene and point the target up in the sky. Move around the viewport and locate the brightest spot within the HDR image. Ideally the brightest spot needs to be in the centre of your viewport. You can leave the Vray physical camera settings at their default. Do not rotate your HDR image using the horizontal rotation in the material editor; this will need to remain at 0.0.
Once you have aligned the Vray Physical Camera to the bright spot within the HDR image, change the HDR image overall multiplier back to 1. Render your scene using the Vray physical camera with everything hidden so you only render the viewport environment. Once complete, within the Vray frame buffer click duplicate to Max frame buffer and leave it open. This is used as a reference so you can check that the VraySun lines up correctly.

Adding the VraySun

Add a Vray sun to the scene and choose yes to adding a VraySky map to the environment when prompted. This will replace the current HDR image in the viewport. Again, the VraySky map may be over exposed but there is no need to view the VraySky within the viewport, so turn off the viewport background.
Using the align tool, align the VraySun target to the Vray physical camera and then align the Vray physical camera target to the VraySun. The height of the VraySun will vary depending on where the bright spot is within the HDR image. The higher the VraySun the brighter the VraySky, this simulates the time of day. As an example the height of the VraySun for this scene after matching it to the HDR image is roughly 50 times the height of the building.
Render only the environment background using the Vray physical camera. If your sky is over exposed then adjust the f-number of the Vray physical camera to something like 12. Compare the rendered VraySky to the previously rendered HDR image. Both suns should be roughly in the same place within the image.
You may need to adjust the size of the sun within the VraySun parameters. Adjust the size multiplier but keep in mind that the larger the sun, the softer the shadows. A range of 2 – 10 is adequate. All other settings can remain at their defaults.
Depending on the scene, there are multiple options available for the type of sky used with the VraySun.
Preetham et al
This is typical blue sky that has a visible atmospheric haze.
CIE Clear
Again a typical blue sky, but it has less atmospheric haze which tends to give a deeper more saturated blue
CIE Overcast
A very diffuse and desaturated sky that you would typically get in overcast weather conditions. You would normally use very soft shadows, which are controlled by the sun size.

Adding environment light

Place a VrayLight in to the scene and change the type to dome, set the intensity multiplier to 1 and under texture, drag and drop the HDR image from the material editor and chose instance. Make sure the Vray light dome is perpendicular to the ground plane.
If you want the HDR image to be visible when rendered, keep invisible un-ticked and if you plan to add your own sky in, post production then tick invisible. The VraySky will then be the background for the render; this can be removed via an alpha mask whereas the HDR image cannot.
The resolution and the adaptiveness of the texture affect the way shadow rays are generated towards bright area of the HDR image. Increasing the resolution requires more RAM and slows down the render times slightly, but it will make the adaptation follow more closely with the intensity of the HDR image. Within the majority of scenes this goes unnoticed, so the default resolution and adaptive amount is adequate.

Setting up the multipliers

In the material editor, make sure the HDR image overall multiplier is set to 1. Also set the VraySun multiplier to 1. You can control the level of intensity via the Vray physical camera settings. Keeping all multipliers at 1 and the default settings for the Vray Physical Camera is a good starting point. Then adjust the exposure to suit your scene. You can turn off the Vray dome light and complete a test render to see the effects of the VraySun and vice versa. By doing this you can see how one is affecting the other and then find a healthy balance between the two.

Making final adjustments

Remove the VraySky from the 3ds Max standard environment as this is no longer required because the scene will be lit via the Vray dome light. It was only used to make sure that the VraySun was aligned to the HDR image correctly and was the right size.
Next within the Vray physical camera settings, change the white balance to daylight as this will add a colour filter to the render. This is not a requirement, you can choose to have a neutral colour balance of white if you prefer.
You may need to increase the sampling subdivisions of the Vray dome light. If your shadows are very noisy, increase the subdivisions by multiples of 8 until you are satisfied with the results.
The resulting render has a visible reflection within the windows. The Vray dome light does two things, illuminates the scene and adds a reflective environment. There is no need to add a reflection map in the Vray GI environment (skylight) override.

Rotating the VraySun and HDR image

At the moment the sun is to the right of the building. Obviously if you were to move the VraySun to front or the left side you would want the HDR image to rotate also, so that the two suns stay together. This can be achieved by wiring the horizontal rotation of the HDR image to the Z rotation of the Vray dome light.
When rotating HDR images, they are rotated by degrees. Because the 3ds Max rotation is also in degrees, wiring HDR image and the Vray dome light together is very straight forward. There would only be any complication when trying to wire an image that uses U and V as rotation, which is essentially X and Y coordinates. If for example you use EXR images instead of HDR images, you would need some method of converting the different forms of rotation.
Hide everything within your scene except the VraySun and the Vray dome light. In the top view, position the Vray dome light half way between the VraySun and its target, it doesn’t have to be exactly to centre.
Using the select and link tool, select both the VraySun and its s target and link them to the Vray dome light. Test that the link was successful by rotating the Vray dome light on its Z axis, the VraySun and its target should rotate around the Vray dome light. If you have rotated the Vray dome light, undo this step as it needs to be in its original position.
Still in the top view, select and right click the Vray dome light and choose wire parameterstransformrotation, and then Z rotation.
A wire will appear prompting for you to select an object so select the Vray dome light itself. Then choose object (VrayLight), texture, and then horizontal rotation.
In the new pop up window, choose one-way connection: left parameter controls right parameter. In the expression window put a – (Minus) in front of Z_Rotation. This is to make both the Vray dome light and HDR image rotate in the same direction. Otherwise the Vray dome light will rotate in a clockwise direction and the HDR image will rotate in an anticlockwise direction. Press connect and close the window.
This allows you to control the rotation of the HDR image shown within the material editor by rotating the Vray dome light on the Z axis within the viewport. Now the position of the brightest spot within the HDR image will follow the VraySun. You will notice that you can no longer rotate the HDR image by horizontal rotation within the material editor, this is now greyed out. You can see the results by rotating the Vray dome light and watching the HDR image within the material editor rotate in real time.


MintViz is the owner and author of this content. Please click the following link to be redirected. http://www.mintviz.com/tutorials/hdri-exterior-lighting-with-vray/#ixzz1bXygcUuO
Under Creative Commons License: Attribution Non-Commercial

Rendering an exterior at night in 5 simple steps, using vray


In this tutorial I will go through all the steps that we usually do when I’m asked to do an “exterior night-rendering”.
In order to follow it you need to know the basics of 3ds max and vray.
1) Natural light
The first step is to choose a background image of a sky.
For this tutorial I have used the image bellow:
background
Now put the desired image into the environment slot (3d max’s environment slot, not in vray’s).
In the vray settings, check global illumination, select lightcache for secondary bounces, irradiance mapfor primary (you could also use brute force, but it will take longer to render).
In the global switches tab, make sure that “default lights” is unchecked.
Last but not least go to the vray environment slot and check “GI environment (skylight) override. In the slot right beside put a gradient (dark blue in the upper slot, a lighter blue in the middle and a pale orange or purple in the lower position)
Exterior Rendering Settings
If you hit render, you will end up with something like this:
Exterior Rendering Phase1
2) Adding artificial lights inside
As you notice, it is starting too look like a night rendering, but at the moment it lacks artificial lighting so the spaces look deserted.
We will begin by adding vray lights inside the house, to simulate artificial lighting.
The important thing to keep in mind at this point is that artificial light can look different from one case to another depending on many factors (intensity, color temperature, size of the space that is actually lit, etc.) so you shouldn’t put a light source and instance it all over the place. Be creative and play with parameters like intensity multipliers, filter colors, etc.
For this scene I have used spherical vray lights with intensity multipliers varying from 1 to 2, filter colors with orange, yellow and blue tints and different a radius for each one.
vray interior lights
If you hit another render you will end up with something very similar to the following.
Exterior Rendering Phase 2
3) Simulating artificial light “spreading” from inside 
Now we have light inside the house, but the light doesn’t seem to “come out” enough. Therefore we will place vray planar lights just in front of the windows, pointing towards the exterior, like in the following image.
vray window lights
Hit another test rendering and you should have something similar to the render bellow:
Exterior Rendering Phase 3
4) Adding artificial lights in the courtyard
We are getting closer. What doesn’t look right at the moment is the fact that the courtyard is too dark. Depending on your scene, you may have exterior lighting fixtures (like the lighting posts that I have in this scene), or even exterior spotlights that illuminate the building.  If you don’t have specific instructions for these, you could place lights somewhere behind the camera, so that you give the impression that the space is receiving illumination from neighboring sources (street lights, car lights, or even other buildings).
In this particular scene, adding lights to the lighting small garden lighting posts should be enough.
First I have assigned them a vraylight material with a gradient map; than I have placed vray spherical lights over each one. For each vray light in the courtyard I have excluded the lighting post bellow it. This is kind of a fake, but in the end it looks right, and that’s all that matters. (If you want to do it more “accurate” check out the lampshade tutorial as well).
vray courtyard lights
Hitting a test render at this stage you should obtain something like this:
Exterior Rendering Phase 4
5) Photoshop touches
a) Add a subtle glow effect to the visible artificial light sources (in this case, the small lighting posts). You can do this using the diffuse glow filter.
b) In a new layer, add a linear gradient from bottom to somewhere at the middle from orange to transparent. Put the layer on “color” and play with the transparency until you like the result. If you are feeling creative, you can also try some subtle brush strokes, with different tints of red, yellow or orange to create diversity.
After having done all of the above, here is the final image.
(CLICK THE IMAGE TO VIEW A HIGH RESOLUTION RENDERING)
Exterior Rendering Phase 5
Conclusion
Rendering an exterior at night can be very tricky. The best approach in my opinion is to take it systematically by starting with natural light, and adding artificial lights one by one during the process. Otherwise, you may find yourself lost not knowing where you did something wrong.
I can not stress enough how important is to have a few examples of professional architectural photography at hand and look at them at every stage of the process.
Here are some general guidelines that I always keep in mind when I’m doing a night rendering:
1) Even at night time the skylight still casts a subtle shadow.
2) Never make the sky 100% black; it should have either a blue or a purple tint.
3) If there are no artificial lights on the ground, the sky will always be brighter and the ground would “borrow” a bluish or purple tint from the sky
4) The lighting is a mixture of dark purple/bluish tints at the upper part and orange/yellow on the ground and on the building(s). That is because the natural light blends with artificial light sources placed on the ground.
5) The colors are more saturated in a night rendering that in a daytime one.
6) Artificial light sources have a subtle glow around them.
7) If you have “moving objects” in your scene, don’t be afraid to use motion blur. If you know a bit about photography, you are aware that at night time photographers use high exposure times when they target architectural subjects; this causes all moving things around (cars, people, etc) to appear with motion blur.
If you think that I have missed something, feel free to post a comment and let me know.

Tips For Improve Your Renders


Many people write me emails asking how they can improve their renders, visually and by reducing the render time, it has to do with good optimization of geometry, materials and textures, then I will give some basic tips to help optimize your renders.
1 .- 3D Geometry: We must try every model has the minimum number of polygons, because if the 3d model has a lot of unnecessary poligons the render time will increase.
We need to avoid errors in our gemetry, like opened edges, overlapping polygons, try to keep your models as clean as possible with regard to modeling.
2 .- We need to try to get the texture size is suitable for the size of final render, for example:
If you download a 3k wood texture, but only use a small-scale model in your scene will be overloading the renderer with a texture that is not necessary to be so much resolution.
look this example in this render fro this scene:
We need to have in mind that we need to use Bump and specular maps for add more realism to our materials because in reality every object has relief and reflectivity. If you want take a look to this tutorialabout creating your custom bump and specular maps with Adobe Photoshop
4 .- Light: This is very important, I personally always try to use real physical system lighting like Daylight System and Vray Sun and SkyHDRI, and always i use photometric lights with IES profiles, this helps the realism of scene because they work with real lights algorithms, and similarly calculated the light in your scene.
Remember to always work on Gamma 2.2 or LWF in your scenes, it helps that the colors are displayed correctly in 3ds Max, you can see an example by clicking here.
Scale: The scale is vital to get good renders, usually my Max unit setup  is in cm, so I have more precision in my models, this also helps in the calculation of light and specular.
Render Setup: Some important tips, if you work with Vray, for the antialiasing I recommend using as Adaptive DMC but for best results in scenes with many details and containing many blurry reflections, Fixed is better, because it works better with this type of image, the number of subdivisions is recommended not less than 4, but for best results 6 would be fine.
For indirect illumination use Irradiance Map and Light Cache because it is the fastest time to value, but if you want more detail you can enable Detail Enhancement in the Irradiance Map setup and enable Pre-filter in Light Cache, this will help reduce the noise in your renders.
If you want you can download for FREE this render preset it is optimize for decent renderings, not high quality but nice quality with a decent render time, click here to download
When using vray lights for subdivisions use 15 – 25, this will help to have decent render time, also have pending always use Vray physical camera, this will help them control how light behaves in your scene and have more control over it.
And for having more control of the white balance in your scene try to work with Kelvin temperature, here is a color temperature table for better reference
kelvin temperature table
I hope this little article helped, more articles will soon go up every day to help you improve your renders.
Regards
Sujji