All Questions

53
votes
8answers
27k views

Should new graphics programmers be learning Vulkan instead of OpenGL?

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 ...
46
votes
5answers
14k 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 ...
41
votes
4answers
28k 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 ...
37
votes
6answers
19k 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 ...
35
votes
4answers
17k 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 "...
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 ...
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/...
32
votes
3answers
11k 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 ...
31
votes
2answers
4k 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
2answers
8k 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 ...
28
votes
4answers
9k 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 ...
28
votes
1answer
1k 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 ...
27
votes
2answers
8k 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 ...
26
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) ...
26
votes
3answers
2k 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 ...
24
votes
2answers
12k 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 ...
24
votes
2answers
8k 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. ...
24
votes
1answer
731 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 ...
23
votes
3answers
6k 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 ...
22
votes
2answers
4k 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 ...
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
5answers
8k 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 ...
21
votes
3answers
576 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 ...
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 ...
21
votes
1answer
6k 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"?
21
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 ...
20
votes
3answers
2k 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 ...
19
votes
1answer
4k views

Why is recursion forbidden in OpenCL?

I'd like to use OpenCL to accelerate rendering of raytraced images, but I notice that the Wikipedia page claims that recursion is forbidden in Open CL. Is this true? As I make extensive use of ...
18
votes
5answers
5k views

Why do red, green, and blue make up all the colors?

Why do red, green, and blue combinations can make up all the visible colors?
18
votes
3answers
4k 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 ...
18
votes
4answers
3k 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 ...
18
votes
4answers
2k 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" ...
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 ...
18
votes
1answer
1k 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 ...
18
votes
2answers
1k 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 ...
18
votes
2answers
561 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 ...
18
votes
1answer
739 views

Data structures for tile-based (deferred) rendering

Tiled rendering is used in modern mobile GPU architectures to increase the coherency of memory access by subdividing image space into a regular grid of small (e.g., 32x32 pixel) tiles. Information is ...
17
votes
4answers
4k 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 ...
17
votes
2answers
7k 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 ...
17
votes
1answer
319 views

Why integrate over a hemisphere (and not a sphere) to solve the rendering equation?

In most text books that I have seen, this is how the rendering equation is written: $$L_0( \omega_0)= L_e(\omega_0)+\int_{\Omega}{f(\omega_i, \omega_0)L_i(\omega_i)\,\mathrm{d}\omega_i}$$ Where $\...
17
votes
2answers
4k 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 ...
17
votes
1answer
1k views

Is there any way to generate primitives in a geometry shader without any input geometry?

A few years ago I tried to implement this GPU Gem in OpenGL to generate 3D procedural terrain using Marching Cubes. The article suggests to implement Marching Cubes in a geometry shader to maximum ...
17
votes
1answer
320 views

What subdivision algorithm advances have occurred since Catmull-Clark?

In 1978 Edwin Catmull and Jim Clark defined the recursive subdivision process that bears their names, and although those principles are applicable still today, what advances have occurred as far as ...
16
votes
3answers
4k views

Why do we have graphics frameworks like OpenGL and DirectX, when games could just draw pixels directly?

Games and other graphically intensive applications use frameworks like OpenGL and DirectX. Also they require features like pixel shader and DX12. But why would we need all these frameworks and GPU ...
16
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 ...
16
votes
2answers
443 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 ...
16
votes
2answers
888 views

Subpixel Rendering for a Ray Tracer

In font rendering, it is common to use subpixel rendering. The basic idea here is to break the pixel into its RGB components and then compute a value for each separately. Since each component is ...
16
votes
3answers
2k views

What's the current state-of-the-art algorithm for ray-tracing height-fields?

There have been lots of papers over the years on different techniques for drawing height-field terrain in a ray-tracer. Some algorithms ray-march the grid directly (or via a quadtree); others ...
16
votes
2answers
646 views

Handling Projective Aliasing In Shadow Mapping

I'm fiddling with simple procedural 3D modeling to make teeny buildings for 3D printing. An Example: To make the models more readable onscreen, I've implemented basic shadow mapping for a single ...
15
votes
3answers
7k views

Physically based shading - ambient/indirect lighting

I implemented a physically based path tracer after studying PBRT by M. Pharr and G. Humphreys. Now I'm trying to apply physically based rendering to real time graphics using OpenGL ES (in an iPhone ...

15 30 50 per page