All Questions

Filter by
Sorted by
Tagged with
11
votes
1answer
4k 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 ...
19
votes
1answer
2k 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 ...
14
votes
1answer
670 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 ...
25
votes
2answers
3k 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) ...
33
votes
4answers
1k 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/...
17
votes
2answers
11k 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....
10
votes
2answers
905 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?
34
votes
2answers
4k 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 ...
26
votes
2answers
16k 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 ...
22
votes
2answers
6k 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$, ...
21
votes
1answer
7k 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"?
13
votes
1answer
2k 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, ...
12
votes
2answers
612 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 ...
14
votes
1answer
321 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 ...
8
votes
2answers
909 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://...
8
votes
1answer
909 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 ...
5
votes
1answer
486 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: ...
16
votes
2answers
458 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 ...
12
votes
1answer
394 views

Why is it twice as expensive to make a noise function that can be tiled?

I've seen in several places that making Perlin noise loop seamlessly requires calculating it twice in slightly different ways, and summing the two results. This Perlin noise math FAQ gives a formula: ...
11
votes
3answers
7k views

How is Anti Aliasing Implemented in Ray Tracing?

After reading a few articles online I am can confidently say I am clueless on how Anti-Aliasing works when Ray Tracing. All I understand is that A Single Pixel/Ray is split into 4 sub-pixels and 4 ...
11
votes
1answer
3k 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.
10
votes
3answers
1k 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. ...
6
votes
1answer
575 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 ...
17
votes
3answers
3k 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 ...
7
votes
1answer
2k 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 ...
5
votes
2answers
592 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 ...
3
votes
1answer
196 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 ...
2
votes
3answers
263 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 ...
2
votes
1answer
672 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 ...
10
votes
2answers
459 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 (...
7
votes
1answer
637 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 "...
5
votes
1answer
1k 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 ...
3
votes
2answers
678 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 ...
1
vote
0answers
182 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 ...
1
vote
2answers
739 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 ...
30
votes
2answers
9k views

DirectX / OpenGL(Vulkan) concepts mapping chart

Often a similar hardware feature is exposed via DirectX and OpenGL using different terminology. For example: Constant Buffer / Uniform Buffer Object RWBuffer / SSBO I am looking for an exhaustive ...
41
votes
4answers
34k views

How is Gaussian Blur Implemented?

I've read that blur is done in real time graphics by doing it on one axis and then the other. I've done a bit of convolution in 1D in the past but I am not super comfortable with it, nor know what to ...
20
votes
3answers
5k 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 ...
16
votes
2answers
5k views

How to properly combine the diffuse and specular terms?

As far as I understand, in a BRDF the Fresnel term is telling us the probability for a photon to be reflected or refracted when it hits a surface. The reflected photons will contribute to the ...
29
votes
4answers
10k views

Sharing code between multiple GLSL shaders

I often find myself copy-pasting code between several shaders. This includes both certain computations or data shared between all shaders in a single pipeline, and common computations which all of my ...
20
votes
1answer
2k views

Anti-aliasing / Filtering in Ray Tracing

In ray tracing / path tracing, one of the simplest way to anti-alias the image is to supersample the pixel values and average the results. IE. instead of shooting every sample through the center of ...
18
votes
2answers
2k views

What is the “dipole approximation” for subsurface scattering?

If you read papers about subsurface scattering, you'll frequently come across references to something called the "dipole approximation". This term seems to go back to the paper A Practical Model for ...
11
votes
2answers
5k views

OpenGL - Detection of edges

I'd like to load arbitrary meshes and draw thick black lines along the edges to get a toon-shading like look. I managed to draw a black silhouette around the objects by using the stencil buffer. You ...
38
votes
6answers
23k views

How can I debug GLSL shaders?

When writing non-trivial shaders (just as when writing any other piece of non-trivial code), people make mistakes.[citation needed] However, I can't just debug it like any other code - you can't just ...
23
votes
3answers
7k views

What is a stencil buffer?

Wikipedia states that a stencil buffer is some arbitrary buffer a shader can use. However, it hints that it's used for clipping, or otherwise "tightly binding" the depth and pixel buffers, slightly ...
15
votes
1answer
2k views

How can I generate procedural noise on a sphere?

I would like to generate procedural noise on the surface of a sphere (e.g. to procedurally generate planets or marble-textured balls). Of course, I could just take a standard noise algorithm and map ...
14
votes
6answers
546 views

How to produce simple 2D illustrations to accompany geometry answers?

In my answer about Affine Transformations I made some little illustrations to help the explanation. How do you make an upload-able PNG quickly which expresses a geometrical or mathematical idea? ...
13
votes
3answers
2k views

Correct Specular Term of the Cook-Torrance / Torrance-Sparrow Model

For a while I have been doing some research on the topic of Physically Based Rendering. One reflection model that is mentioned over and over is the Cook-Torrance / Torrance-Sparrow model. It seems ...
8
votes
2answers
778 views

Path Tracing & Materials

I'm wondering about the technique used when sampling a layered material for the next event in a path tracer. I have a material with three layers: a base diffuse, specular and sheen lobes. How does one ...
21
votes
1answer
2k views

Why does my Perlin Noise look “blocky”?

I tried to implement Perlin Noise by myself using just the theory (following flafla2.github.io/2014/08/09/perlinnoise.html). Unfortunately I was unable to achieve the look of the "original" Perlin ...

15 30 50 per page