5 Apr 20, 6 tweets, 3 min read
A mini Importance Sampling adventure: imagine a signal that we need to integrate (sum it's samples) over its domain. It could for example be an environment map convolution for diffuse lighting (1/6).
Capturing and processing many samples is expensive so we often randomly select a few and sum these only. If we uniformly (with same probability) select which samples to use though we risk missing important features in the signal, eg areas with large radiance (2/6).
If the signal are non negative (like an image), we can normalise its values (divide by the sum of all values) and treat it as a probability density function (pdf). Using this, we can calculate the cumulative distribution function (CDF) (3/6).
The value of a CDF at position X is the sum of the pdf values up to that point. The CDF has some nice properties, it is always increasing up to a max of 1. Also big changes in the original signal appear as steep slopes, while slow/small changing areas are flatter (4/6).
This means that if we uniformly select random Y values on the vertical axis and project them horizontally (X axis) til they meet the curve, larger features in the signal will receive more samples, while small ones, where the CDF curve is flatter, will receive less (5/6).
Finally, if we use those X positions to sample the original signal, most samples will fall on the large features of the signal, and won't be wasted, allowing us to represent the original signal better. (6/6).

• • •

Missing some Tweet in this thread? You can try to force a refresh

This Thread may be Removed Anytime!

Twitter may remove this content at anytime! Save it as PDF for later use!

# More from @KostasAAA

1 May
In graphics programming we use a lot of awesome sounding names for techniques, which often trigger fantastic mental imagery (as well as actual imagery). Too many to list them all, the top 3 of my favourite ones, in no particular order, probably are: (1/4)
1) "Ambient occlusion": the percentage of rays cast from a point over the hemisphere centred around the surface normal that are not occluded (do not collide with) by geometry. A value of 0 means all rays collide, 1 means none does. (2/4)
2) "Shadow pancaking": project shadowcasting meshes that lie in front of the near plane of a light (and would normally get culled), on the near plane so that they will still cast shadows. Used to enable tightening of the shadow projection volume to increase the resolution. (3/4)
4 Oct 20
During my years in graphics there have been many great conference presentations but also a few that I found "eye opening" and changed the way I think about and approach gfx programming. My top 3, in no particular order, probably are (1/4):
"Uncharted2: HDR Lighting" from GDC 2010, slideshare.net/ozlael/hable-j… by @FilmicWorlds, great introduction to linear lighting and its importance in graphics (2/4)
"Physically Based Shading" from Siggraph 2010, renderwonk.com/publications/s… by @renderwonk, the seminal introduction to physically based rendering (3/4)
29 Aug 20
People starting to learn graphics techniques and a graphics API to implement them may find the whole process intimidating. In such a case there is the option to use a rendering framework that hides the API complexity, and handles asset and resource management. (1/4)
There are quite a few frameworks out there, for example:

The Forge: github.com/ConfettiFX/The…
Falcor: github.com/NVIDIAGameWork…
Cauldron: github.com/GPUOpen-Librar… (2/4)
Some are closer to the API, some hide it completely. They still offer the opportunity to learn about asset loading, shaders, render states, render targets etc at a more granular level than a full blown engine while allowing the user to focus on the gfx tech implementation (3/4).
18 Aug 20
Great question from DMs: "How bad are small triangles really"? Let me count the ways:

1) When a triangle goes pixel size it may miss the pixel centre and not get rasterised at all, wasting all the work done during vertex shading docs.microsoft.com/en-us/windows/… (1/6)