Glass diffraction?
16923 23 5- Soothsayer
- Member
- 859 posts
- Joined: Oct. 2008
- Online
- pclaes
- Member
- 257 posts
- Joined: Nov. 2007
- Offline
I don't know if anyone has got an implementation lying around, but Mario did a really interesting presentation on this a while back:
http://www.sidefx.com/index.php?option=com_content&task=view&id=1240&Itemid=310 [sidefx.com]
http://www.sidefx.com/index.php?option=com_content&task=view&id=1240&Itemid=310 [sidefx.com]
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
His glass shader [forums.odforce.net] does it, so you could cop^H^H^H use that as an inspiration..
eetu.
eetu.
- Soothsayer
- Member
- 859 posts
- Joined: Oct. 2008
- Online
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
Soothsayer
Yes, I've seen that before but it's apparently not working in H10.
Well then, that means you'll have to get your hands dirty, right?
As a starting point here's a super simple RGB diffraction vop shader, it just makes 3 traces with a different IOR.
If you watch Mario's presentation video or read the above linked post,
you will know that this is not really the right way to do it.
You'll need to take several samples with different wavelengths and combine
them in XYZ color space.. watch the video
eetu.
- Soothsayer
- Member
- 859 posts
- Joined: Oct. 2008
- Online
Ha, I noticed 3 colors aren't giving nice results and now it makes perfect sense!
There's a couple of things though:
Why does this shader (and some others I noticed) not work in PBR? Do they need special treatment?
Also, in mental ray there are the refract nodes which I find quite straightforward to use but the mantra ones, errr… :shock: :?: What would be the simplest refraction setup with IOR?
There's a couple of things though:
Why does this shader (and some others I noticed) not work in PBR? Do they need special treatment?
Also, in mental ray there are the refract nodes which I find quite straightforward to use but the mantra ones, errr… :shock: :?: What would be the simplest refraction setup with IOR?
--
Jobless
Jobless
- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
Soothsayer
Yes, I've seen that before but it's apparently not working in H10.
It definitely works in H10. The problem is a change in how gui treats empty light/object scope fields which are present in mario's shader interface. You need to put wild card ( * ) into all of these fields (or any other reasonable light/object scope). Empy fields means none or “nothing” for H9/10.
As to question about PBR and not working shaders: PBR is a different engine using different set of illumination functions in vex, thus any shader needs to be prepared to be used with that. Mario's super glass shader was written prior H9. On the other hand it's one of the best glass shader out there (at least publicly available) , so I wouldn't be too fussy.
As to refraction node in xsi: in RenderTree Refraction is a shading component, which you simply plug with others into material but you can't for example specify direction for it, like in vex. So basically in xsi you can work without knowing what refraction does and in vex you should know what dir, nn, is expected to be and and use both RefractVOP and RefactLightVOP. This is more or less 2 minutes of investigation and pretty much the must to work with vop/vex successfully, so I encourage you to try it
cheers!
skk.
- Soothsayer
- Member
- 859 posts
- Joined: Oct. 2008
- Online
- mzigaib
- Member
- 948 posts
- Joined: April 2008
- Offline
- mzigaib
- Member
- 948 posts
- Joined: April 2008
- Offline
- mzigaib
- Member
- 948 posts
- Joined: April 2008
- Offline
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
- mzigaib
- Member
- 948 posts
- Joined: April 2008
- Offline
Thanks for the feedback!
I know as chromatic aberration
http://en.wikipedia.org/wiki/Chromatic_aberration [en.wikipedia.org]
I couldn't make your shader work with PBR, as far as I know your shader works with raytrace VEX functon which uses RGB and not BSDF functions I don´t know how to mix both efficiently and since I want to use PBR and the PBR surface model my thought is that in order to create the chromatic effect it needs to calculate it inside the surface model itself but I don´t know how to do it, In other render engines like Mental Ray and Vray I get this effect very easily I am just trying to find a way to get the same effect in mantra. I hope that makes sense.
So any ideas would be welcome.
Sorry for the bad English.
Cheers!
eetu
What diffraction do you mean?
I know as chromatic aberration
http://en.wikipedia.org/wiki/Chromatic_aberration [en.wikipedia.org]
eetu
At least that old hip of mine works for me. It's not a complete shader by any means, but you could use the same idea to modify an existing one. (You need to set up the sampling parameters again as the mantra node in there is quite ancient and gives noisy results)
I couldn't make your shader work with PBR, as far as I know your shader works with raytrace VEX functon which uses RGB and not BSDF functions I don´t know how to mix both efficiently and since I want to use PBR and the PBR surface model my thought is that in order to create the chromatic effect it needs to calculate it inside the surface model itself but I don´t know how to do it, In other render engines like Mental Ray and Vray I get this effect very easily I am just trying to find a way to get the same effect in mantra. I hope that makes sense.
So any ideas would be welcome.
Sorry for the bad English.
Cheers!
Edited by - April 25, 2014 09:37:10
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
- mzigaib
- Member
- 948 posts
- Joined: April 2008
- Offline
WOW Dude, Your naive setup turn out to be awesomely cool!
You really put some love on the setup I even feel bad for making you have all this trouble ;D
Just a question, is there a reason for why you also put the reflection component into the mix, in my little head I though if I just work with the refraction component I´d get the trick, maybe and probably I am wrong right?
Anyway thanks again dude, I´ll test and post the result here later.
You really put some love on the setup I even feel bad for making you have all this trouble ;D
Just a question, is there a reason for why you also put the reflection component into the mix, in my little head I though if I just work with the refraction component I´d get the trick, maybe and probably I am wrong right?
Anyway thanks again dude, I´ll test and post the result here later.
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
mzigaib
Just a question, is there a reason for why you also put the reflection component into the mix, in my little head I though if I just work with the refraction component I´d get the trick, maybe and probably I am wrong right?
Umm, actually you are right, the reflection probably should not diffract like refraction does
I just wanted to have the reflective component in there so it doesn't look weird, I guess I just copypasted that along with the refractive components without thinking..
Here's the same with just one reflection, without the color diffraction.
- mzigaib
- Member
- 948 posts
- Joined: April 2008
- Offline
- bender83
- Member
- 16 posts
- Joined: May 2010
- Offline
Hey there eetu, I've just started playing with your pbr dispersion shader and notice there's substantial noise in both the red and blue channels, but not the green - any idea why this might occur?? From what I see in the shader the only difference is the slight variation in the ior being fed to the fresnel… that to me doesn't seem to account for such huge differences in noise…
I've also checked my lightsource (an HDR) for major differences in the color channels and there really doesn't seem to be anything noticable in them…
I've also checked my lightsource (an HDR) for major differences in the color channels and there really doesn't seem to be anything noticable in them…
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
Yeah, I can see that too, interesting. In a way that's how it should be - if you check out the relative luminances [en.wikipedia.org] of RGB components, they are calculated as Y = 0.2126 R + 0.7152 G + 0.0722 B. Looking at this, it makes sense to allocate samples according to the weight of the RGB component. What surprises me here is that Mantra is smart enough to figure out that the different refraction functions in the shader actually only affect certain components, and assigns samples to them accordingly..
… Or maybe it's something else
… Or maybe it's something else
- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
-
- Quick Links