Questions tagged [sampling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
16 votes
3 answers
3k views

Importance Sampling of Environment Maps

What is the best currently known and ideally also production-verified approach for sampling environment maps (EM) in a MIS-based uni-directional path tracer and similar types of renderers? I would ...
ivokabel's user avatar
  • 1,454
13 votes
1 answer
7k views

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

When converting from uniform hemisphere sampling to cosine weighted hemisphere sampling I am confused by a statement in an article. My current indirect contribution is calculated as: ...
Steven's user avatar
  • 315
12 votes
2 answers
1k views

What is the fundamental reasoning for anti aliasing using multiple random samples within a pixel?

In graphics, it's common to take multiple samples within the bounds of a pixel and combine them together (most commonly just doing an average) for a final sample pixel color. This has the effect of ...
Alan Wolfe's user avatar
  • 7,791
12 votes
1 answer
1k views

What is the difference between importance sampling and mutiple importance sampling?

I can't understand math equations. I'm a graphic designer. What is "importance sampling"? What is "multiple importance sampling"? Could you explain easily, using illustrations and no math equations? ...
kangsume's user avatar
  • 121
10 votes
3 answers
783 views

What is the optimal radius of gaussian distribution for determining pixel colour?

Using a gaussian distribution of points on an image plane to calculate a pixel value, what radius/standard deviation will give the most information in the final image? Too large a radius gives a ...
trichoplax is on Codidact now's user avatar
9 votes
2 answers
3k views

Mitchell's Best Candidate Algorithm

I'm trying to generate an image where black dots are arranged in a blue noise distribution on a white background. I know that there are other ways to do this, one of the best being "Fast Capacity ...
Alan Wolfe's user avatar
  • 7,791
9 votes
1 answer
1k views

Link between blue noise sampling and blue noise textures?

You can have blue noise sampling like these poisson disc samples: And you can have a blue noise texture like this: I get that in the first image, there is one input (the index of the sample) and two ...
Alan Wolfe's user avatar
  • 7,791
8 votes
2 answers
1k views

Why random monte carlo sampling instead of uniform sampling?

Why is it that it's so common to use monte carlo randomized sample locations, instead of uniform sampling? I'm assuming that taking randomized samples gives some benefit but I don't know what they ...
Alan Wolfe's user avatar
  • 7,791
8 votes
1 answer
1k views

Path Tracing With Multiple Lights

I've got my path tracer working great for a single light, but I'm having trouble coming up with a solution for scenes with multiple lights. My first thought was to just send a ray to each light and ...
Henry Bergin's user avatar
7 votes
1 answer
193 views

2D sampling with multidimensional transformations

I'm currently learning mathemetical concepts of distribution and the way to use them in a ray tracer with the book "Physically Based Rendering". Let's start by uniformly sampling an hemisphere: As ...
Qzaac's user avatar
  • 73
7 votes
1 answer
707 views

Speeding up convergence: am I reinventing the wheel?

I'm trying to learn about raytracing by implementing things in Python 3. I know this is always going to be slower than something like C++, and I know the speed could also be improved by using GPU ...
trichoplax is on Codidact now's user avatar
6 votes
1 answer
199 views

Does MRG32k3a compare well with PCG and Xorshift256*?

I've been using standard 32-bit Xorshift in my GPU path-tracer for a while, following Nathan Reed's approach with hashed seeds and decorrelated state. I (finally) discovered today that Xorshift is ...
Paul Ferris's user avatar
6 votes
1 answer
363 views

How to sample 3D points to visualize a B-spline surface?

Given that I have implemented a function called calc_bspline_surf() in C, and that function has the following declaration: ...
xyz's user avatar
  • 161
5 votes
0 answers
513 views

Where do "fireflies" come from?

I'm using a renderer developed by other people, and I found there are fireflies. It is strange that in a completely diffuse scene, there are still fireflies presented. To my understanding, I think it ...
AccM's user avatar
  • 61
4 votes
2 answers
1k views

What does texture resolve mean?

In the context of render targets or textures, what does "resolve" mean? For example: To resolve a color texture. From my understanding, it seems to mean, "copy but process/convert at the same time", ...
Todd's user avatar
  • 143
4 votes
1 answer
495 views

High variance in path tracing specular objects

I'm testing my path tracer for specular surfaces. Images rendered with my own code have very noisy appearance, and I think they look like variance. I use point light and the bunny is of mirror ...
jinglei's user avatar
  • 293
4 votes
2 answers
876 views

Why map Hammersley 2D set's (u,v) to sphere's (θ, φ) coordinates (and not to (φ, θ) )?

As explained in Holger Dammetz page Hammersley Points on the Hemisphere, the 2D coordinates (u,v) are usually mapped to the spherical coordinates (θ, φ). As a result, the coordinate "uniformly ...
wip's user avatar
  • 1,851
4 votes
1 answer
522 views

Jitter texture generation

I am currently reading the awesome paper by Jorge Jimenez about Character rendering : Next Generation Character Rendering In the part about multi-sampled transmittance he uses some Poisson offsets ...
MaT's user avatar
  • 1,229
4 votes
1 answer
1k views

PDF when sampling from Rectangular Area Lights

So I was reading up on how to sample Rectangular Area lights, and the procedure is pretty straightforward. That is, I can get random points using the equation. $ p = X_o + \epsilon_1V_1 + \...
gallickgunner's user avatar
4 votes
1 answer
412 views

How do I make sure my cosine-weighted sampling works fine?

I'm working on a pathtracer and while it's working mostly fine, I'm getting different outputs with cosine-weighted sampling and uniform sampling : Uniform sampling is on the left, cosine-weighted is ...
Octave's user avatar
  • 41
4 votes
1 answer
767 views

About the use of Russian Roulette in Smallpt

I was taking a look at Smallpt (http://www.kevinbeason.com/smallpt), more specifically at the Russian Roulette part. Actually, RR is used in two places along the code: first, to determine ray ...
user avatar
4 votes
0 answers
700 views

Proper way of consuming stratified samples in path/ray tracing

I'm working on a (toy-level) path/ray-tracer, currently trying to implement (and understand) improved sampling strategies. The obvious next choice after uniform random sampling would be stratified/...
flipflop's user avatar
3 votes
2 answers
683 views

Making low discrepancy sequence noise textures, not LDS sample positions

When making sampling locations, there is a lot of information out there on how to do white noise sampling, uniform sampling, uniform+jittered sampling, low discrepancy sequence sampling (eg halton) ...
Alan Wolfe's user avatar
  • 7,791
3 votes
1 answer
836 views

Analytical derivative of a 3D Simplex Noise field

I am using Simplex Noise to generate a 3D field. The specific implementation is FastNoise-SIMD. Assume I want to have a gradient (or derivative) for a sample at Sx, Sy, Sz in that field. Do I ...
Bram's user avatar
  • 260
3 votes
1 answer
288 views

Path Tracer - sampling dimensions confusion

Suppose my path tracer is shooting 64 rays per pixel (in an 8x8 grid). The confusion is, when accounting for Global illumination, should I shoot additional X number ...
gallickgunner's user avatar
3 votes
1 answer
442 views

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

I am attempting to visualize the raw output from PBRT's half-vector sampling function, based on the trowbridge-reitz distribution. I'm isolating only the distribution and the associated functions ...
Steve's user avatar
  • 73
3 votes
2 answers
239 views

Downscaling by skipping rows and columns – any example images?

I'm about to implement downscaling on a microcontroller. Source resolution is e.g. 720x576 (the 576i PAL resolution, other one possible: 480i, NTSC resolution), destination is 32x16. The goal is to ...
Gortu's user avatar
  • 33
3 votes
0 answers
42 views

Is this way of transforming QMC samples into barycentric tri coordinates agnostic to mesh-topology?

While I'll try my best to give all relevant info in all possible brevity below, please refer to the spoiler and link at the bottom of the post for the (more lengthy) original description if needed. ...
Herbert Jensch's user avatar
2 votes
3 answers
1k views

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

I have a mesh of an object enclosed in unit volume cube and I would like to sample points inside and outside the mesh surface. What are the different ways of doing it? Is there any sample code ...
akes's user avatar
  • 23
2 votes
1 answer
182 views

How can I resize a rendered ray traced image?

Say I have rendered an HDR ray traced image with dimensions 1920x1080 (width x height) pixels and I want to instead represent it with dimensions 960x540. Assume as well that the image has not yet been ...
Byte Lab's user avatar
  • 123
2 votes
1 answer
1k views

Importance sampling a cosine distribution

Let's take a look at this blog article - https://schuttejoe.github.io/post/ggximportancesamplingpart1/ and image presented as a result of implementing it: Inside above link, you can see description ...
DirectX_Programmer's user avatar
2 votes
1 answer
733 views

Naive Path tracer produces much darker images than Explicit light sampling

So I just thought of comparing the results from a Naive Path tracer and one using Next Event Estimation aka Explicit Direct Light Sampling. However the results from the Naive PT are very dark. Is ...
gallickgunner's user avatar
2 votes
1 answer
334 views

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

Suppose I can run some graphics in 1366x768 equally well as 1280x720, and I have a 1920x1080 monitor. There are more pixels in 1366x768 than in 1280x720. However, in 1280x720, a 2x2 grid of pixels ...
keej's user avatar
  • 123
2 votes
1 answer
234 views

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

I am learning ray tracing and the mathematics behind it. I have a working monte-carlo raytracer I am experimenting on. I have gotten past pure diffuse BRDFS, area lights, acceleration structures, ...
Steve's user avatar
  • 73
2 votes
1 answer
86 views

White spots when rendering diffuse material with environment light

I am trying to implement a simple shader. A round ball object is rendered with uniform albedo and I noticed some strange white spots on the outputs. I perform importance sampling with 512 light ...
Ivan's user avatar
  • 121
2 votes
1 answer
45 views

Algorithm for proper drawing of cosine function

I am working with the cosine function with a very large input, like cos(a* t), where t varies between ...
Sean's user avatar
  • 123
2 votes
1 answer
285 views

Path Integral Form with Path Tracing

The description is going to be long and detailed, thanks in advance for your patience! I am learning the path integral form of light transport equation(LTE) to be able to follow recent rendering ...
TH3CHARLie's user avatar
2 votes
1 answer
424 views

computing derivatives of sampled data

I am trying to calculate the derivatives of a sampled data set by following an example in this book. The data is a set of 2d quads(green area in below) and their vertices(4 each). The data is in the ...
ali's user avatar
  • 740
2 votes
1 answer
864 views

Downscaling texture via mipmap [DirectX 11]

I am implementing a post-processing effect in my DirectX 11 pet renderer. The post-processing pass is implemented by rendering a full-screen quad covered with texture containing original rendered ...
ivokabel's user avatar
  • 1,454
2 votes
0 answers
44 views

How to properly use scattering coefficient during volumetric path tracing?

The increased radiance during sampling is known by: $$ L_s = L_e + \sigma_s \int p(w, w')f_p(w, w')dw' $$ The latter part, which accounts for in-scattering radiance bears a $\sigma_s$ in it. The ...
Enigmatisms's user avatar
2 votes
1 answer
74 views

BTF Find Four Closest Sampling Directions

I am trying to use the techniques discussed in this paper to implement a BTF into PBRT. I am stuck on how to actually interpolate the weights of the four closest sampling directions. At the BTF, I ...
Dave's user avatar
  • 121
2 votes
0 answers
97 views

Quantify the variance of pixel measurements

Say $E_j$ is an estimator of the value $$I_j=\int f_j\:{\rm d}\lambda$$ of the $j$th pixel given by the path space integral of the corresponding measurement contribution function $f_j$. $f_j$ is of ...
0xbadf00d's user avatar
  • 203
2 votes
0 answers
161 views

Picking multiple light sources from a mixture densities

According to Peter Shirely paper, one pdf(probability density function) can be defined for the union of the light sources and pick only one using a random number from this density: $$p(x) = \alpha_1 ...
ali's user avatar
  • 740
2 votes
0 answers
833 views

How to properly implement Phong material and importance sample it in a path tracer?

I'm recently implementing Phong materials in my path tracer. My implementation of a randomly sampled Phong material works and looks fine. But it doesn't work well if the shininess(aka power) is too ...
Mary Chang's user avatar
1 vote
2 answers
203 views

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

I'm going through and optimizing some of my glsl code for a project, and have come across a scenario several times that I am not sure how best to optimize. In summary - Is it faster to sample a ...
Lucas Morgan's user avatar
1 vote
1 answer
327 views

Path tracing - cannot converge diffuse sampling + oversaturation

I'm in process of creating progressive path tracer using DX12 + DXR. I managed to create working raytracing code + pathtracing code with multiple bounces but I'm experiencing problems stated below (...
DirectX_Programmer's user avatar
1 vote
1 answer
518 views

Path tracer isn't converging

So I just completed a naive path tracer that uses explicit direct light sampling. Problem is the path tracer isn't converging. It's like a raytracer, showing a single image on each pass. More info on ...
gallickgunner's user avatar
1 vote
1 answer
97 views

Conditionally sample from texture in shader

I'm building a little 2D graphics library in Rust/WGPU as a means to learn graphics programming. I want to draw an outline around a shape and specify the outline's color. All of my shapes have a ...
junglie85's user avatar
  • 125
1 vote
1 answer
58 views

Confusion about the bias during Monte Carlo integration

I recently stumbled into this question: Say, for example, we are doing mean-free-path sampling (distance sampling) in a scattering medium and to keep it simple, let's only consider the single ...
Enigmatisms's user avatar
1 vote
1 answer
121 views

What is the "kernel" in learnopengl SSAO tutorial?

I am currently reading the SSAO tutorial on learnopengl. In it, there is a "kernel" that has the dimension of 64 and contains ...
Raildex's user avatar
  • 173