---
title: "Samples made Simple"
canonical: "https://rmanwiki-27.pixar.com/space/RU/405733531/Samples%20made%20Simple"
format: markdown
---
![LuxoBall_point05.jpg](media://8c29d3ab-1a5b-4e7e-86a3-ea0c53f6d705)

The goal of this page is to give you a straightforward overview and starting point for setting up your Min and Max samples with RenderMan XPU, but before we do that, let’s get some terminology out of the way first … 

**Sample**

A single ray is emitted from the camera and bounces around the scene.  The energy that it finds in a scene is stored in a pixel.

Low samples give you a lot of noise, but a quick image.

High samples give you a cleaner image, but a slower render.

There must be a way RenderMan can negotiate a nice balance between too low and too high, right? Yes! This negotiation of quality is called Adaptive Sampling, and it’s measured in Pixel Variance …


**Pixel Variance** 

A measure of noise due to sampling.  

The higher the pixel variance, the noisier the image appears to be. 

The lower the pixel variance, the cleaner the image appears to be.

We specify a *variance threshold* to the renderer to tell it how much noise we are willing to accept in the completed image.

The lower the pixel variance threshold, the cleaner the final render will be, but the longer it will take for rendering to complete. In general, every time you halve the variance threshold, the render time will increase fourfold.

---

Now we know more about what a Sample and Pixel Variance are and how they work together, let’s put this into a practical example.


<span style="color: #4c9aff">**Step 1.**</span>

Start by setting your Min / Max samples as below:


<span style="color: #4c9aff">**Step 2.**</span>

By default, the threshold is set to 0.05, which will produce a high-quality image. 

For our first test, set the value to 0.2 to obtain a quick, noisy image.


Using these base settings, let’s fire off a render.

![LuxoBall_point2.jpg](media://58a0c5fc-79c2-4150-8aa0-5ef10d5a1ba1)

![LuxoBall_point2_close2.webp](media://a71abf3b-305d-4ef7-b96f-16d9dc449cb5)

The image above was rendered in 18 seconds, but as you can see, we still have some noise because the pixel variance threshold was set high, so the renderer decided the pixels were clean enough, even though, to our eye, they are still noisy.


<span style="color: #4c9aff">**Step 3.**</span>

Let’s run some more tests. 

In the image below, we’ve rendered the same scene again, each one with a different pixel variance.  

![XPU_VarianceComparisson.jpg](media://c1f8c98f-1728-4191-9c5e-300fc70146e2)

As you can see, our high threshold render at 0.2, we get an image back in 18 seconds, which is still usable for review but contains noticeable noise. (Incidentally, it's likely that even at this low quality, the amazing RenderMan Denoiser would produce a production-quality image from this.)  

You can also see that by lowering the threshold to 0.01, we now have a perfectly clean image, arguably cleaner than we would need, but the render time rocketed up to 11 minutes and 45seconds.  


<span style="color: #4c9aff">**How to choose a threshold?**</span>

So … the big question here is …* *<span style="color: #4c9aff">*“What do I set my pixel variance value to?”*</span>

Well … the answer is that there is no single value that will work every time for your scene, but setting the min and max to a wide range and relying on pixel variance to drive your choices is an excellent start.

Ideally, you should run some tests, as shown in the image above, and see what works for you.  


> ℹ️ The good news is that because the RenderMan Denoiser is so good at removing noise whilst retaining finer detail in hair and surface imperfections, it has allowed Pixar to raise the pixel variance on most production shots to <span style="color: #6554c0">0.18</span>, which in turn means that not only can we can render shots faster than ever before, but this also allows artists to iterate and refine shots quicker.  
> ℹ️   
> ℹ️ It also allows Pixar to render shots that were previously impossible.



Knowing that we have the power of the RenderMan denoiser on our side, we know that lowering the pixel variance to <span style="color: #6554c0">0.01 </span>is too low, so a good place to start is <span style="color: #6554c0">0.1 </span>

Do another render, run the denoiser, and see how it looks.

Then fire off a few more renders, each time raising the pixel variance until you reach the rendering sweet spot: fast render times and an acceptable amount of noise that the denoiser can clean up.  

You’ll be amazed at how high you can push your pixel variance while leaving the heavy lifting to the denoiser.


> ℹ️ This example demonstrates how to set a threshold on a single image.  
> ℹ️ 
> ℹ️ If you are working on an animation, don’t forget to render a sequence of frames to ensure that motion blur and depth of field are clean, and to avoid typical issues associated with low samples, such as missing tiny objects like stars, dust, or particles.


<span style="color: #4c9aff">**Visualizing your samples.**</span>

Another question you might be asking yourself is … <span style="color: #4c9aff">*“How do I know where all my samples are being used in my render?”*</span>

RenderMan has a very useful AOV called Sample Count, which can be added to your render and the values inspected in IT to help you determine where the renderer is calculating samples.  

Below is what our Sample Count AOV looks like.  We can see that the image is brighter when more samples are used.  The darker areas indicate fewer samples.

![LuxoBall_point05_sampleCount.jpg](media://21f53e4e-2b58-4d9e-a809-369a67e859ef)

> 📝 When you inspect these pixels in the IT viewer by hovering over them with your mouse, you’ll see the exact “average samples per pixel” for that pixel.