Vray Materials – Part 1 – Diffuse

I think it’s time to redo my vray material guide with updated techniques and software.
The old one is still valid and a good reference for ‘how’ the vray shaders work, but there are a few changes in my approach and understanding of the shading process.

I’ll break this guide up into multiple posts so it’s not a huge essay that takes hours to read.

Let’s start with the basics.

PBR or physically based rendering

PBR is currently a hot topic, everyone from Disney to game engines are using it. So what exactly is PBR?

Until recently, the dominant approach in CG was using any means necessary to get the final render. If it looks good, it’s good. So there’s a lot of guesswork for the settings and a lot of artistic decisions that make the final image. This method still works, but overall the industry is slowly shifting towards a different approach – PBR

For PBR the main idea is that you should use realistic data from real world to make your 3d scenes. This means realistic light intensities and realistic diffuse/specular/etc settings for your shaders.

The main advantage, I think, is that it’s harder to make your images look ‘fake’ or ‘CG’. The strict rules imposed by PBR make sure that the renderer is at least working with a realistic inputs and thus is much more likely to create a realistic output. I’m not saying the images will look better (there’s plenty of shitty real photos), but they will look more realistic.
If your goal is to make ‘realistic’ renderings, this is absolutely the way to go. If your values are set right, you can spend more time working on the design, composition, lighting and postwork – things that actually matter.

So let’s get started on the actual practical information:

Diffuse

Diffuse color is the light that is reflected from an object in random directions. Some lightwaves are absorbed and some are reflected, if different wavelengths are absorbed by different amounts, the result is a colored.
Measured data from real world suggests that almost all surfaces reflect 3~90% of the light as Diffuse color.

The main exceptions are metals, which do not scatter the light but instead bounce it right back from the surface. Their Diffuse should be set to pure black. At least for pure, clean, non-oxidized metals…

Once we convert this to RGB range it’s something like [8;8;8] for blackest coal and [230;230;230] for the whitest snow. Most surfaces fall somewhere in between. Even things like paper sheet or white paint are only something like ~70% [179;179;179] and 85% reflective [204;204;204] definitely no higher than that.

If you are using Textures instead of color values, it’s a good idea to make sure that your image falls within this range, but there’s a catch… Gamma
Photo sourced textures come with a burned in srgb gamma correction of 2.2. This means that to get the image to look the same in 3ds max, it must be loaded with the gamma setting of 2.2
The side effect of this is that the values you use in photoshop do not match with the linear values that vray outputs. If your texture is medium gray in photoshop, the actual amount of reflected diffuse light is going to be only 22% instead of 50%.

bitmap gamma

When we convert the diffuse color range to sRGB, we get values of 50~243
The formula used: sRGB=(linearpercent/100)^(1/2.2)*255.
As an example, to get 4% reflectance from an srgb texture we can use this calculation. (4/100)^(1/2.2)*255=59
You don’t actually have to do the math every time, scroll down for a chart that allows you to easily convert between the two.

All these numbers seem complicated, but the things that you should take away from this are:

  • Diffuse is darker than we think it is most of the time.
  • The blacks are not as black as we think.
  • Make sure that gamma correction doesn’t fu*k up your values

To get a rough idea on where different material diffuse brightness falls in linear and srgb color space – just use this handy little graph I made (click to enlarge)


Simply pick the color in photoshop and see the value in either of the gradients. This is not something that you have to use as a law, but just to give you a basic approximation. Nobody is going to get upset if your sand is 47% bright instead of 45%.

So how do we actually get the texture to fall within the range we need in Photoshop?
You need to use either Levels or Curves. Here’s quick guide:

Open up your texture and decide the range where it’s values should fit in.
For example – here’s a dirty concrete texture that should be about 75% reflective or [190;190;190] in srgb space.

photo

Open it up in photoshop and press Ctrl+L for levels tool.

1. Make sure the black and white points are adjusted to just touch the histogram on left and right and adjust the output values.
2. Since the main color of clean concrete should be about 190, move the whites down to 195 (some dirt streaks seem brighter than actual concrete). Now move the blacks up to about 65, since the dirt and grime is probably about as dark as dark soil, not darker.

lvls

That’s it – the image should now be a realistic, usable Diffuse map. The difference is not very strong in this case, but it’s noticeable. Overall texture is a bit darker, whereas before it was too bright.

after

If you are used to work with full 0~255 range of color in your scenes, the resulting renders might seem flat or low contrast.
While this might be the initial impression, working in a linear space gets you more than enough color range to bring in some contrast in post.
So don’t be afraid of flat images coming out of your renderer, it’s nothing that some simple postwork can’t make as crisp and contrasty as any other workflow.

Here’s a simple example with coal-black material looking quite light in the render but rich and dark after adjusting the curves.

sample_post

So that’s it for the Part 1 – Diffuse
Stay tuned for the next part where I’ll cover Reflection settings!

Using VrayLightMeter to Estimate the Exposure

day
This is a guest post by Pablo Conca Bosch from Spain

I think his technique is quite interesting, you can use the vray light meter as a real hand-held incident lightmeter. I must admit, I tried it some time ago, but upon finding out it gives lux values instead of something more usable, I quickly gave up and went back to guessing/using my eyes to determine exposure. After this tutorial, however, I can see that it is not that difficult to interpret the results and I already have a couple of ideas how to use this for fine tuning scenes.

****************************************************************

VRay Physical Camera Exposure (initial point to work) using VRay
Lightmeter

Due to other reasons…. (money mainly, lol) I don´t have manual camera and how it´s normal I
never use manual cameras, but I try to learn in depth all the theories that I can about
photography, to understand better how to use the VRay Physical Cameras (and a manual when
somebody leave me one).
And for this at first (years ago) I adjusted the VRay Physical Camera settings (F‐number, Shutter
Speed and ISO) with empirical method, one probe…another probe… and like this to find the
correct adjust… Work!.
Then I studied the exposure theory and the behavior of the manual cameras on photography,
and what are the most common settings for photography in different scene situations, and this
gave me an idea that how i could begin to look for a correct exposure on different scene
situations.
In this tutorial we have assumed that you have clear the exposure theory, if isn’t in this way
you can consult this great tutorial from Austris:

Vray Physical Camera Tutorial

But at the end I had no a correct number based on the intensity of the light sources on the
scene, units that could be real or unitless…The units used on your light sources no matter
because due to the first measurement we do in this technique you adapt your camera settings
to the light you have at the scene, but I normally use real values for my light sources.
And a Saturday I went to the bed  thinking about exposure theory and other stuff about real
cameras and too my last freelance work on mind (as always I had not satisfied), and on Sunday
morning  when I woke up I thought… yes! I could do this to try to adjust…
The idea is find an initial point of exposure to begin the work in the scene with your VRay
Physical Camera using a Helper included on VRay Renderer (Vray Light Meter) and transform
the data given by this helper (iluminance/luxes/lumen x square meter) to F‐number and
Shutter Speed values, using this formula to obtain an Exposure Value (Ev):
lux=(2^Ev) x 2.5 x100 /ISO
Ev= Log (Lux/2.5)/Log (2)
An this other formula to obtain the final values:
Ev=Log N2/t
Where N is the F‐Number and t is Shutter Speed
but… i think is better use the web… you will see on the tutorial.
In this tutorial you could see two cases, but it will be useful to find this initial point to work in
all the situations you could be immerse.

Here is the tutorial video:

The links shown in the video are:

Equivalent Exposure Value Chart

Exposure Triangle cheat sheet

Lux to Exposure Value (EV) and EV to Lux Converter

Watts / Energy Used vs. Lumens

night