---
title: "Best Practices - Milk Bottle"
canonical: "https://rmanwiki-27.pixar.com/space/RU/619642881/Best%20Practices%20-%20Milk%20Bottle"
format: markdown
---
![CookiesNMilk_new_Banner.jpg](media://12311083-b0ea-412a-820f-c05d2bd0c4a5)

## Milk Bottle

Now we can take a look at the Milk and Bottle.

The milk itself is un-textured and will be covered later, so we'll isolate the bottle and discuss how it achieves the "dirty bottle" look realistically.

Glass possesses several unique characteristics that make it special. And because of this, the PxrSurface material has an entire section designed to recreate glass and the most common looks. To understand imperfect and dirty glass, try to dissect what's happening in the image. For imperfect glass, there will be variations of roughness across the surface. Unlike crystal and a few other surfaces, many older and worn glass objects are not perfectly reflective or transmissive (refractive). There's also the addition of fingerprints and smudges on the surface of the glass. You can use masks to generate these and add them to the diffuse lobe to mix in additional elements, such as dirt, paint, and dust.

Layering this effect more easily has two options we'll talk about, and a third concern about trace depth covered in another document:

- Using <u>[PxrLayerSurface](https://rmanwiki-26.pixar.com/space/REN26/19661463)</u> to separate and then combine the shading of the glass and the dirt.
- Correct UV layout to prevent texture repetition on the inside and outside.
- Controlling <u>[ray depth](https://rmanwiki-26.pixar.com/space/REN26/19661825)</u> appropriately to get the correct physical result for glass.


> ℹ️ It's best to model objects volumetrically. They should have actual thickness, and the space between the glass surfaces works just the way it does in the real world, and should behave as you would expect. Avoid using two-dimensional models unless it makes sense to do so, such as for things like leaves or paper.

> ℹ️ When rendering most glass containers with liquids, it's helpful to understand <u>[intersection priority](https://rmanwiki-26.pixar.com/space/REN26/19661549)</u> to avoid artifacts and "air gaps". This is technically known as the dielectric interface or nested dielectrics.


![milkNCookies_emptyBottle.jpg](media://97f543b3-3698-487b-82a6-f97ffa27f90c)


First, we'll examine the glass layer by removing the upper layers of dirt and milk.

In the glass base material, the diffuse channel has some dirt at a low gain of 0.2. The low gain, combined with a darker texture, will ensure the effect isn't too opaque, which would make the bottle appear to be made of glass. 



Above this glass layer is a simple dried milk smudge map applied as an upper layer in the PxrLayerSurface. A simple mask is applied to a white diffuse color. 

Below is the diffuse color and mask rendered on the bottle.


These are then combined for the final result. You'll find this to be straightforward with the Mix node that's auto-created when you select the option to make a PxrLayerSurface material.


![milkBottleNetwork.png](media://461ad3b7-7aad-4011-8dd4-fd3c29f812b9)



---

### <span style="color: #4c9aff">Next Steps</span>

Cool, we’ve dialed in the look for the glass milk bottle.  Let’s now look at the milk itself.


---

![RenderManUniversity_logo_Small.png](media://dec0d58d-17f8-4295-9c27-95f4d1bd897d)