Hot answers tagged

15

Using two Fresnel terms is correct in the sense that any given diffuse path will pass through the surface twice. If you're solving diffusion by tracing a path through the medium until it bounces out again then that you will get two (or more) Fresnel terms for that path as it interacts with the surface. However, that's not what you're doing with a diffuse ...


13

Warning: I am not a physicist. As Dan Hulme already explained, light can't travel through metals, so dealing with IOR is a lot more... complex. I will answer why that happens and how to calculate the reflection coefficient. Explanation: Metals are filled with free electrons. Those electrons react to external fields and reposition until electrostatic ...


9

In Schlick's 1994 paper, "An Inexpensive Model for Physically-Based Rendering", where they derive the approximation, the formula is: $$F_{\lambda}(u) = f_{\lambda} + (1 - f_{\lambda})(1 - u)^{5}$$ Where So, to answer your first question, $\theta$ refers to the angle between the view vector and the half vector. Consider for a minute that the ...


8

The Fresnel coefficient should be evaluated using $H$, not $N$. You wrote, I have trouble seeing why we can still use that formula in a BRDF, which is supposed to approximate the integral over all the hemisphere. It's not. The BRDF in itself does not approximate the integral over all the hemisphere. The rendering equation does that: you integrate over ...


8

While browsing to properly write my question, I actually found the answer, which happens to be very simple. Another Fresnel term is also going to weight in as the photons make their way out of the material (so being refracted into the air) and become the diffuse term. Thus the correct factor for the diffuse term would be: $$(1 - F_{in}) * (1 - F_{out})$$


7

Yes, because refractive index can vary with wavelength. This is the origin of colored specular reflection in metals such as gold and copper; most other materials have essentially uncolored specular. At each wavelength, the specular reflectance at normal incidence is related to the refractive index at that wavelength according to the formula you mentioned. ...


6

Look at the refractive index of several metals. They are all complex numbers and the math does work out when you put this into the fresnel equation: you get the expected high reflectivity at all angles. There are also subtle color shifts because the index depends on wavelength. This is actually used in rendering but it is not common. The function is ...


6

@PaulHK's answer is correct I'm sure, here's a bit of a check to show that the IOR() function is calculating the reflection coefficients for $s$ and $p$ polarizations then averaging the two assuming unpolarized incident light. The reflection is for a single interface, and at least at normal incidence the results reduce to the simpler $(n_2-n_1)^2/(n_2+n_1)^...


5

I finally figured out a flaw in my argumentation to use the half vector for the diffuse part. tl;dr version: $\alpha_{hi}$ and $\alpha_{ho}$ are not equal, this assumption only works for the specular part. Therefore the energyconservation is not given. More correct: Per definition $\alpha_{hi} = \alpha_{ho}$, but you are not allowed to use them in the ...


4

I wasn't really expecting that, no. The formula in the paper is not the most elegant - there's quite a few parentheses in there. In this case I think it's just a matter of shuffling the parentheses around a little in the get_k implementation - both terms should be divided by (1-r): float get_k(float r, float n) { return std::sqrt( 1.0/(1.0-r) * (...


4

This is the complex number version of refraction, were K is the extinction coefficient. This is commonly used for metals. You can check the Wikipedia on refraction: Complex refractive index | Wikipedia


3

Unfortunately, the iridescence model is not made to be applied to a diffuse term. Pascal and I made it for microfacet models only (that is the specular term). One way to understand how to include it to a game engine might be to look at Unity's HDRP implementation. In the Lit.hlsl to see how to incorporate the iridescence Fresnel into a specular + diffuse ...


2

The refractive index is related to the speed at which light travels through the medium, and only applies to materials which are at least partially transparent. Metals are electrically conductive, so they are opaque, so light can't travel through them at any speed, so they don't have a refractive index. This is why Fresnel's law doesn't apply: it's for ...


2

Physically, the origin of diffuse light is subsurface scattering, which happens continuously as light travels through a material. So, the proportion of transmitted light depends on the thickness of the object. There's no precise equivalent to the Fresnel law, but maybe the closest thing is the Beer–Lambert law. It states that the transmitted light falls off ...


1

We have $t_{12} = t_{21}$, by the law of reciprocity. Also, $$r_{12} + t_{12} = 1\\r_{21} + t_{21} = 1$$ It follows that $r_{12} = r_{21}$ as well.


1

So I found a solution on a shader toy. I choose randomly from sampling diffuse or sampling specular with distribution 50:50. But I calculate PDF of both and average then. If you want to use a different proportion between sample function you just have to make sure that PDFs are combined with the same proportion as choose.


1

If you just implement Fresnel alone you'll see that what you think in your original question is mainly correct for dieletric materials. However don't calculate Fresnel ahead and then stochastically decide if evaluate your specular component or your diffuse one. Being part of the BRDF you have to accumulate the Fresnel term while evaluating the BRDF and only ...


1

BIG UPDATE and explanation of BRDF model While I was cleaning my browser and closing about 100 tabs I found this awesome website (it was there 3 days so I could already found an answer...) which finally made everything clear for me. The problem wasn't in Fresnel at all. In fact, it doesn't matter what IOR you are using for the most time. Fresnel says how ...


1

I will answer based on my experience with Fresnel models. Due to Kirchhoff's law of thermal radiation, in an opaque material the emissivity plus reflectivity plus absorptivity equals to one for every direction in thermal equilibrium. If the BRDF model you are using is physically-based, it should preserve energy conservation. That means that for a given ...


1

We're actually going through that paper for our own GGX BRDF metallic & edge_tint model, and we've spotted one crucial problem. Hammon is still using the Fresnel Schlick approximation for his microfacet field ray-trace which in reality only works for dielectrics (and conductors but with a hack). But we went all out on actual Fresnel (discarding ...


Only top voted, non community-wiki answers of a minimum length are eligible