13

Radiosity does not account for specular reflections (i.e. it only handles diffuse reflections). Whitted's ray-tracing only considers glossy or diffuse reflection, possibly mirror-reflected. And finally, Kajiya's path-tracing is the most general one [2], handling any number of diffuse, glossy and specular reflections. So I think it depends on what you means ...


10

There are a couple of special cases where mirror-like reflections can be rendered efficiently using rasterization techniques, and these are commonly used in games, although they don't work for the general case. Planar reflections If the reflecting surface is flat or reasonably close to flat, the reflected image can be rasterized in an separate rendering ...


9

The most commonly suggested method seems to be Mueller calculus, which boils down to tracking the Stokes parameters of a light ray to represent the polarization of light transmitted along that ray. A ray might be unpolarized—Stokes parameters of (1, 0, 0, 0)—or it may be circularly or linearly polarized in various directions, which is a property of light in ...


9

No, because the underlying physics is not the same, nor the lobe shape - not to speak of their parameters such as color and Fresnel term. Specular is really true surface interaction with the interface material/air, so it has Fresnel modulation and the internal medium has no influence on colors. But the surface condition strongly influence the reflectance, ...


7

You are late by about 35 years. This was addressed in the historical paper "Whitted, T., An improved illumination model for shaded display. Communications of the ACM, Volume 23 Issue 6, June 1980, Pages 343-349", using ray tracing. Since then radiosity has been introduced to better deal with diffuse phenomena. Correct physical modeling of the image ...


7

this is an interesting question (and I am actually an author on Scratchapixel so I can maybe help on that one)). Things go as follows: you cast the primary ray into the scene the ray hits the glass which is a refractive-reflective/transparent material you compute and cast two rays from the point of intersection: a reflective ray and a refractive ray if ...


6

TL;DR Yes, you can do it like that, you just have to divide the result by the probability of choosing the direction. Full Answer The topic of sampling in path tracers allowing materials with both reflection and refraction is actually a little bit more complex. Let's start with some background first. If you allow BSDFs - not just BRDFs - in your path ...


5

You need to spawn a new ray at each IOR interface. So let's say your ray hits the surface of the glass object. You spawn a new ray from the intersection point along the new IOR direction for air->glass interfaces, this new ray is inside the glass. This ray will then either hit a solid object or the interior surface of the glass. If we hit a solid object we ...


5

It depends how you define easy and what kind of constraints you have. The general case of this is rendering caustics but that's probably not what you're looking for if real time is your target. If your mirrors are always flat as in your demo and you only want to support a single bounce, the easiest I can see would be to reflect your light sources on the ...


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


4

Are you trying to make your own rendering engine? Here is a solution that prioritizes visual quality ; it is slightly more complex than the object-based solution you are referring to. For better visual quality your shading should be on a per-pixel basis. (If you highly prioritize performance, or do not require detailed reflections, you should probably ...


3

A texture is just a fancy lookup table; that's all it is. It's a function that you input some coordinate T into, which returns a value for that particular T. There are many ways that one might choose to build such a function. A 1D texture is a lookup table where the coordinate is a single value on the range [0, 1]. A 2D texture is a texture where the ...


3

Why starting from a 3D direction vector? Because that is most commonly the way you get the direction from the sight line where you want to sample the env map along. Technically you can use any convex 3D shape as the surface of the map. For example a tetrahedron that gets unfolded into 2 rhomboids. However the GPU is already optimized to render to a ...


3

@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)^...


3

But, at this point, do i apply a specular highlight to the surface that i hit from the inside? Unless you have a light source inside your object, there's no point in doing lighting on the inside surface as you'll hit the object again before you reach the light or environment. If you want to support a light in the object, then by all means do your lighting ...


3

You can mimic a mirror by masking out the visible reflective surface when you first render and then mirror the world around the reflective plane and render again while only drawing where the reflective surface was. There are some other details to worry about like not drawing stuff on the far side of the mirror when drawing the mirrored world which can be ...


3

This is one of the most common "misconceptions" on rendering, rasterisation and ray-tracing. Don't get me wrong. This is a good question, but one that should be answered once and for all. So to answer your question: 1) it is much easier to simulate reflection and refraction with ray-tracing than with rasterisation, which is often why when you see an image ...


2

If you want a real-time solution (no baking), and only need one reflection bounce, you can try to generate (or update) a cubemap of the scene every frame, as described in this graphics study of GTA5 . This solution should work in general cases (be sure to handle cases when the cubemap probe would be in an object of the scene). If rendering the six faces ...


2

If there is only a single flat mirrored surface the solution is to render the scene twices, once normally. Afterwards you use stencil to mark the area where the mirror is visible. Then only drawing into that area you render the scene again but mirror it around the mirror's plane and cull any geometry on the other side of the mirror.


2

Usually modern game engines use Screen Space Reflections which is some kind of screen space raymarching. Basically, a simple way to achieve this is to shoot rays from the G-buffer. This means you use your depth buffer as a height field by raymarching any ray you cast. Then sample the normal at this position and take the final composed lighting from you ...


2

$N \cdot L$ is the scalar length of the projection of $L$ on $N$ (assuming $|N|=1$). $(N \cdot L)N$ is the actual vector with the length of $N \cdot L$ in the direction of $N$. There is often a confusion when people say "projection of this on that" whether they mean just its length, or the actual vector resulting from the projection. In this case you want ...


2

Raytracing is one of the techniques that trace the light as it moves through the scene. This can, depending on the implementation, also include effects such as refraction, reflection and scattering. Raytracing and similar techniques (see Monte-Carlo Pathtracing for example) all are based on the idea to solve the so called rendering equation. The equation is ...


2

I found an answer in the form of the Todd-Coxeter Algorithm from group theory. This still involves iterating over permutations of the group, and removing duplicates. However, the group can be defined using symbols to represent different sequences of operations, and duplicate-matching performed on these symbols rather than elements of the group itself. For ...


2

The charts you show aren't showing two different phenomena - "glossy reflection" and "specular reflection" - they're showing two parameters of specular reflection. One is the specularity or specular colour and gives the amount or brightness of the specular reflection. The other is the glossiness or roughness and shows how sharp the specular reflection is. ...


2

Notch's engine most likely works using volume raymarching in a volume field. This means that you shoot rays that move a certain distance and check whether they are inside and object or not. Once they are, they return the position of the colission and some other data. You can either advance rays by a set amount per step until you hit something or refine the ...


1

After some testing and some research I have found that both the $\sin(\theta)$ and the $\cos(\theta)$ should be removed from the denominator. the reasoning is that, since we want a probability function of steradians instead of angles, the $\sin(\theta)$ factor (which is essentially used to convert from steradians on a unit sphere to radians on the two polar ...


1

I don't really understand what are you doing. I think your first equation shouldn't have a cos factor in it. We have the relation, $BRDF = dL_r / dE_i$ That is the brdf is the ratio of reflected radiance to incoming "irradiance". Re-arranging this gives us, $ dL_r = BRDF * dE_i$ For diffuse surfaces we know, $BRDF = \alpha/\pi$ Substituting in above ...


1

The code does seem a bit ugly since it doesn't assign pdf and instead returns 0. By returning 0 it's basically saying the same thing as pdf = 0 because f.IsBlack() returns true. This is acceptable, it's basically saying the BSDF doesn't allow light go through at the given $w_o$


1

@PaulHK explained it very well in the comment section: Ambient is a (rough) approximation of indirect lighting. For example, an outdoor object would be lit by the sun but the surfaces facing away from sun would be black if using only lambert shading, we can use dark gray for the ambient colour to mimic the effect of indirect lighting from the ground and ...


1

Gloss and Specularity are features of the surface. In modern PBR terms we usually refer to the smoothness and metalness of a surface instead (unless you use a specular workflow, then metalness is still linked to specular). Basically, dielectric surfaces reflect around 4% of light in a specular way, and the rest is diffuse. Metallic surfaces reflect no light ...


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