All Questions

Filter by
Sorted by
Tagged with
72 votes
6 answers
53k 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 ...
Martin Ender's user avatar
  • 2,730
67 votes
10 answers
48k views

Should new graphics programmers be learning Vulkan instead of OpenGL? [closed]

From the wiki: "the Vulkan API was initially referred to as the 'next generation OpenGL initiative' by Khrono", and that it is "a grounds-up redesign effort to unify OpenGL and OpenGL ES into one ...
galois's user avatar
  • 905
63 votes
3 answers
37k views

When is a compute shader more efficient than a pixel shader for image filtering?

Image filtering operations such as blurs, SSAO, bloom and so forth are usually done using pixel shaders and "gather" operations, where each pixel shader invocation issues a number of texture fetches ...
Nathan Reed's user avatar
  • 25.2k
56 votes
5 answers
40k views

Albedo vs Diffuse

Every time I think I understand the relationship between the two terms, I get more information that confuses me. I thought they were synonymous, but now I'm not sure. What is the difference between "...
hmind's user avatar
  • 663
54 votes
5 answers
27k views

Sharp Corners with Signed Distance Fields Fonts

Signed Distance Fields (SDFs) was presented as a fast solution to achieve resolution independent font rendering by Valve in this paper. I already have the Valve solution working but I'd like to ...
Felipe Lira's user avatar
  • 1,246
52 votes
5 answers
78k 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 ...
Alan Wolfe's user avatar
  • 7,801
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,521
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
41 votes
2 answers
24k views

How can virtual texturing actually be efficient?

For reference, what I'm referring to is the "generic name" for the technique first(I believe) introduced with idTech 5's MegaTexture technology. See the video here for a quick glance on how it works. ...
Llamageddon's user avatar
40 votes
3 answers
21k 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 ...
Qix - MONICA WAS MISTREATED's user avatar
40 votes
4 answers
24k 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 ...
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
37 votes
2 answers
14k views

What is the cost of changing state?

Programmers are supposed to have a fairly good idea of the cost of certain operations: for example the cost of an instruction on CPU, the cost of a L1, L2, or L3 cache miss, the cost of a LHS. When ...
Julien Guertault's user avatar
36 votes
2 answers
19k 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 ...
wip's user avatar
  • 1,871
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
36 votes
3 answers
15k views

Why does monte carlo ray tracing perform better than distributed ray tracing?

I've heard that the quality of a monte carlo ray tracer (based on path tracing algorithms) is much more realistic than a distributed (stochastic) engine. I try to understand why, but I'm just at the ...
p2or's user avatar
  • 596
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
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,224
32 votes
1 answer
4k views

Does the original Perlin noise ever have any advantage over Simplex noise?

Perlin noise is one of the most popular procedural noise functions. Perlin later developed Simplex noise which improves on some of the shortcomings of Perlin noise, notably its inefficiency in higher ...
Martin Ender's user avatar
  • 2,730
32 votes
3 answers
7k views

Avoiding z-fighting with coincident surfaces

When rendering two overlapping co-planar surfaces, a common issue is "z-fighting", where the renderer can't decide which of the two surfaces is closer to the camera, giving visual artifacts in the ...
Mark's user avatar
  • 1,622
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
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
28 votes
2 answers
20k views

What is fwidth and how does it work?

The OpenGL documentation states that fwidth returns the sum of the absolute value of derivatives in x and y. What does this mean in less mathematical terms, and is ...
ApoorvaJ's user avatar
  • 597
27 votes
2 answers
45k views

GLSL. Can someone explain why gl_FragCoord.xy / screenSize is performed and for what reason?

I'm new to shaders and know that you can color pixels with gl_FragColor but sometimes there is this thing: ...
idchlife's user avatar
  • 373
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,224
27 votes
2 answers
12k views

How is a light probe different than an environmental cube map?

Looking at a light probe texture, it looks like a blurry environment map. What's the difference between the two, how is a light probe made, and what is the benefit of it being blurry?
Alan Wolfe's user avatar
  • 7,801
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
11k views

What does "st" mean in the context of OpenGL?

I've seen the term st come up a few times when looking at other OpenGL fragment shaders. However, I don't know what it stands for or what it's used for. Here's an ...
Edward Loveall'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
25 votes
5 answers
29k views

Why are quads used in filmmaking and triangle in gaming?

In film school, in the classes of 3D modeling, I was told that when we model something for films we maintain topology of 4 edged polygons. Any polygon which has more or less than 4 edge/vertex is ...
Santosh Kumar's user avatar
25 votes
1 answer
4k 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 ...
RichieSams's user avatar
  • 3,792
25 votes
1 answer
962 views

Is my perspective math correct?

I've got a homework in which I have to calculate and plot some points using a pespective transformation, but I'm not sure my results are correct, since the 3d plot using Camera coordinates looks very ...
Vitor's user avatar
  • 353
24 votes
3 answers
27k views

What is the difference between radiance and irradiance in BRDF

Currently I am reading the BRDF section from Real Time Rendering and I am having a hard time to visually understand the definition of this function. BRDF is the ratio between the radiance in outgoing ...
kevinyu's user avatar
  • 493
24 votes
1 answer
24k views

World coordinates, Normalised device coordinates and device coordinates

Can I get to know the difference between the three? A good example would add up too.
Anish Sharma's user avatar
24 votes
1 answer
26k views

Get vector length with GLM

I am quite confused over how GLM library is behaving or I am using it improperly. glm::vec2 testVec(6,-4); float len = testVec.length(); I get the value ...
sajis997's user avatar
  • 1,279
23 votes
4 answers
26k views

What does GPU assembly look like?

I have played around with CPU assembly programming like Nasm, Tasm or Masm, but I'm really curious to know how GPU works now. However, i'm quite confused when I look on internet. I've heard about Cuda ...
sebastien finor's user avatar
23 votes
3 answers
1k views

Why is thread safety such a huge deal for Graphics APIs?

Both Vulkan and DirectX12 are claimed to be usable in a thread-safe manner. People seem to be excited about that. Why is this considered such a huge feature? The "real" processing gets thrown over ...
ratchet freak's user avatar
23 votes
2 answers
8k 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 ...
Julien Guertault's user avatar
22 votes
7 answers
5k views

How to raytrace Bezier surfaces?

I tried this question on math.SE and surprisingly, the answer was "the equations are too nasty, just feed the function it to a numerical root-finder". But if you consider yourself "a graphics guy" ...
luser droog's user avatar
  • 1,378
22 votes
3 answers
4k views

Performance of vector graphics versus bitmap or raster graphics

Sometimes I use vector graphics, simply because they look just slightly nicer in some cases, and other times, I use bitmap/raster graphics. I was wondering, are there any significant performance ...
Ethan Bierlein's user avatar
22 votes
1 answer
4k 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 ...
sarasvati's user avatar
  • 323
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
22 votes
2 answers
4k views

What is Illustrator's vector rasterization process?

I am currently trying to understand a few things about vector graphics rasterization and the different ways it is implemented in various application types. I tested and compared a few programs and ...
Gentle Moose's user avatar
21 votes
2 answers
800 views

How do correlated samples influence the behavior of a Monte Carlo renderer?

Most descriptions of Monte Carlo rendering methods, such as path tracing or bidirectional path tracing, assume that samples are generated independently; that is, a standard random number generator is ...
Benedikt Bitterli's user avatar
20 votes
3 answers
15k views

What are Spherical Harmonics & Light Probes?

What are Spherical Harmonics & Light Probes? How useful are they in computer graphics? What exactly do they do? I've heard the word spherical harmonics & Light Probes everywhere, from siggraph ...
Arjan Singh's user avatar
  • 2,521
20 votes
2 answers
17k views

What is Tessellation in computer graphics

In recent games I have noticed something called Tessellation, Turning the thing ON destroys my frame rate. I have noticed that it when turned on it looks like Anti - Aliasing. Can someone give me ...
Anarach's user avatar
  • 303
20 votes
2 answers
3k 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 ...
Nathan Reed's user avatar
  • 25.2k
19 votes
2 answers
21k views

Why are normal maps blue and purple in color?

I am learning about normal mapping. I understood that RGB values are converted into XYZ, but my question is how is it converted and why is the normal map blue and purple in color?
Abhinay Singh Negi's user avatar
19 votes
4 answers
4k views

How is VR different from a monitor

Apparently Macintosh computers cannot handle the Oculus Rift, because of their 'inferior' graphics cards. But should VR not just be like an external monitor? And concerning computer graphics, how are ...
Hans's user avatar
  • 293
19 votes
1 answer
9k views

What does "makeContextCurrent" do exactly?

I am pretty confused about that function. GLFW Context reference says as follow: This function makes the OpenGL or OpenGL ES context of the specified window current on the calling thread. A ...
Adrian's user avatar
  • 677

15 30 50 per page
1
2 3 4 5
83