The Stack Overflow podcast is back! Listen to an interview with our new CEO.

# Tag Info

39

Real-time graphics deploys a variety of approximations to deal with the computational expense of simulating indirect lighting, trading off between runtime performance and lighting fidelity. This is an area of active research, with new techniques appearing every year. Ambient lighting At the very simplest end of the range, you can use ambient lighting: a ...

30

To start, I highly suggest reading Naty Hoffman's Siggraph presentation covering the physics of rendering. That said, I will try to answer your specific questions, borrowing images from his presentation. Looking at a single light particle hitting a point on the surface of a material, it can do 2 things: reflect, or refract. Reflected light will bounce away ...

23

I was actually wondering about exactly this a few days ago. Not finding any resources within the graphics community, I actually walked over to the Physics department at my university and asked. It turns out that there are a lot of lies we graphics people believe. First, when light hits a surface, the Fresnel equations apply. The proportions of reflected/...

15

Spherical harmonics If you know what a Fourier transform is, you already almost know what spherical harmonics are: they're just a Fourier transform but on a spherical instead of a linear basis. That is, while a Fourier transform is a different way of representing a function $f(x)$, spherical harmonics are the analogous thing for polar functions $f(\theta, \... 13 The next step up from a pinhole camera model is a thin lens model, where we model the lens as being an infinitely thin disc. This is still an idealization that pretty far from modeling a real camera, but it will give you basic depth of field effects. The image above, from panohelp.com, shows the basic idea. For each point on the image, there are multiple ... 13 Talking about Linear RGB must be avoided because it does not tell you anything about the RGB colourspace intrinsics, i.e., Primaries, Whitepoint and Colour Component Transfer Functions. A few years ago, assuming it was sRGB was middling but nowadays with DCI-P3 and BT.2020 being very common, it must be ruled out. The ideal gamut for rendering is the one ... 11 I would trust Pharr and Humphreys on this. Equation 2 also agrees with the SIGGRAPH Physically Based Rendering course notes, as well as with equation 20 in the Walter et al paper that introduced the GGX distribution. I've read somewhere that there is an error in the original Cook-Torrance paper that led them to miss the factor of 4 in the denominator, which ... 10 Basics of Spherical Harmonics Spherical Harmonics is a way to represent a 2D function on a surface of a sphere. Instead of spatial domain (like cubemap), SH is defined in frequency domain with some interesting properties and operations relevant to lighting that can be performed efficiently. With increasing "order" of SH you can represent higher frequencies (... 10 There is a vast amount of open problems in real-time graphics: shadows, aliasing, reflections, global illumination, transparencies (blending order and lighting) etc. SIGGRAPH annually hosts a course called "Open Problems in Real-Time Rendering", which describes current issues in real-time graphics (mostly game dev industry standpoint). You can find last ... 9 It is in fact possible to augment a ray tracer to make it capable of simulating wave effects. The paper Rendering Wave Effects with Augmented Light Field describes one way to do it. In summary, they introduce a framework called Augmented Light Field that allows them to model wave effects with a ray-based representation. In this framework, rays can carry ... 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 ... 8 As mentioned in this answer, Physically-Based Rendering isn't a set number of things. It's a concept. It's akin to saying something is 'Environmentally Friendly'. There are many different techniques to be environmentally friendly and someone can implement those techniques to varying degrees. The same is for PBR. In the end, Physically Based Rendering is ... 8 To my knowledge, there is no easy and analytic way of recovering the energy lost in single-scattering models. The previous techniques precompute the energy loss and reinject it in the BRDF as a diffuse-like component: http://sirkan.iit.bme.hu/~szirmay/scook.pdf http://www.cs.cornell.edu/projects/layered-sg14/layered.pdf What they propose is energy ... 8 Yes, it's possible in some extreme cases for HDR lighting and tonemapping to expose banding issues in color textures. In those cases, having a higher bit depth for the textures could be useful. However, in my experience the majority of materials and ordinary lighting situations don't exhibit this problem, and most textures in a typical game are fine in 8-bit ... 8 In film production, we almost never use 8-bit textures for color/albedo, because of banding, etc. (JPEG is especially problematic since by spec, it's sRGB rather than linear values.) We either use 'half' (16 bit float) or 16-bit unsigned integer values for color/albedo textures. 7 Ambient occlusion cannot be physically based no matter what algorithm you use to calculate it. It's a simplification of global illumination that assumes all occluders only block light and are themselves completely black, which isn't true and generally makes corners darker than they should be. Ideally, you would be using some kind of global illumination ... 7 I'm going to provide the simple/naive/brute force answer to this question, which does work, and gives accurate results. There are better answers however, which make the rendering converge faster with fewer samples, but uses more advanced math. I'm hoping someone else will provide an answer along those lines. The simple answer is this: Area lights are just ... 6 When I implemented real-time area lighting, there were two documents I kept referring to: "Moving Frostbite to PBR" by Sebastien Lagarde and "Real Shading in Unreal Engine 4" by Brian Karis. Also "Lighting of Killzone Shadow Fall" by Michal Drobot is an interesting read on the topic. None of these documents deal with area shadows though but focus on energy ... 6 PBR isn't just a feature you "add to a rendering engine" but an entire philosophy how to approach solving rendering problems. This seems to be a common prevailing misconception when people talk about PBR. Quite often people assume that when they have implemented physically based BRDF (e.g. GGX) into their engines, they are "done implementing PBR". They are ... 6 You probably know that the BRDF is to calculate the reflected light, from a light source to a camera (In examples a light source and a camera is used, but it does not need to be just that). The property that you are talking about, basically says that when you swap the light source with the camera, it still gives the same result. Lets look at an example I ... 5 I'd like to invite readers to read this article about Quake 2 engine rasterization technology explained in details, if they have the time. If TLDR, please pay attention to this image: What we see is the Albedo channel, that's what you want to encode in 16 bits if I understand your question correctly. I'm not going to say "if it could be encoded in 256 ... 5 Computer Graphics can be divided in multiple subdomains of which I will only talk about physically-based rendering (the one I am the most familiar with and probably the one you are referring to based on the tags of the question). Physically-based rendering (also referred to as global illumination) is generally far from real time at the moment. The speed we ... 5 This is the main 'hard' problem remaining in real-time CG, and there is a lot of research ongoing into solving it. The biggest hurdle is that in raster graphics, each component of the scene is rendered 'in a vacuum' - each triangle is rendered without reference to any other triangles in the scene, and the same goes for pixels, as opposed to ray-tracing ... 5 Spherical harmonics Let's say you have some data in an array but you want to represent that data with a fewer number of bytes. One way to do that could be to express the data as a function instead of the raw values. You could represent it as a linear function:$y=ax+b$Then instead of storing your array of values you could store just$a$and$b\$. ...

5

For an introduction, you can give a look at: Ray Tracing from the Ground Up (Amazon link here). It starts really from the basics, and provides simple implementations for the concepts that are gradually introduced.

5

The missing step If you already understand how to generate a secondary ray, then you have already grasped the difficult part. All you need to do now is find the colour that this secondary ray results in. This is exactly the same process as using the primary ray to find a colour, in basic ray tracing. After repeating this for a large number of secondary ...

5

Your confusion comes from fact that in some basic tutorials like one you point cubemap which is used for applying lighting is global and static - it does not come from actual geometry but from infite sky box which moves with camera position so it is valid everywhere. And there is nothing mentioned about second type - local cubemaps which are actually ...

5

In practice, when we say "linear RGB," we mean "sRGB without the gamma correction." It would be more correct to say that there is the "sRGB colorspace" and the "linearized sRGB colorspace", with the sRGB specification definition the conversion from one to another. Yes, there are infinitely many "linear RGB" color spaces. But the thing that all of these "...

5

Yes, I think it's expected that setting roughness = 0, combined with using point lights for illumination, leads to no visible specular highlight. The size of the highlight is infinitesimally small, so the sample points (e.g. pixel centers) almost surely miss it. The math breaks down as well, as the reflectance would become infinite on the zero-sized ...

4

Found the solution, it turns out the lightVec is not the vector of light from the tube but rather the direction the tube will point. Therefore i will need to pass it a light rotation value to be used there. Results:

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