---
title: "Rendering Refractive Surfaces"
canonical: "https://documentation.chaos.com/space/VMAX/113586752/Rendering%20Refractive%20Surfaces"
format: markdown
---
## **Overview**

---

<span style="color: #272727">This article discusses how to use V-Ray for rendering refractive surfaces that are in contact. This is a typical scenario for scenes with liquids contained in glass or other transparent, or semi-transparent containers. </span>

<span style="color: #272727">Here we examine some potential modelling mistakes and the correct workflow with V-Ray. For shading guides on </span><span style="color: #272727">[how to create water material](https://docs-chaos.atlassian.net/wiki/spaces/VMAX/pages/125743670)</span><span style="color: #272727">, or </span><span style="color: #272727">[glass material](https://docs-chaos.atlassian.net/wiki/spaces/VMAX/pages/113575523)</span><span style="color: #272727">, follow the links. We won't go into great detail about the shading process here, but offer some tips.</span>

<span style="color: #272727">Additionally, we show a basic caustics effect workflow to complete the final image.</span>

Want to follow along but don’t have a license?


> Macro (ui-button)





## **Scene Setup**

---




## **Geometry**

---


---




---



---


> ✅ You can skip the unwrapping process, if you use a Triplanar map.

## **Modelling Workflows**

---

The issue with rendering two refractive surfaces in contact, is that we have two separate objects, which share the exact same surface boundary. From a modeling point of view, it is very difficult to ensure that the two objects have the exact same boundary geometry. While this can be achieved for static scenes, things may become very problematic in animation.

From a rendering point of view, if the two surfaces match exactly, the renderer cannot distinguish between them accurately, which may lead to errors in the rendering.

Considering these two issues, it is obvious that we need to separate the surfaces or to model the surface interface separately. We have the following options:

- **Aligned**: The liquid and the container are with aligned geometry with no gap between them.
- **Without intersection:** The liquid and the container do not touch and have a gap between them. This approach is simple to implement and does not require any special support from the renderer. However, it does not produce a realistic result. This is because the gap between the two surfaces changes the rendering drastically and makes the liquid look detached from the container.
- **With intersection: The liquid overlaps the container.** This approach potentially produces much more realistic results, but it requires special support from the renderer. This is because the renderer must keep track of which surfaces have been intersected along a ray path so that it can compute the correct index of refraction. Without this built-in support, this method cannot be used. Luckily, V-Ray supports the necessary framework for this, which makes **this approach the preferred one**.

See the following images for the three main situations regarding the geometries positions - aligned geometries, geometries without intersection and geometries with intersection:



As shown in the renders, the two approaches with aligned boundaries and the gap between the surfaces, render artifacts. For proper appearance in terms of reflections and refractions, position the geometries so that they intersect each other and avoid coplanar faces. This prevents from artifacts in the rendered image.


## **Shading**

---



---


## **Bonus: Caustics**

---



---

> ℹ️ Note that the Progressive caustics are still WIP and might not be suitable for all scenes. *For more information, see the **[Caustics](https://docs-chaos.atlassian.net/wiki/spaces/VMAX/pages/113586830)** page*.