Page 1 of 1
How to make CD DVD like diffraction? Is it possible?
Posted: Sun Jan 30, 2011 6:01 am
by ior
The answer seems to be:
By using bump texture were the lines are smaller than the wave length of the light.
Did not tested. But does it work in indigo?
Thanks.
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Sun Jan 30, 2011 7:34 am
by galinette
ior wrote:By using bump texture were the lines are smaller than the wave length of the light.
It doesn't work for sure! This would require the support of light diffraction on scene geometry, which is extremely complex and does not exist in any renderer (except maybe some very experimental research codes which cannot really be called renderers)
These surfaces, called "diffraction gratings", could be however be supported by custom BRDFs but since Indigo does not allow to make what I would call "third party BRDF plugins" it would need to be hard-coded in Indigo (as a new material type)
It is however maybe possible to fake that effect by giving the CD a thickness, applying a specular material with very high cauchy coefficient, and set a non transparent reflective material on the back side. It may give some illusion of it, but you will still lack the anisotropic effect (which requires the not available ward material type, or some concentric bump scratches)
Etienne
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Sun Jan 30, 2011 10:15 am
by dcm
Galliente, you need to be part of dev team. Im sure other users will agre!

Re: How to make CD DVD like diffraction? Is it possible?
Posted: Sun Jan 30, 2011 10:48 am
by ior
galinette wrote:It is however maybe possible to fake that effect by giving the CD a thickness, applying a specular material with very high cauchy coefficient, and set a non transparent reflective material on the back side. It may give some illusion of it, but you will still lack the anisotropic effect (which requires the not available ward material type, or some concentric bump scratches)
Hi, I will try that! Maybe 2 layers with different refractive indexes on top of mirror with circular bump would work.
EDIT: It doesn't work but ill try a solution.
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Sun Jan 30, 2011 3:14 pm
by Headroom
dcm wrote:Galliente, you need to be part of dev team. Im sure other users will agre!

I totally agree. I have several times suggested to give Galinette at least a developers badge but the folks at glare are rather hesitant
He should have gotten the badge already for his contribution of several outstanding ISL shaders!
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Mon Jan 31, 2011 1:29 am
by Meelis
What if u model the geometry (not in µm level), im shure u get the effect.
U can model very small sector and instance it.
that's 0.000002 m
http://en.wikipedia.org/wiki/File:CD_layers.svg
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Mon Jan 31, 2011 5:58 am
by galinette
Meelis wrote:What if u model the geometry (not in µm level), im shure u get the effect.
If you model the geometry, you may get the anisotropy but never the colored diffraction
This requires modelling of light as waves and not as rays. Since computing the intersection between a wave and a geometry is several degrees of magnitude more complex than intersecting a ray and a geometry, this is still at the level of sci-fi (or experimental code taking hours to render a scene with 100 polys)
Only hope, is a dedicated "grating" BRDF material not available in Indigo.
ior wrote:EDIT: It doesn't work but ill try a solution.
What does it look like? I'm curious...
That sounds like a tricky challenge... I should give it a try if I find time... However, I'm sure it needs to be quite fake.
Etienne
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Mon Jan 31, 2011 7:23 am
by ior
Seems that I'm heading for a solution.
A layer of transparent specular material with cauchy of 3 and a ior of 1 modeled with small angled slits of one degree (very small like 0.1 mm) and a layer of mirrored material.
But it is still an approximation because in a real holographic diffraction grid i think that diffraction does not bend like in this prism like approach.
Ill post some images when I have time to finish.
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Mon Jan 31, 2011 9:57 pm
by galinette
ior wrote:A layer of transparent specular material with cauchy of 3 and a ior of 1 modeled with small angled slits f one degree (very small like 0.1 mm) and a layer of mirrored material.
Be careful, 0.1mm is the nudge distance. You may have to change it
I got that yesterday evening. It is made by a shader on a single flat surface:
However, it is a big hack and the reflectance is quite low (lot of energy loss)
Basically, it is made of thin circular bump grooves for making an anisotropy reflection (classicalk pseudo-ward hack), with an overriden specular reflection color defined by a wavelength dependant shader that mimics the equation of dispersive gratings.
As the colors are made by filtering the specular color depending on angle, and not by redirecting each wavelength to a different angle, this explains the low reflectance obtained.
It is also very scale dependant : the groove bump height must be tweaked if you change the UV mapping scale, or you loose the effect.
Etienne
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Mon Jan 31, 2011 10:01 pm
by galinette
And... I maintain my position : giving access to a custom material API SDK for developping material plugins with custom BRDFs ( which is complicated because you have to define normalized PDFs, sampling functions, I know etc...) would allow me to make some very advanced materials. But I know, that the material class interface itself reveals some renderer secrets so...
But this may be one reason to switch to look to open source renderers one day... the SDK is self-contained!
Etienne
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Tue Feb 01, 2011 3:49 pm
by dakiru
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Thu Feb 03, 2011 1:18 pm
by ior
Hey galinette, your way is much better than mine. Is there any way to compensate the loss of light reflection power?
In the previous post I suggested a method, but it does not work, it only works with light at 90 degrees from surface and therefore only with parallel bumps viewed from a parallel point of view in relation to bumps.
But It resolved my problem of creating a diffraction mirror for light rays.
After some attempts I could not achieve the results I was aiming for.
Don't have much time now, so later Ill post here if I find a solution.
Re: How to make CD DVD like diffraction? Is it possible?
Posted: Thu Feb 03, 2011 1:28 pm
by dakiru
Here is even a
paper about it
