All Questions
264
questions
31
votes
2
answers
23k
views
What is the simplest way to compute principal curvature for a mesh triangle?
I have a mesh and in the region around each triangle, I want to compute an estimate of the principal curvature directions. I have never done this sort of thing before and Wikipedia does not help a lot....
18
votes
1
answer
9k
views
Progressive Path Tracing with Explicit Light Sampling
I understood the logic behind the importance sampling for the BRDF part. However, when it comes to sampling light sources explicitly, all becomes confusing. For example, if I have one point light ...
31
votes
2
answers
7k
views
Path tracing the Cook-Torrance BRDF
-- Sorry for the long post, but I prefer to do that way because "Devil is in the details." :)
I am writing a path tracer from the scratch and it is working nicely for perfectly diffuse (Lambertian) ...
22
votes
1
answer
3k
views
Why is this conditional in my fragment shader so slow?
I have set up some FPS-measuring code in WebGL (based on this SO answer) and have discovered some oddities with the performance of my fragment shader. The code just renders a single quad (or rather ...
37
votes
4
answers
2k
views
Are there common materials that aren't represented well by RGB?
In graphics we use RGB and other color spaces as an approximation to the full spectrum of light wavelengths. This evidently works pretty well in general, but are there any reasonably common objects/...
16
votes
1
answer
1k
views
Is a constant condition more costly than switching shaders?
In general, branching in shaders is not a good idea. But now I have a shader with a condition that is constant with respect to the entire draw call. So the branch that is executed is always the same ...
44
votes
2
answers
13k
views
What is Importance Sampling?
What is importance sampling? Every article I read about it mentions 'PDF' what is that as well?
From what I gather, importance sampling is a technique to only sample areas on a hemisphere that matter ...
28
votes
5
answers
12k
views
Does a sphere projected into 2D space always result in an ellipse?
My intuition has always been that when any sphere is projected into 2D space that the result will always mathematically be an ellipse (or a circle in degenerate cases).
In the past when I was ...
11
votes
2
answers
2k
views
Is using many texture maps bad for caching?
If I have many textures (say 5+ maps) bound to the same texture unit, does it work worse for cache than if I had only 2 or 3 textures?
9
votes
2
answers
5k
views
Why do GPUs divide clip space Z by W, for position?
Background:
I found that it is very easy to use a linear depth buffer, using only a slight modification to the canonical vertex transformation. The simplest method is found at the bottom of https://...
5
votes
2
answers
2k
views
Is it possible to store the plain buffer data in gltf files?
The GL Transmission Format comes along with a JSON styled main file which basicly describes the scene and binary files which contain the buffers.
I'm currently writing a WebGL library and I need to ...
3
votes
1
answer
706
views
Difference between transformation and projection? [closed]
We know that world coordinates $(x_w, y_w)$ transform to viewport coordinates $(x_v, y_v)$ which are the physical device coordinates. And during projection, any point $(x, y, z)$ projects to $(x, y)$ ...
1
vote
3
answers
2k
views
What is the use of homogenous divide?
This question perhaps has been asked and answered a thousand times, and yet I haven't found any that satisfy me. The reasons are often these:
1/ You need a 4 dimensional vector to work with 4x4 ...
43
votes
2
answers
48k
views
What is Ray Marching? Is Sphere Tracing the same thing?
A lot of ShaderToy demos share the Ray Marching algorithm to render the scene, but they are often written with a very compact style and i can't find any straightforward examples or explanation.
So ...
36
votes
2
answers
6k
views
How physically-based is the diffuse and specular distinction?
The classical way of shading surfaces in real-time computer graphics is a combination of a (Lambertian) diffuse term and a specular term, most likely Phong or Blinn-Phong.
Now with the trend going ...
34
votes
2
answers
13k
views
Why is the transposed inverse of the model view matrix used to transform the normal vectors?
When rendering 3D scenes with transformations applied to the objects, normals have to be transformed with the transposed inverse of the model view matrix. So, with a normal $n$, modelViewMatrix $M$, ...
27
votes
4
answers
8k
views
Why do T-junctions in meshes result in cracks?
I have heard from many sources that having T-junctions in 3D meshes is a bad idea because it could result in cracks during rendering. Can someone explain why that happens, and what one can do to avoid ...
26
votes
3
answers
10k
views
Is Russian Roulette really the answer?
I have seen that in some implementations of Path Tracing, an approach called Russian Roulette is used to cull some of the paths and share their contribution among the other paths.
I understand that ...
26
votes
1
answer
12k
views
What are Affine Transformations?
What are Affine Tranformations? Do they apply just to points or to other shapes as well? What does it mean that they can be "composed"?
18
votes
3
answers
6k
views
How can I debug what is being rendered to a Frame Buffer Object in OpenGL?
I have a point cloud that is being rendered to the screen. Each point has its position and color as well as an ID.
I was asked to render the IDs for each point to a texture so I created a FBO and ...
17
votes
2
answers
594
views
Is gamma still important to take into account?
Do different monitors (including mobile screens) still use significantly different gamma functions when displaying colour images? Is there a standardised way to represent colour that can then be ...
17
votes
1
answer
3k
views
why does black text have orange and blue pixels
Why is it that when you zoom in to some black text you find that it is made up of orange, slightly black and blue pixels like the picture below.
16
votes
1
answer
3k
views
Choosing Reflection or Refraction in Path Tracing
I am trying to implement refraction and transmission in my path tracer and I'm a bit unsure on how to implement it. First, some background:
When light hits a surface, a portion of it will reflect, ...
15
votes
1
answer
462
views
Is all grid based noise inevitably anisotropic?
I'm interested in how this applies to higher numbers of dimensions too, but for this question I will focus solely on 2D grids.
I know that Perlin noise is not isotropic (direction invariant), and ...
15
votes
4
answers
18k
views
How is Anti Aliasing Implemented in Ray Tracing?
After reading a few articles online I can confidently say I am clueless on how Anti-Aliasing works when using Ray Tracing.
All I understand is that A Single Pixel/Ray is split into 4 sub-pixels and 4 ...
13
votes
1
answer
5k
views
How does Texture Cache work considering multiple shader units
Modern GPUs have many parallel shading units. I'd like to know how texture cache is managed in that scenario.
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 ...
12
votes
1
answer
5k
views
Is doing multiple Gaussian blurs the same as doing one larger blur?
To make Gaussian blurring a 2d image faster, I know that you can do one axis and then the other.
I'm wondering though, if I did two Gaussian blurs of size $N$, would that be the same mathematically ...
11
votes
3
answers
3k
views
Why do Vertex Buffer Objects improve performance?
From my basic understanding, a Vertex Buffer Object works something like this (pseudo code):
Normally, if one wanted to say, draw a square, one could issue line drawing commands.
...
9
votes
2
answers
843
views
How to unproject quadrilateral into rectangle?
tl;dr: Math problem in projective geometry: How does one find some 4x4 camera matrix that gives a projection as illustrated below, such that points A,B,C,D are somewhere on the edges of the unit box (...
9
votes
1
answer
2k
views
Splitting of NURBS curves
Splitting Bezier curve into two parts at some parameter t is easy thanks to De Casteljau's algorithm.
Is there a similar algorithm for NURBS curves? How to split a ...
9
votes
1
answer
3k
views
Path weight for direct light sampling
I originally wrote a pathtracer that just bounces by the BRDF and each sample is added to a buffer that divides by the current number of frames.
Now I'd like to do next event estimation at each ...
8
votes
1
answer
1k
views
NURBS knot multiplicity
In Splitting of NURBS curves there the answer relied on "maximum knot multiplicity". In order not to mix-up different topics I would like to kindly ask to answer it in another question: what is this "...
8
votes
1
answer
5k
views
Perspective Correct Texture Mapping
So I'm trying to correctly map my textures in my software renderer using the u, v coordinates but I can't seem to get it working. I got affine texture mapping working. This is what I can produce using ...
7
votes
2
answers
2k
views
Is it expected that a naive path tracer takes many, many samples to converge?
I have a naive diffuse/emissive material path tracer implementation (pinhole camera) and am seeing it take a very large number of samples per pixel to converge - like probably in the millions - and ...
7
votes
1
answer
4k
views
How does voxel cone tracing work?
Assume that we have voxelized a 3D scene into a regular 3D grid of cubes, storing the average (diffuse) radiance and some flag indicating whether or not a voxel is empty. Next, the finer levels of the ...
6
votes
3
answers
6k
views
Mirror Reflections: Ray Tracing or Rasterisation?
Are mirror-like reflections in computer graphics purely handled with ray-tracing/ray-casting techniques or are there some situations where they are achieved through rasterisation?
5
votes
2
answers
4k
views
Refraction in a Ray Tracer: What do with an intersection within the medium?
I am currently following a tutorial at Scratchapixel.com on refraction
Here is the refract function:
...
5
votes
1
answer
2k
views
Draw angles lines in raster graphics using bresenham line algorithm
I at the moment trying to draw some angled lines using bresenham line algorithm which can circulate a 2d array of size 21x21, as a line angled from 0 - 2pi.
So the idea is that the program has to ...
5
votes
2
answers
3k
views
Multiple Importance Sampling in Path tracer produces Dark Images
So I recently implemented Multiple Importance Sampling in my path tracer which was based on next event estimation.
The problem is without MIS I get images like,
This is obtained by setting
...
4
votes
1
answer
676
views
What happened to my texture mapping?
Recently, I am writing a simple software rasterizer for self-studying and fun. But the texture mapping has problems. The texture I want to map is below:
But the final image of two triangles is ...
4
votes
2
answers
4k
views
How to encode/decode buffer data in glTF?
I'm playing around with base64 embedded data URI's and tried to analyze the buffer data of the gltf box sample model, as defined in this example here (line 76).
...
4
votes
1
answer
2k
views
Inverse value in a Perspective Matrix
I am a new leaner of computer graphics. I'm trying to understand a code I found online and I got stuck in the following formula:
...
3
votes
1
answer
2k
views
How to unproject cursor with orthographic projection
With perspective projection we can unproject screen space coordinates of the cursor to the near and far plane of the frustum and calculate the direction of the ray through the cursor.
...
2
votes
1
answer
15k
views
How to derive a perspective projection matrix from its components?
This has been haunting me for several days now. I want to find the component that makes up of this 4x4 perspective projection matrix, with $l$(left), $r$(right), $b$(bottom), $t$(top), $n$(near), $f$(...
2
votes
0
answers
163
views
Scaling of the final image in Metropolis Light Transport
I don't understand why the PBR implementation of Metorpolis Light Transport scales the final image by b / mutationsPerPixel.
The authors write:
Each Metropolis ...
1
vote
1
answer
2k
views
Building view transform matrices
For a 3D scene in the world coordinates, its View Reference Point $\mathrm{VRP}$ is at $(5,-2,1)$, and a viewer is looking towards point $A=(1,1,1)$. Construct a transform matrix which will map world ...
1
vote
2
answers
2k
views
How to calculate the RGB intensity values at center of face using flat shading?
Consider a triangular face of three vertices A(0,2,1), B(3,0,1) and the origin, and the normal vectors at the vertices are nA=(0,0,1), nB=(1,1,0) and nO=(-1,-1,1), respectively. The incident light is ...
1
vote
1
answer
363
views
Normal Artifacts On Grazing Angles
I am currently experiencing a very obvious artifact that occurs when looking at objects on very grazing angles
Here is a picture of the artifact:
I noticed that the issue was coming from my ...
0
votes
1
answer
4k
views
perspective projection transformation matrix
In one text, the derivation for perspective projection goes like this:
If $x',y',z'$ represent any point along the projection line,and $x_{prp},y_{prp},z_{prp}$ are the projection ...