Skip to main content
12 votes
Accepted

Does cosine weighted hemisphere sampling still require NdotL when calculating contribution for indirect light?

You always need to multiply by the cosine term indeed (that's part of the rendering equation). Though when you do indirect diffuse using ray-tracing and thus monte-carol integration (which is the most ...
user18490's user avatar
  • 656
6 votes

Making low discrepancy sequence noise textures, not LDS sample positions

In theory, it is possible to stuff every sample distribution into a texture to "pre-bake" it for fast access. The question is whether any of the results might be useful. For blue noise, this makes a ...
DrivenByNostalgia's user avatar
6 votes
Accepted

Mitchell's Best Candidate Algorithm

The problem turned out to be that you don't do the same number of candidates per point, but that if you have $n$ points already, you should generate $m*n$ candidates for the next point. $m$ is a ...
Alan Wolfe's user avatar
  • 7,811
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,474
5 votes

High variance in path tracing specular objects

If your bunny is purely specular, then sampling the light directly at the shade point would give no contribution since the specular BSDF is a delta BSDF. It generally evaluates to zero for any ...
sriravic's user avatar
  • 136
5 votes
Accepted

2D sampling with multidimensional transformations

I'm not sure I've correctly understood the question, but here goes. You're trying to sample directions uniformly, so you've got $p(\omega)$, which is the probability of getting a particular direction....
Dan Hulme's user avatar
  • 6,880
4 votes
Accepted

Link between blue noise sampling and blue noise textures?

The missing link between sample locations and the greyscale noise texture is "ordered dithering". Ordered dithering is a list of pixel locations with a "rank" (order) for each pixel. If you have a ...
Alan Wolfe's user avatar
  • 7,811
4 votes
Accepted

How to Sample 3D Points Outside and Inside the Mesh Surface

What you want is something that can perform the inside-outside test for meshes. The simplest solution would be to use Trimesh's implementation which can be ran with Embree to accelerate ray queries. I ...
Hubble's user avatar
  • 344
4 votes

How to Sample 3D Points Outside and Inside the Mesh Surface

I have a few suggestions: Partition the volume by using tetrahedra within the mesh, and outside of it (in the cube). Set the probability to sample each tetrahedron to its volume divided by the inside/...
lightxbulb's user avatar
  • 2,561
4 votes
Accepted

Path tracing - cannot converge diffuse sampling + oversaturation

One point: the Lambert BRDF is not $N\cdot L$, it's just the albedo divided by pi. The $N \cdot L$ factor comes from the $\cos \theta$ in the rendering equation. So, when sampling with a cosine-...
Nathan Reed's user avatar
  • 25.3k
4 votes
Accepted

Importance sampling a cosine distribution

You can sample using absolutely any distribution you want, as long as you weight the results by dividing by the pdf of the sampled distribution. It will converge to the right answer (as long as the ...
Nathan Reed's user avatar
  • 25.3k
3 votes

Does MRG32k3a compare well with PCG and Xorshift256*?

Short answer is yes. MRG32k3a has withstood the test of time, much more than PCG or XorShift256*. In fact, a recent paper by Matsumoto (creator of Mersenne-Twister) shows some poor properties of ...
jherek's user avatar
  • 131
3 votes
Accepted

What does texture resolve mean?

I don't know about other contexts, but for DirectX resolving a texture means blending multi-sampled texture into a non-multisampled one. For simple scenarios this is usually done automatically by the ...
ivokabel's user avatar
  • 1,474
3 votes
Accepted

What's more optimal - sampling one channel at a time or all channels at once?

It should be significantly faster to sample one RGBA value from one location in a texture than four R values from different locations in the texture.
Noah Witherspoon's user avatar
3 votes
Accepted

Analytical derivative of a 3D Simplex Noise field

I have published it, in several versions, and it's not difficult to do it. Simplex noise is a lot easier to differentiate because it's a sum of polynomials, rather than a nested polynomial ...
Stefan Gustavson's user avatar
3 votes
Accepted

Naive Path tracer produces much darker images than Explicit light sampling

It looks like you're clamping all your samples to 0-1 in line 215. Apply clamping only when displaying the image, not when accumulating samples.
Stefan Werner's user avatar
3 votes
Accepted

Upscaling 720p to 1080p vs upscaling 768p to 1080p

With a good-quality upscaling filter (bicubic, for example), there's no particular importance to the 3:2 ratio. Starting from a higher-resolution source will produce a better-looking final image. It'...
Nathan Reed's user avatar
  • 25.3k
3 votes

Mitchell's Best Candidate Algorithm

Another very simple, easy to implement, algorithm to generate a Poisson-disk/blue noise point distribution is the following one [ 1 ]: Decide a radius r, and therefore the expected number N of ...
ALoopingIcon's user avatar
3 votes
Accepted

Path Tracer - sampling dimensions confusion

Only one path per sample. If you had 64 bounces per first hit and 64 per second hit and so forth you'd never get an image. Edit: And that's why you need to sample each pixel so many times (easily ...
beyond's user avatar
  • 315
3 votes
Accepted

Troubleshoot half vector sampling from a distribution (cook-torrence, trowbridge-reitz, etc)

The general idea for sampling half vector based distributions is that you generate $H$ and then compute $w_i$ by reflecting $w_o$ about $H$. This is so $H$ will be the half vector of your $w_i$ and $...
Olivier's user avatar
  • 1,585
3 votes
Accepted

Path tracer isn't converging

I can find two possible reasons for the image not converging. #1. Every sample is the same For every sample, you generate random rays. You do that when you shoot the ray through a pixel (for anti-...
bram0101's user avatar
  • 1,615
3 votes

What's more optimal - sampling one channel at a time or all channels at once?

I fully agree with all other replies and comments that rgba is definitely faster as it reduces the number of fetches from 16 to 4. You can even omit the per-element ...
Isolin's user avatar
  • 448
3 votes
Accepted

Measure (or Jacobian) conversion for direction sampling

If your map $\omega:[0,2\pi) \times [0,\pi] \to \mathbb{S}^2\subset \mathbb{R}^3$ is the standard spherical coordinates map: $$\omega = (\cos\phi \sin\theta, \sin\phi \sin\theta, \cos\theta),$$ then ...
lightxbulb's user avatar
  • 2,561
3 votes
Accepted

Lots of bad samples (below the hemisphere) when sampling the GGX VNDF

After some discusson with Enigmatisms, it turns out that: I had an error in my renderer Bad samples are expected from VNDF sampling. The error in my renderer I'm using VNDF sampling to sample a ...
Tom Clabault's user avatar
2 votes
Accepted

PDF when sampling from Rectangular Area Lights

The correct PDF for an area light is indeed $1/A$. The reason why you see the area term at the top is because you are importance sampling the light, meaning you need to divide by its PDF. This is a ...
Hubble's user avatar
  • 344
2 votes

Bilinear Interpolation

I think the formula at the top only makes sense if $n$ and $m$ are pixel indices, i.e. row and column numbers from 0 to $H - 1$ and 0 to $W - 1$. This way, for the four surrounding pixels, the weight ...
Dan Hulme's user avatar
  • 6,880
2 votes

Acceleration techniques for CPU soft-shadow calculation in light mapper

You could try to optimize the calculation by first casting a smaller number of "feeler rays" (say 32) to check for penumbra, and cast the remaining rays if the result is in penumbra according to the ...
JarkkoL's user avatar
  • 3,686
2 votes

Visualize the output of a Trowbridge-Reitz Half Vector Sampling Function

So for anyone who was interested - after studying the source material by Walter, I became convinced the error had to be in the rotation of the slopes back into "normal shading space". PBRT does this ...
Steve's user avatar
  • 73
2 votes

What does texture resolve mean?

Perhaps some example usage from graphics papers might be helpful - it basically refers to computing a 'pixel' value potentially from multiple fragments... RealityEngine Graphics (Akeley. 1993) ...
Simon F's user avatar
  • 4,336
2 votes
Accepted

How does the GPU know whether to magnify/minify?

Minification vs magnification is an extension of mipmap selection. When you calculate the desired mip level, it can come out to be less than 0 (or in general, less than the sampler's configured ...
Nathan Reed's user avatar
  • 25.3k

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