Skip to main content
25 votes
Accepted

Why are normal maps blue and purple in color?

Only tangent space normal maps are primarily blue. This is because the colour blue represents a normal of (0,0,1) which would be an unchanged normal when the triangle lies in the plane x and y, i.e. ...
Syntac_'s user avatar
  • 561
17 votes

What are Spherical Harmonics & Light Probes?

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 ...
Dan Hulme's user avatar
  • 6,810
15 votes
Accepted

What are Spherical Harmonics & Light Probes?

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 ...
JarkkoL's user avatar
  • 3,636
15 votes

Rendering equation - why unsolvable directly?

I'm sadly not able to add a comment to the answer above (not enough reputation), so I will do it like this. I'd like to point out that what Dragonseel describes is simply an integral equation (...
Vanbus's user avatar
  • 304
15 votes

Why are normal maps blue and purple in color?

Because a normal map is covering vectors from -1 to 1 it makes sense to stretch this range into 0->1 so all of it can be fit inside the range of RGB. So usually we apply a transform on the normal to ...
PaulHK's user avatar
  • 2,322
13 votes

Rendering equation - why unsolvable directly?

The rendering equation is as follows: Now, the integral is over the sphere around the point $x$. You integrate over some attenuated light, incoming from every direction. But how much light comes in? ...
Dragonseel's user avatar
  • 1,810
13 votes
Accepted

For shader math, why should linear RGB keep the gamut of sRGB?

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 ...
Kel Solaar's user avatar
11 votes
Accepted

What is a vertex normal used for?

First, I cannot imagine how could a vertex have a normal,... Welcome to the exciting field of computer graphics. The first thing that might lead to your confusion is to think about a vertex too much ...
wychmaster's user avatar
  • 1,251
10 votes
Accepted

Why is spherical harmonics used in low frequency graphics data instead of a spherical Fourier transform?

Spherical harmonics really are the "spherical Fourier transform" you're looking for. The kind of hack you mention in comments, of doing a 2D Fourier transform on a lat-long projection, suffers from ...
Dan Hulme's user avatar
  • 6,810
10 votes
Accepted

OpenGL specular shading - Gradient banding issues

This is a common problem with very subtle gradients. The problem is that the image is displayed with 8 bits per component and this is not quite enough precision to make a gradient that is smooth to ...
Nathan Reed's user avatar
10 votes

Formula for the ambient light intensity of a scene?

Using an 'ambient light' term in your lighting calculations is an approximation of the indirect light reflected around the scene. Usually it's up to the artist to choose an appropriate value. There ...
RichieSams's user avatar
  • 3,782
10 votes
Accepted

Why Diffuse Light use max(N · H, 0) instead of just letting it be negative?

If lighting with multiple lights, they add together to make the final lighting value. A negative light would darken other lights, which is incorrect. This is also true if you add in specular ...
Alan Wolfe's user avatar
  • 7,801
9 votes
Accepted

Tweaking a glow shader to make it look better

Sigma and kernel size of Gaussian filter Regarding how to choose the sigma and the kernel size (pixels) of the Gaussian: you set the sigma based on how wide of a blur you want (judging it visually) ...
Nathan Reed's user avatar
9 votes
Accepted

Physically Based Area Lights

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 ...
JarkkoL's user avatar
  • 3,636
9 votes
Accepted

Modern way of light sources in OpenGL?

Why are they deprecated? Those functions are deprecated because the OpenGL API moved in favor of a programmable pipeline in contrast with the old fixed pipeline. The programmable pipeline allows the ...
Samu's user avatar
  • 546
7 votes
Accepted

Alternatives to Ambient Occlusion

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 ...
Quinchilion's user avatar
7 votes
Accepted

Unlit objects in deferred rendering

Typically in a deferred engine, you would render unlit objects directly to the color buffer, bypassing the lighting system entirely. You would likely also output zeroes to the G-buffer so that ...
Nathan Reed's user avatar
7 votes
Accepted

Bloom in DirectX

This effect is called light bloom. Its algorithm is usually a variation of the following: Render your scene (preferably in high dynamic range) to texture. Make a thresholding pass to another texture. ...
IneQuation's user avatar
7 votes
Accepted

Refraction in a Ray Tracer: What do with an intersection within the medium?

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 ...
user18490's user avatar
  • 656
7 votes
Accepted

Confused about prefiltering environment maps (Manson 16)

Your first quote is referring to "Split-sum approximation" presented in "Real Shading in Unreal Engine 4" by Brian Karis, and also referred in the paper [Kar13]: $$\frac{1}{N}\sum_{k=1}^N \frac{L_i(...
JarkkoL's user avatar
  • 3,636
7 votes
Accepted

Ambient Lighting

Correct is the OpenGL way. If you had a white light ( let's say vec3(255,255,255) ) and just simply added it to a blue object ( vec3(0,0,255) ), the object would seem to be white, which is wrong. But ...
Michal Kučera's user avatar
7 votes
Accepted

Experimental real-time shadowing techniques?

There’s an interesting technique that’s been used in demoscene and Shadertoy projects for a while, and an analogue of which recently made it into Unreal Engine 4: using signed-distance fields and ...
Noah Witherspoon's user avatar
7 votes
Accepted

Roughness Value of (Close to) Zero in Physically Based Rendering

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 ...
Nathan Reed's user avatar
6 votes
Accepted

Path tracer not rendering shadows

The problem appears to be unintentionally transparent surfaces Although the image is grainy, it is sufficiently clear to estimate that all of the darker regions are due to surfaces facing away from ...
trichoplax is on Codidact now's user avatar
6 votes

What are Spherical Harmonics & Light Probes?

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 ...
Alan Wolfe's user avatar
  • 7,801
6 votes
Accepted

What are some new Real-Time Graphics Rendering Techniques to get closer to real life?

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 ...
JarkkoL's user avatar
  • 3,636
6 votes
Accepted

Path Tracing With Multiple Lights

It's not that hard. If you have just planar or angular light sources, you can think of them as one light source split into multiple chunks and the only thing to deal with is how to sample this multi-...
ivokabel's user avatar
  • 1,464
6 votes

What's the concept of "Ray" really?

A ray is just a semi-infinite line, and casting the ray finds intersections between the ray and an object in the scene. It doesn't just tell you the position in space that the ray intersected the ...
Dan Hulme's user avatar
  • 6,810
6 votes
Accepted

Irradiance Map Equation What is "dω"?

$E_n$ is illuminance (or irradiance), $L_i$ is luminance (or radiance) in direction $\omega_i$ and $d\omega$ is differential solid angle. TL;DR: $d\omega_i$ is the area of a pixel in the cubemap ...
JarkkoL's user avatar
  • 3,636
6 votes

What is missing in this image that stops it from looking like a photograph?

The hair seems to have sampling noise or aliasing in it. This might be poor jpeg compression but it does not look like it. I've never seen hair part that way (could just be me). The neck looks a ...
Olivier's user avatar
  • 1,585

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