[Tutorial] Getting Started With Iray
|11 min read
SickleYield's avatar
By SickleYield   |   Watch
356 216 64K (1 Today)
Published: March 12, 2015

Introduction


Here is the tutorial on YouTube.

Here is a .pdf version.


This is for those of you who are looking at the interface going, "Now what?"  This covers how to convert existing shaders and how to set up lighting for your render. 

This is a text version that, while different from what I'm saying in the video word by word, contains the same information. 

---

To use this you need DAZ Studio 4.8 Pro or later.

Part 1: The Environment and Camera Settings


Before we get started, we need to check the environment, camera and render settings.

The Render Settings tab has an Editor and an Advanced section.  Advanced is where you check or uncheck your CPU and graphics cards.  I render with just my cards most of the time, and if you have good cards with lots of CUDA cores (I'm rendering with two Nvidia GTX 980's), the CPU will only speed things up a little.  Iray cannot render with non-Nvidia graphics cards (probably because Iray was created by Nvidia).  I'm working with the Photoreal option.

The Editor tab has several other settings.  By default Iray will be set to go to 5000 samples in the Progressive settings, and that's a good starter setup, though it will not be enough to finish a large scene without graininess.  Iray is an unbiased engine, which in practical terms means a "bad" render is grainy, where in a biased renderer like 3Delight a "bad" render is blurry.

The Editor tab also contains the Environment settings.  This is where you can set up your environment map if you have an .hdr or .tiff you would like to use for global lighting.  If so, put it into the Environment Map channel.  Make sure the top dropdown is set to "Dome and Scene" and "finite sphere" or "finite cube" if using an environment map.  Set Visualize Finite Dome to "off."  The purpose of this is so that you can see what size of dome Iray is using to light; it will create an unwanted green dome in your scene if left on.  There is a different "Draw Dome" button for showing the HDR as a backdrop.

If you do not have an environment map, but would still like your scene to have a "sun" and a lighting environment, scroll down to the date and time settings.  Here you can set the lighting to mimic a certain time of year at a certain latitude and longitude by entering those values.  Alternately, you can choose an "SS Sun Node" and set it to be an object in your scene (including a Null, if you wish) and set the sun settings around that.  I've gotten good results using a camera as a sun node.

And finally, we need to turn off the headlamp so we can use real lighting.  You can find this in your camera settings.  You can't control the settings of the Front, Back, Perspective, etc. cameras, meaning their headlamps can't be turned off, so you need to have a Default Camera or create a camera in your scene.  You can set up the scene to always generate a Default Camera in Edit--Preferences and the Scene tab of that dialog.

When you have a camera, select it in the Scene tab and go to the Parameters tab to look at its settings.  There is now a new option called Headlamp.  Set it from Auto to Off.  If your scene has an unwanted direct bright light no matter what you do, it may be from the headlamp.  If your scene is too dark now, Ctrl+L turns off the lighting sim in preview and should allow you to see clearly.

Part 2: Loading Items And Converting Shaders


You set up and compose a scene in DAZ Studio for Iray exactly as you would for 3Delight as far as the poses and cameras are concerned.  Before we get to rendering, though, we need to convert all of the shaders to Iray shaders in order to take advantage of their great options.  You can render in Iray without Iray shaders, but it will always look better if you convert them, especially with anything close up.

When you've set up your scene's objects, right-click in the 3d window and choose "Select All."  There may be some lag as you go to the Surfaces tab.  Right-click in Surfaces and choose Expand All.  Click on the very first item in the tab.  Then hold down shift, scroll to the bottom, and shift-click on the bottom entry.  Now everything is selected.

Leaving that selected, go to your Product Library and Shader Presets/Iray Uber Defaults.  There is a preset here called !Iray Uber Base.  Double-click on it.  This isn't really a shader itself, it just converts all selected shaders to Iray.

If you have G2F and/or G2M in your scene, DAZ has also provided material presets for them.  These are located in People/Genesis 2 (male or female)/Materials/Iray.  If you have a skin set up to use, ctrl+click on the Iray Optimized Preset and choose "ignore" in the dialog that pops up to apply these shaders without changing your textures.

If you're using a texture not made specifically with Iray in mind, which most of us will be, you may need to add the SSS map to the translucency weight and color channels in Default Templates 1, 2 and 3.  If there is no SSS map, use the spec map.  If there is no spec map, turn the translucency value down much lower, say to 0.1 or so.  If using dark skin, you may want to change the translucency and SSS values to something less orange and more blue.  Blue, Green, etc. skins will need more tweaking to get something "natural" for them, and scales should have translucency and SSS turned off for the most part.

This is a subject that needs a lot more documentation, which I will do as time passes and I get more familiar with Iray and its shaders.  Meanwhile, I've also done this post on Iray shaders and what they do.

Part 3: Lighting Your Scene With Photometric And Mesh Lights


Iray is a physically based renderer.  This means that it calculates the behavior of light in a way as close to reality as possible.  Unlike 3Delight, lights can have the temperature and luminosity values that they would have in the real world; lights diminish in strength with distance, and they scatter and fill the scene with light.  Because of this behavior, Iray renders faster with more lights in the scene, not less.  Never hesitate to add more lights.

There are three ways that Iray lights a scene:

1. The Environment.  We covered this in Part 1.  Using the environment alone can produce decent lights for many types of scenes, especially when what you want is "outside in a field" or "on a city street somewhere" and not "inside this specific space ship with its emergency lights on."  Or you can use the environment to add a sky dome or backdrop and turn its light to a low value, then add other lights in the scene to represent other light sources such as street lights, flashlights, etc.

2. Mesh lights.  A mesh light is any object in your scene that has the Iray shader and has its emission set to a color other than black in the Emission channel in the Surfaces tab.  The Emission color only really affects light color if the temperature (in K, or Kelvin) is around 5000-6000.  Temperatures below 4500 will be more orange or red; temperatures above 6500 will trend increasingly toward blue.  There is good documentation of color temperatures for light online

Setting light to "two sided" is useful for literal skydomes, lighting with a primitive plane, or other things where you want it to ignore the direction of normals when lighting.

Luminance controls how powerful the light is.  It defaults to a value of 1500 and luminance units of cd/m squared, which is not really bright enough to light anything.  One of the units available is lumens, a unit of luminous flux that there are some charted values for here.  The important thing to remember is, if it's not bright enough, add a zero - you will often need in the hundred thousands at the default tone mapping settings.  You may need millions of lumens if you're using a literal skydome, because you are simulating something very bright but very far away.

In general, always use an environment map rather than a mesh skydome.  Adding a literal skydome adds large textures, which will slow Iray down, so the environment map is much faster even if you just take the map straight from the skydome and add it to the environment map channel.  This can be a very good method with sets like BWC Skies and the FM_EasyEnvironments sets (you will have to pick one of the directional textures FlipMode includes with the set, but if you set it to Finite Box w/Ground it still works well for lighting).

Mesh lights are particularly good for converting objects in the scene into emissive lights when they are literal light bulbs, light panels on machines, or magical objects that you want to glow.  Setting an object's lumens high enough to really cast light on the scene will wipe out any detail visible on the object, so for that I recommend settings its luminosity very low (under 1000 lumens) and using a point light at its location.  Stonemason sets always have separate materials for light bulb type surfaces, so they're great for practicing with this.

3.  Photometric lights.  You can add spot and point lights using the "Create" option at the top of your DAZ Studio interface.  These now have both 3Delight and photometric characteristics, so just load a regular spot or point.  These are great for englobing a character, adding a rim light to pick them out from the background, or highlighting objects that you want to glow but don't want to be emitters.  As with mesh lights, they are controlled with the luminance values, not with the intensity slider.  The same numbers apply.

My experience is that you generally want to use your environment map for fill, mesh lights for realism on specific objects that should be lights, and photometrics as "key" and "rim" lights.

4.  Rendering


You've checked your camera and environment settings, you've got objects in your scene with their shaders converted, and you've put in your lights!  Now it's time to hit Ctrl+R and see what happens.

Iray will spend the most render time at 0% and the values between 90 and 100%.  I'm not sure exactly why this is, but it probably has something to do with the amount of small details and refinement added to the progressive render at those higher numbers.  Regardless, don't worry, a long time at 0% doesn't mean the render will necessarily take as long as you might think.

If your render gets to 100% but doesn't look "finished" to you, it may be time to add more iterations and a tighter convergence.  In the Progressive settings on the Render/Editor tab, you can set the Max Samples much higher, and the Max Time as well (be sure to change both or it will quit when it gets to the lowest of the two).  Setting the Rendering Converged Ratio to 98% also produces a less grainy render that takes longer. You can set your machine to basically keep rendering forever, then watch the progressive render and cancel it when it looks as good as you want, or good enough that you would rather just run a blur filter over it in PhotoShop or the GIMP. 

5. A Note On The ISO and Aperture Settings


Because Iray is physically based, lighting for it is not unlike lighting for photography.  Accordingly, the render settings Editor/Tone Mapping tab lets you set a number of photographic settings. 

The most relevant currently are Exposure Value, Shutter Speed, and Film ISO, also known as the Three Pillars of PhotographyI've done a different tutorial that covers that topic in more detail.

It's usually a good idea to render to a new window and not direct to file when working with Iray, so that hitting cancel still leaves you with a render you can save.
Comments216
anonymous's avatar
Join the community to add your comment. Already a deviant? Log In
UndercityIV's avatar
UndercityIVProfessional General Artist
Way too much shit to be reading..as a person with learning disabilities, this complex stuff does nothing but pisses me off...DAZ need to make their shit user friendly like what Poser did. I don't recall poser ever having this much crap in it just to get somewhat decent renders. ANd I've gotten amazing results with Poser without the need of having to go through a long boring tutorial. Granted I can't get IRAY quality renders, but still...This is more trouble than it's worth. I barely understood half of what you were trying to explain.
Kxmode's avatar
DAZ is also free versus Poser being $350
Limc68's avatar
Thank you very much. This has already helped me out in the first few lines. :)
SickleYield's avatar
SickleYieldProfessional Digital Artist
Very welcome, glad it helped. :)
LippiA's avatar
LippiAHobbyist Digital Artist
Yesterday, I hated Iray - Today, I love it!!
Thanks a lot! :)
kamijavi's avatar
Wow nice thanks i know why i can't get point and spots to work on iray
TracyWong's avatar
TracyWongProfessional Digital Artist
I love your tutorials. You're a very generous soul for spending so much time and energy toward teaching the community. Thank you so much or your work in helping the 3d art community! :hug:
SickleYield's avatar
SickleYieldProfessional Digital Artist
Aw, thank you, I really appreciate that! :hugs:
Sharrukin-of-Akkad's avatar
Sharrukin-of-AkkadHobbyist General Artist
Excellent! I've been struggling with one of my first Iray renders for a few days now, and a few bits of this tutorial gave me just what I needed to improve it drastically. Many thanks!
SickleYield's avatar
SickleYieldProfessional Digital Artist
I'm glad it helped! :)
Lyrnetu's avatar
LyrnetuHobbyist Digital Artist
Fantastic. Every time I read this I learn a little bit more and things seem a little less overwhelming  ^.^
Gordon228's avatar
Gordon228Hobbyist Digital Artist
How do you make a lampshade work with the iray emissive light? i can't figure it out i can get something but not what i know to be true for lampshades that are of the cloth and plastic kind like the new shades of today.

Also the best examples to use are the lights from Light the Way for the lamp shades.


Edit: I think i got it via converting the base shade in to the default iray shader/map the playing around with the translucency weight and color wile having base color effect set to scatter & transmit. if you have a better way then i am all ears.
SickleYield's avatar
SickleYieldProfessional Digital Artist
That sounds about right.  You might also turn Thin Walled to "off" and add some SSS for the lampshade to transmit more light through it.
Gordon228's avatar
Gordon228Hobbyist Digital Artist
i am still new to all this but i think i got a handle on it and thanks for the amazing tutorial.
fractal2cry's avatar
i finally dove in to daz 4.8 ty for tutorial!
SickleYield's avatar
SickleYieldProfessional Digital Artist
:)
ThulsaDoom-3D's avatar
ThulsaDoom-3DHobbyist
I'm having huge issues with memory management.  I've got a 6core processor w/ 16 gb of ram and I try to do all the iray rendering on my graphics cards.  I've got two Titan Z's (Not SLI'd).  If I get 4 or more hi res figures in a scene with set and lights (especially hdr's) then I might be getting to 5 or 6 gig or ram.  The problem is when I try to render, the graphics card memory fills up (6 gb) then appears to dump the whole scene back onto the CPU memory.  So it appears that the CPU memory is holding the same scene twice.  Then the memory gets to crush depth. 

Before I go drop a grand on a new motherboard with 64 gig of ram I'd like to see if you have any suggestions.

Thanks again
SickleYield's avatar
SickleYieldProfessional Digital Artist
Getting a new motherboard won't help.  It's not using that RAM for the actual rendering.  It's more that the second Titan Z isn't doing anything for you because it can only load the scene onto one graphics card.  I felt very stupid that I shelled out for a second GTX 980 when I learned this one. :p
SkolarNow's avatar
Well a Titan Z is equiped with 12 Gb ram devided into 2 sets of 6 Gb, which is the problem (my 980TI has only 6 Gb to start with). So I suggest another swap.....sell one Titan Z and buy a Titan X instead. That has 12 Gb of RAM, if a scene is under 6 Gb you should be able to render it on all three processors (2x Titan Z, wich has 2 cores anyway, and 1 x Titan X) and if a scene takes more then 6 Gb well stop the Titan Z in his (or hers) track and run a sole Titan X. If I got the money I will invest in a Titan X as well......thus having all the flexibility I need.

An other option is to render in pieces en composite the scene in PS (or Gimp)........I use Blender and compositing (in Blender) can sure save the day on a complicated project.

Greets, Skolar
3EP's avatar
3EPHobbyist Digital Artist
I did some GPU & CPU testing and I alo think multiple cards may be overkill.
Now do I get rid of the GTX 960 or one of the two 780 ti's. I honestly thought Vram would play a massive part in speeding up the rendering process but it appears it doesn't.
Ayiano's avatar
AyianoHobbyist Digital Artist
First, let me say your iRay tutorials have been VERY useful! Once I figured out all the iRay settings, I haven't had any problems getting models set up.

Until now.

For some reason, on one particular model, I cannot apply the "!Iray Uber Base," and consequently unable to convert it to iRay shaders. I have tried the method above and selecting a surface individually. Reinstalled the model files, new scenes, etc. No luck. I'm wondering if there is something special about the model itself.

Have you come across this problem?
SickleYield's avatar
SickleYieldProfessional Digital Artist
I never have.  What is it?
Ayiano's avatar
AyianoHobbyist Digital Artist
I'll send you a note with the link of the model.
zededd's avatar
zededdHobbyist Digital Artist
I bear no shame in saying that I understood far too little of this... but I'm going to be re-reading it a few times!
This is the simplest guide I've found so far to the whole process and I'll probably be confident enough to break something by over-adjusting a slider in no time haha!

I miss the ten-second render-times I had (optimised) with 3Delight, but the results from Iray are so promising!

Thanks for posting this
anonymous's avatar
Join the community to add your comment. Already a deviant? Log In