All Questions

Filter by
Sorted by
Tagged with
32 votes
2 answers
25k 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....
ap_'s user avatar
  • 2,214
18 votes
1 answer
10k 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 ...
Mustafa Işık's user avatar
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) ...
user avatar
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 ...
Martin Ender's user avatar
  • 2,730
38 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/...
trichoplax is on Codidact now's user avatar
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 ...
nikitablack's user avatar
44 votes
2 answers
14k 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 ...
Arjan Singh's user avatar
  • 2,511
28 votes
5 answers
13k 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 ...
hippietrail's user avatar
12 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?
Felipe Lira's user avatar
  • 1,246
10 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://...
Jessy's user avatar
  • 203
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 basically describes the scene and binary files which contain the buffers. I'm currently writing a WebGL library and I need to ...
q9f's user avatar
  • 703
3 votes
1 answer
961 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)$ ...
user avatar
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 ...
Manh Nguyen Huu's user avatar
43 votes
2 answers
49k 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 ...
psicomante's user avatar
36 votes
2 answers
7k 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 ...
David Kuri's user avatar
  • 2,293
35 votes
2 answers
14k 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$, ...
Nero's user avatar
  • 1,330
27 votes
4 answers
9k 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 ...
ap_'s user avatar
  • 2,214
26 votes
3 answers
11k 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 ...
trichoplax is on Codidact now's user avatar
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"?
luser droog's user avatar
  • 1,378
18 votes
3 answers
7k 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 ...
BRabbit27's user avatar
  • 969
17 votes
2 answers
610 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 ...
trichoplax is on Codidact now's user avatar
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.
HEGX64's user avatar
  • 273
16 votes
1 answer
4k 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, ...
RichieSams's user avatar
  • 3,792
15 votes
4 answers
19k 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 ...
Arjan Singh's user avatar
  • 2,511
15 votes
1 answer
501 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 ...
trichoplax is on Codidact now's user avatar
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.
Felipe Lira's user avatar
  • 1,246
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,801
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 ...
Alan Wolfe's user avatar
  • 7,801
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. ...
Ethan Bierlein's user avatar
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 ...
newtorendering's user avatar
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 ...
Ecir Hana's user avatar
  • 1,459
9 votes
2 answers
906 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 (...
ninjagecko's user avatar
8 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 ...
Alan Wolfe's user avatar
  • 7,801
8 votes
1 answer
2k 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 "...
Ecir Hana's user avatar
  • 1,459
8 votes
1 answer
6k 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 ...
Andrew Wilson's user avatar
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 ...
Matthias's user avatar
  • 1,084
6 votes
3 answers
7k 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?
Will D's user avatar
  • 115
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: ...
Arjan Singh's user avatar
  • 2,511
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 ...
gallickgunner's user avatar
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 ...
Bob Burt's user avatar
  • 183
4 votes
1 answer
707 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 ...
alexunder's user avatar
  • 141
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: ...
BossShell's user avatar
  • 143
4 votes
1 answer
3k views

Deriving radiance from irradiance and intensity

I'm reading PBRT and am stuck in chapter 5.4 about radiometry. In particular: We define the irradiance as the average density flux arriving at a surface with units $\frac{W}{m^2}$. So for a point ...
lyinch's user avatar
  • 223
4 votes
2 answers
5k 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). ...
q9f's user avatar
  • 703
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. ...
Lenny White's user avatar
2 votes
1 answer
16k 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$(...
Manh Nguyen Huu's user avatar
2 votes
0 answers
164 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 ...
0xbadf00d's user avatar
  • 203
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 ...
S.A's user avatar
  • 317
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 ...
S.A's user avatar
  • 317
1 vote
1 answer
419 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 ...
Brady Jessup's user avatar

15 30 50 per page
1
2 3 4 5 6