Skip to main content
15 votes
Accepted

GL_STATIC_DRAW vs GL_DYNAMIC_DRAW vs GL_STREAM_DRAW: does it matter?

This will vary between implementations, but the driver I worked on did use these, mainly to decide memory layout. The optimizations enabled by these hints are much smaller than you would like, mainly ...
Dan Hulme's user avatar
  • 6,840
9 votes
Accepted

What methods/technologies to reduce required performance for virtual reality are there?

Avoid stereo when possible There was some research published recently measuring when users can or cannot tell whether the specular contribution, which is view point dependent, is different between ...
Julien Guertault's user avatar
8 votes

GL_STATIC_DRAW vs GL_DYNAMIC_DRAW vs GL_STREAM_DRAW: does it matter?

Functionally they are the same. The driver could use them to differentiate how to handle the buffer behind the scenes. Where for example static_draw would be copied to vram as soon as possible and ...
ratchet freak's user avatar
7 votes

What methods/technologies to reduce required performance for virtual reality are there?

Alex Vlachos from Valve has had two great GDC talks about this: the one from 2015 the one from 2016 Other than that (and what you have linked yourself), there isn't much left to do than to simply ...
IneQuation's user avatar
7 votes
Accepted

scan line algorithm is too slow?

One red flag is the use of new several times within the loop. Memory allocation doesn't belong in a rasterizer! :) Certainly you should not need to allocate a ...
Nathan Reed's user avatar
  • 25.1k
5 votes
Accepted

Encode two R11G11B10F buffers into one using Y'CbCr?

You might want to look at The Compact YCoCg Framebuffer. It uses a 2-channel buffer to store luminance for every pixel and the two chroma components in half the pixels each, forming a checkerboard. It ...
Nathan Reed's user avatar
  • 25.1k
4 votes
Accepted

Trading off instancing for render order

It depends on your GPU. "Tiled renderers" do this for you so the benefit of doing it yourself is minimal (unless you have some more efficient way of knowing the order, e.g. sorting a fixed-viewpoint ...
Dan Hulme's user avatar
  • 6,840
4 votes
Accepted

Do stencil tests use any acceleration techniques?

I don't have a definite authoritive answer for you but I'm very confident that the answer is "yes". Here's why: When using framebuffer objects, stencil attachments are usually combined with ...
bernie's user avatar
  • 830
4 votes
Accepted

How much precision do I need in my G-Buffer?

First of all, you don't need position in the G-buffer at all. The position of a pixel can be reconstructed from the depth buffer, knowing the camera setup and the pixel's screen-space xy position. So ...
Nathan Reed's user avatar
  • 25.1k
4 votes
Accepted

Image based lighting, tangent space coordinates, and optimization

Yes, you do need to transform the fetch direction into the space of the cubemap. If you could somehow figure out the fetch direction in the vertex shader, then you could do the transformation there ...
John Calsbeek's user avatar
3 votes
Accepted

OpenGL ES Frag Shader - Branching

I think the most efficient way might be either return float(shadowValue > shadowTexZ); or ...
Detheroc's user avatar
  • 1,436
2 votes

Encode two R11G11B10F buffers into one using Y'CbCr?

If you are ok with specular being only white, you could put diffuse and specular into RGBA. It looks like that is what unity does for it's deferred rendering. Someone discovering this issue: http://...
Alan Wolfe's user avatar
  • 7,801
2 votes

How do I handle uniforms in a deferred renderer?

I'd say that the fundamental problem here is your approach. You basically want the outside renderer to throw a bunch of random stuff at the wall, then let the internal rendering system sort it out ...
Nicol Bolas's user avatar
  • 9,842
2 votes

How does notch's new graphics engine work?

Notch's engine most likely works using volume raymarching in a volume field. This means that you shoot rays that move a certain distance and check whether they are inside and object or not. Once they ...
Sebastián Mestre's user avatar
2 votes

The most performant way to organize vertex data on modern GPUs

Apologies, I was going to add a comment to your question thread but found I ended up elaborating too much. My development experience is from a DX 11 perspective so some of this may not hold in OpenGL ...
ErnieDingo's user avatar
2 votes
Accepted

Do you have to group and optimize your draw and shader calls in Vulkan?

Vulkan will not have the CPU-time performance costs associated with state changes (validation overhead, etc). But Vulkan command buffers do have state. They have two very major pieces of state: ...
Nicol Bolas's user avatar
  • 9,842
2 votes
Accepted

OpenGL compute local size vs. performance

Your workgroup size should be a multiple of 32 (Nvidia) or 64 (AMD). The reason is, that on the GPU the work units are grouped to a warp(Nvidia) or a wave (AMD) with the size of 32 or 64. Each unit ...
Thomas's user avatar
  • 1,285
1 vote
Accepted

Need help understanding this simplification/optimization for a very basic GLSL shader

Is this what you are looking for? fragCoord and iResolution are both of vec2 type and the ...
Enigmatisms's user avatar
1 vote

How does higher draw distance strain the CPU?

There are a number of reasons CPU usage goes up with viewing distance but the fundamental reason is the number of objects that need to be processed goes up. Increasing viewing distance linearly ...
pmw1234's user avatar
  • 3,229
1 vote

How does higher draw distance strain the CPU?

This depends on the application. If the rendering distance is larger, more objects have to be managed by the CPU. For example Minecraft, there you have "chunks" that store the block ...
Thomas's user avatar
  • 1,285
1 vote

Recursive sampling in Marching Squares

If the contour exists in a loop entirely inside one of your coarse cells — or has some thin protrusion that passes between the corner points, at least — then it will be missed entirely; it will look ...
Kevin Reid's user avatar
  • 1,196
1 vote
Accepted

Using buffers correctly in OpenGL compute shaders

Do I could get event better perf by making it a compile-time constant ? You'll have to profile it. That being said, "a few hundreds mat4" is not "small". I have trouble ...
Nicol Bolas's user avatar
  • 9,842
1 vote
Accepted

Reading from buffer versus calculating on the fly performance

My question is, though i am aware cos() and sin() is fast, how do they compare to simply getting the value precomputed in a buffer instead? This will depend on your shader code and GPU model. GPUs ...
Varaquilex's user avatar
1 vote
Accepted

Ray Tracing Bounding Volume Hierarchies nodes

Bounding Volumes A bounding volume is for example an Axis-Aligned Bounding-Box (AABB), a generaal Bounding-Box not aligned with the major axes or a Bounding-Sphere. They differ in how much memory ...
Isolin's user avatar
  • 438
1 vote
Accepted

Compute shader textures compared 2D float4 arrays

It depends on what you’re doing. If any given thread of your shader is working with data from multiple nearby pixels, like by sampling from fractional between-pixel locations or doing some calculation ...
Noah Witherspoon's user avatar
1 vote
Accepted

Rays (~1k) intersecting triangle meshes (~100k) with ca. 100 vertices each

Your procedure could be optimized in two directions: If your rays are structured you could possibly take advantage of space coherence: if a ray intersects a given triangle, then a nearby rays has ...
nplatis's user avatar
  • 126
1 vote

The most performant way to organize vertex data on modern GPUs

This may depend on target hardware and the API you are going to use. Can you provide more info? Here's some (very broad and general) best practices for OpenGL. https://www.khronos.org/opengl/wiki/...
i.terrible's user avatar
1 vote

Data fitting SVBRDF with L-M

I read that paper as well last year. There's a strong assumption made by authors which is the "stationary". What this means is that in absence of light in given 3000x2000 pixels image the material is ...
user8469759's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible