# WIP: Cycles - Diffraction Grating Shader

**URL:** <https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231>\
**Category:** Blender Tests\
**Tags:** code, render\
**Created:** [September 7, 2026, 5:05am UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231 "2026-09-07T05:05:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Al\_Torres](https://blenderartists.org/user_avatar/blenderartists.org/al_torres/32/38724_2.png) [@Al\_Torres](https://blenderartists.org/u/Al_Torres)\
**Post date:** [September 7, 2026, 5:05am UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/1 "2026-09-07T05:05:14Z")

</div>

Hello everyone

I’m currently working on a new Diffraction BSDF for Cycles, with options for 1D Grating (simple grooves) and 2D Grating (reticular grids). Here are some examples:

 ![DiffractionRender](https://blenderartists.org/uploads/default/original/4X/e/5/0/e50fb8a6435e31d18de0f7310fbb8b755907193b.jpeg)

 ![image](https://blenderartists.org/uploads/default/original/4X/c/9/0/c906bbe099ae3f66efa79bab7809a562ce01889f.png)

 ![Sinusoidal](https://blenderartists.org/uploads/default/original/4X/5/3/3/53363e2d05503a4b96fae7f01f4175ca84fd2e2b.jpeg)

 ![Rectangular](https://blenderartists.org/uploads/default/original/4X/3/1/3/313387cb0159a01c39e3aefc8895afa5ca0c0a1f.jpeg)

 ![image](https://blenderartists.org/uploads/default/original/4X/e/1/1/e1191cc5d29550a0925a93cff541ce7a0bb1c2cb.png)

 ![2D Grid](https://blenderartists.org/uploads/default/original/4X/4/e/a/4ea9959c8e82404f70fc57e2ccc42e404a2451d9.jpeg)

Branch: [https://projects.blender.org/Al-Toto/blender/src/branch/diffraction-bsdf/](https://projects.blender.org/Al-Toto/blender/src/branch/diffraction-bsdf/)

---

<div class="post-metadata">

**Author:** ![mali\_zweipunktnull](https://blenderartists.org/user_avatar/blenderartists.org/mali_zweipunktnull/32/1470606_2.png) [@mali\_zweipunktnull](https://blenderartists.org/u/mali_zweipunktnull)\
**Post date:** [September 7, 2026, 7:12am UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/2 "2026-09-07T07:12:09Z")

</div>

So cool 😍 👍

---

<div class="post-metadata">

**Author:** ![Al\_Torres](https://blenderartists.org/user_avatar/blenderartists.org/al_torres/32/38724_2.png) [@Al\_Torres](https://blenderartists.org/u/Al_Torres)\
**Post date:** [September 8, 2026, 2:40am UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/3 "2026-09-08T02:40:35Z")

</div>

Animation test - CD

---

<div class="post-metadata">

**Author:** ![Scotty](https://blenderartists.org/letter_avatar_proxy/v4/letter/s/91b2a8/32.png) [@Scotty](https://blenderartists.org/u/Scotty)\
**Post date:** [September 8, 2026, 3:13am UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/4 "2026-09-08T03:13:11Z")

</div>

This is going to be awesome. 💯

---

<div class="post-metadata">

**Author:** ![Al\_Torres](https://blenderartists.org/user_avatar/blenderartists.org/al_torres/32/38724_2.png) [@Al\_Torres](https://blenderartists.org/u/Al_Torres)\
**Post date:** [September 9, 2026, 4:47am UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/5 "2026-09-09T04:47:37Z")

</div>

Animation test - Traffic Sign. In this case the real effect should be done by refraction of the light by the microscopic glass beads that produce the retroreflectivity. However, since we are also cheating the retroreflectivity

in this example, why not do the same for the refraction.

---

<div class="post-metadata">

**Author:** ![Al\_Torres](https://blenderartists.org/user_avatar/blenderartists.org/al_torres/32/38724_2.png) [@Al\_Torres](https://blenderartists.org/u/Al_Torres)\
**Post date:** [September 9, 2026, 11:33pm UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/6 "2026-09-09T23:33:38Z")

</div>

The branch is finally published! You can compile and test the shader here:

[https://projects.blender.org/Al-Toto/blender/src/branch/diffraction-bsdf/](https://projects.blender.org/Al-Toto/blender/src/branch/diffraction-bsdf/)

---

<div class="post-metadata">

**Author:** ![Al\_Torres](https://blenderartists.org/user_avatar/blenderartists.org/al_torres/32/38724_2.png) [@Al\_Torres](https://blenderartists.org/u/Al_Torres)\
**Post date:** [September 13, 2026, 7:02am UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/7 "2026-09-13T07:02:31Z")

</div>

More tests! This time using @secrop demo of Diffraction Grating (included in the Blender Guru’s blend file tutorial), first video is with the new Diffraction BSDF (compare the rendertime per frame).

---

<div class="post-metadata">

**Author:** ![Secrop](https://blenderartists.org/user_avatar/blenderartists.org/secrop/32/20093_2.png) [@Secrop](https://blenderartists.org/u/Secrop)\
**Post date:** [September 13, 2026, 7:30am UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/8 "2026-09-13T07:30:07Z")

</div>

> [@Al\_Torres](#):
>
> using the Blender Guru’s demo

That’s insulting!

---

<div class="post-metadata">

**Author:** ![mali\_zweipunktnull](https://blenderartists.org/user_avatar/blenderartists.org/mali_zweipunktnull/32/1470606_2.png) [@mali\_zweipunktnull](https://blenderartists.org/u/mali_zweipunktnull)\
**Post date:** [September 13, 2026, 7:39am UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/9 "2026-09-13T07:39:41Z")

</div>

Wasn’t it more the other way around, with Blender Guru using the groundwork laid by Secrop in this thread from 2014?

> [@A complex approach - Iridescence in cycles](https://blenderartists.org/t/a-complex-approach-iridescence-in-cycles/613211):
>
> I was wandering today on how to make a more accurate iridescence effect. I know that using the layer weight and a rainbow ramp can produce some acceptable look, but not quite accurate. The big problem, is that cycles will color all the scattered rays with the same color at the point being rendered and not each ray by their own direction. So i was thinking how to overcome this, and have something more real. And then i remembered that the samples for each pixel don’t hit everytime in the same pr…

---

<div class="post-metadata">

**Author:** ![Al\_Torres](https://blenderartists.org/user_avatar/blenderartists.org/al_torres/32/38724_2.png) [@Al\_Torres](https://blenderartists.org/u/Al_Torres)\
**Post date:** [September 13, 2026, 1:32pm UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/10 "2026-09-13T13:32:01Z")

</div>

My apologies, I was referring to the demo blend file of Blender Guru’s tutorial. I already fixed my post

---

<div class="post-metadata">

**Author:** ![Al\_Torres](https://blenderartists.org/user_avatar/blenderartists.org/al_torres/32/38724_2.png) [@Al\_Torres](https://blenderartists.org/u/Al_Torres)\
**Post date:** [September 13, 2026, 1:33pm UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/11 "2026-09-13T13:33:50Z")

</div>

Yes, my apologies. I was referring to Blender Guru’s demo blend file included in his tutorial. I forgot to give proper credit to Secrop, but already fixed my original post

---

<div class="post-metadata">

**Author:** ![Al\_Torres](https://blenderartists.org/user_avatar/blenderartists.org/al_torres/32/38724_2.png) [@Al\_Torres](https://blenderartists.org/u/Al_Torres)\
**Post date:** [September 13, 2026, 3:40pm UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/12 "2026-09-13T15:40:01Z")

</div>

1D Diffraction (CD grooves), 2D Diffraction (reticular)

---

<div class="post-metadata">

**Author:** ![Al\_Torres](https://blenderartists.org/user_avatar/blenderartists.org/al_torres/32/38724_2.png) [@Al\_Torres](https://blenderartists.org/u/Al_Torres)\
**Post date:** [September 13, 2026, 3:41pm UTC](https://blenderartists.org/t/wip-cycles-diffraction-grating-shader/1652231/13 "2026-09-13T15:41:19Z")

</div>

Cloth test (with varying rotation using Checker Texture)
