uberzev
![]() |
Thanks in advance.
|
|||||
Posted: June 6, 2006 3:37 am | ||||||
Vladimir Golovin
Administrator |
Uberzev, I suppose you mean the refraction component, not filter, so I'm correcting the title.
|
|||||
Posted: June 6, 2006 3:52 am | ||||||
uberzev
![]() |
Yeah thanks
![]() |
|||||
Posted: June 6, 2006 4:18 am | ||||||
onyXMaster
Posts: 350 |
The Refraction component simulates the following:
Imagine that you have a "bead" of transparent material (i.e. glass) with flat bottom and a non-flat (specified by Height input) top. "Stick" the Source input image to the flat bottom, specify the 1/IOR (index of refraction aka refraction coefficient indirectly mapped with scaling by 4.0, see your physics book for the explanation, or visit http://scienceworld.wolfram.com/physi...tion.html) with the Refraction input and look at the "bead" from the top -- that's the result. Unfortunately, there's no ability to specify the IOR relations larger than one, so it's always air-to-surface transfer, not vice versa which may be helpful in simulating layered materials with help of surface filters. |
|||||
Posted: June 6, 2006 4:37 am | ||||||
byRo
![]() |
Uberzev, you beat me to it. I was going to ask the same question.
![]() Although, like onyXMastersaid, it does behave like a transparent material with varying height - I find it pretty well impossible to predict what is going to come out on the result side. Rô _________________________________
My favourite question is "Why?". My second favourite is "Why not?" |
|||||
Posted: June 6, 2006 7:12 am | ||||||
Quasimondo
![]() |
I am under the impression that for the refraction component the "angle" between two (or four?) neighbouring pixel is measured - thus it behave different than the offset component which only looks at the individual pixel. But maybe I'm also totally wrong on this.
|
|||||
Posted: June 6, 2006 8:00 am | ||||||
Vladimir Golovin
Administrator |
Mario -- Internally, Filter Forge doesn't operate on pixels. But the concept is basically right, we take three samples of the Height input. The distance is not one pixel as you presumed, but much, much shorter -- ask OnyxMaster, he knows the exact distance.
|
|||||
Posted: June 6, 2006 8:06 am | ||||||
onyXMaster
Posts: 350 |
The normal map used for refraction calculations is approximated using 3-tap sampling (anisotropic, right/bottom-oriented, but it does not matter since our supersampling is isotropic and symmetric with centered sampling) using step which is equal to 0.001 pixels, respecting Size slider value. This dependence on Size creates unwanted effects when Image or Selection are used as inputs, but generally is very well suited for all procedural and bitmap-based components. The same algorithm is used for Surface normal map generation which is used then in lighting calculations.
|
|||||
Posted: June 6, 2006 1:49 pm | ||||||
Quasimondo
![]() |
Thank you very much for this explanation - I always love to know what's happening under the hood.
|
|||||
Posted: June 6, 2006 2:44 pm | ||||||
SpaceRay
![]() |
Although this is a very old thread, is good to know better how the refraction works instead of only the explanation given in the FF Help
|
|||||
Posted: September 22, 2013 12:13 pm | ||||||
Sphinx.
![]() |
I knew details about the mysterious refraction parameter were hidden deep in the ancient realms of the FF forum ![]() Wikipedia states the following typical valuestypical values for different materials:
Does this mean that we should divide conventional refraction index values by 4 (in relation to what onyXMaster states above) to get the corresponding refraction? E.g. water refraction index in FF = 1.333 / 4 = 0.33325? |
|||||
Posted: December 4, 2019 2:56 am | ||||||
GMM
Moderator
Posts: 3491 |
I'm afraid refraction values used in FF have no direct relation to conventional refraction indices. I've asked the developers to look into the component code, and it seems the [0...100] slider is mapped to the IOR range of [infinity... 1]. |
|||||
Posted: December 9, 2019 6:03 am | ||||||
Sphinx.
![]() |
Thanks, are you sure it not the other way around? I.e. FF Refraction [0...100] slider is mapped to the IOR range of [1..infinity]? Or maybe inverted FF Refraction range?
That would make more sense as there is no distortion if FF refraction is 0 (which again is what I would expect with a real world refraction index of 1) |
|||||
Posted: December 9, 2019 7:35 am | ||||||
emme |
I wonder what an IOR of infinity would mean in reality
![]() I guess we could try set up a test scene in a 3D renderer to find out what values would match the IOR of water/glass ect. Like render a half of a glass sphere with a grid below it and tweak the refraction value in FF to match the distortion. Should work right? |
|||||
Posted: December 9, 2019 9:02 am | ||||||
GMM
Moderator
Posts: 3491 |
I have little understanding how it really works. The exact formula that is fed into the renderer is as follows: asin((1 - slider_value)*normal_projection_length). I'm afraid I can't explain this code and don't have any more details to share. |
|||||
Posted: December 9, 2019 9:47 am | ||||||
Sphinx.
![]() |
Thanks, that makes sense - the slider is inverted like I expected. I'll see if I can figure out the relation to the conventional numbers ![]()
IOR of infinity? A piece of black hole core would be involved here, I guess ![]() Your experiment would definitely be a help, also to verify a solution a some point ![]() |
|||||
Posted: December 10, 2019 2:46 am | ||||||
emme |
Yup
![]() Will try this at some point. (not the black hole core... the 3D thing) |
|||||
Posted: December 10, 2019 2:13 pm | ||||||
emme |
Ok, here is a test. I rendered the reference images in Blender, then matched the refraction in FF. There is something wonky with the normal calculation at the top of the hemisphere in FF. Or it could be a problem with free ellipse / circular arc math. Other than that, the refractions match very closely with these values.
IOR 1.333 (water) -> 4.5 IOR 1.450 (glass) -> 5.5 ![]() |
|||||
Posted: December 13, 2019 11:59 am |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,712 Registered Users
+19 new in 30 days!
153,533 Posts
+31 new in 30 days!
15,348 Topics
+73 new in year!
24 unregistered users.