Questions tagged [performance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
59 votes
3 answers
35k 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
  • 24.7k
36 votes
2 answers
13k 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
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
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,720
19 votes
3 answers
5k views

Difference between rendering in OpenGL and 3D animation software

With OpenGL and such I can render some pretty amazing looking things in "real time" 60 FPS. However, if I try to make a video of that same scene in let's say Maya, or 3ds Max it would take MUCH MUCH ...
J.Doe's user avatar
  • 1,445
17 votes
3 answers
5k 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 ...
Suici Doga'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
14 votes
1 answer
2k views

When to disable perspective correct interpolation ( noperspective )

In GLSL, perspective correct interpolation of vertex attributes is the default setting - one can disable it for specific vertex attributes by using the noperspective qualifier. Other than in post-...
gemse's user avatar
  • 243
13 votes
1 answer
6k views

Loop performance in a shader

I am wondering what's the best way to integrate a dynamic loop function in a shader? First, it seems that dynamic arrays are not possible. So, is it better to create a maximum size array and only ...
MaT's user avatar
  • 1,219
12 votes
1 answer
9k views

Why is accessing textures much slower when calculating the texture coordinate in the fragment shader?

When using textures in GLSL, it is best to calculate the final texture coordinates in the vertex shader and hand them over to the fragment shader using varyings. ...
Nero's user avatar
  • 1,310
12 votes
1 answer
3k views

What is the performance tradeoff between forward and deferred rendering?

Forward rendering is the process of computing a radiance value for a surface fragment directly from input geometry and lighting information. Deferred rendering splits that process into two steps: ...
John Calsbeek's user avatar
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
11 votes
2 answers
614 views

With modern fillrates and deferred rendering, is occlussion culling still relevant?

For example, while it's the current top-of-the-line GPU, the GTX 980 has a staggering 72.1 gigapixels/second fillrate, which with back-to-front rendering and/or Z buffer checks, seems almost ...
Llamageddon's user avatar
10 votes
1 answer
7k views

Performance of Compute Shaders vs. Fragment Shaders for Deferred Rendering

I have written a deferred renderer that can use either a fragment shader or a compute shader to execute the shading pass. Unfortunately, the compute shader implementation runs slower. I'm trying to ...
geometrian's user avatar
  • 1,950
10 votes
1 answer
260 views

Why did AMD's putting an SSD on a GPU board reduce latency so much?

AMD have recently been in the news with an interesting Radeon Pro board with a couple of M2 SSDs on it. As some of the more detailed stories (here or here, for example) note, the benefits may ...
timday's user avatar
  • 201
9 votes
2 answers
285 views

When is it better to upload partial model matrices to the vertex shader?

As of now, when rendering my scene and while iterating through the scene graph, for each node its model matrix is calculated from the parent's model matrix and the scene node's pose. This is quite ...
Nero's user avatar
  • 1,310
9 votes
2 answers
1k views

The most performant way to organize vertex data on modern GPUs

Say I have a model made up of vertices, each with position, normal, tangent, and ...
lcmylin's user avatar
  • 413
9 votes
1 answer
962 views

Shader uniform performance

I'd like to know if there's any performance impact based on how I struct my shader uniforms. For instance, is passing 4 floats worse than passing a single vec4?
Felipe Lira's user avatar
  • 1,236
8 votes
2 answers
293 views

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

I'm interested in virtual reality, but according to some sources, less than 1% of computers in use today have the necessary performance to run modern VR games, granted many of them are not intended ...
Syzygy's user avatar
  • 183
8 votes
1 answer
433 views

Do modern GPUs contain barrel shifters?

I'm aware that most modern GPUs, although designed for floating point, are more or less equivalent in integer performance these days, with a few caveats like the lack of a fused multiply add. I'm not ...
russ's user avatar
  • 2,372
8 votes
1 answer
1k views

How does everyone count "Rays per Second"?

Recently I'm developing a Monte-Carlo path tracer. To measure my tracer's performance, I decided to implement a simple mechanism to count how many rays can it trace in a second. Then here comes the ...
D01phiN's user avatar
  • 83
7 votes
1 answer
750 views

Estimating the area of a triangle-circle intersection

I am trying to implement Ray Tracing with Cones (Amanatides 1984). Instead of rays, cones are shot into the scene and intersected with geometry. Since multiple triangles can occupy the cone's aperture,...
David Kuri's user avatar
  • 2,293
6 votes
2 answers
3k views

How to reduce the number of draw calls when rendering one object multiple times?

Especially when rendering particle effects, the same object needs to be rendered several times with slightly modified properties. But these changes are often limited to properties like pose or ...
Nero's user avatar
  • 1,310
6 votes
1 answer
140 views

Can meshes be reused in raytracing?

In rasterization, at least in the context of game development, it is a common to have many instances of the same 3D object in a scene (think many identical rocks in different sizes/positions/rotations)...
Ilya's user avatar
  • 75
6 votes
1 answer
2k views

Why are tessellation shaders disliked?

I often hear that tessellation shaders aren't great for performance reasons. Something along the lines that if you try to use a tessellation shader, you'll find that the data you get out isn't ...
Alan Wolfe's user avatar
  • 7,751
6 votes
2 answers
533 views

How can I improve the performance of my custom Global Illumination approach?

I want to experiment with some new stuff about modern rendering techniques and in that way I'm trying to implement a custom GI (somewhere between pathtracing and instant radiosity). My scene is a bit ...
newin's user avatar
  • 363
6 votes
0 answers
458 views

In Metal, what performance advantages are there, if any, to using vertex descriptors and the [[stage_in]] qualifier?

Metal seems to provide two very different ways to access vertex data in your vertex shader. You can: Create an MTLVertexDescriptor object, which describes vertex ...
lcmylin's user avatar
  • 413
5 votes
1 answer
605 views

Performance impact during texture layer loading

Recently I have been having a rather confusing performance drop with loading in layers of a 2D texture array, but only in one case from what I can tell, leaving me to speculate on why it is happening ...
Lemon Drop's user avatar
5 votes
1 answer
397 views

Optimizing performance on hardware

I'm working on a webgl audio visualizer that uses particles, and I want to optimize rendering based on the user's hardware. I'd like to offer a "low quality" and "high quality" setting so that it ...
Nick's user avatar
  • 153
4 votes
2 answers
562 views

Should you measure mesh complexity in triangles or vertices?

I have seen people using either vertices or triangles as a quick heuristic to estimate mesh memory usage and mesh rendering time. I always thought vertices were better, because the number of vertices ...
Makogan's user avatar
  • 1,696
4 votes
1 answer
290 views

Tasks of a professional graphics programmer?

Currently I'm 16 and in high school and I love graphics programming and I'm seriously considering it as a career path. I was wondering what a day as a graphics programmer looks like for offline ...
Arjan Singh's user avatar
  • 2,491
4 votes
1 answer
1k views

Register pressure in Compute Shader

I'm in the process of writing a Ray Tracer using DirectCompute / HLSL. First, eye rays are generated (one per pixel). Then, rays are traced, shaded and reflected in a loop. Also, shadow rays for each ...
David Kuri's user avatar
  • 2,293
4 votes
1 answer
2k views

How does MSAA performance scale?

I'm finding myself increasingly interested in rendering techniques utilizing multisampling for anti-aliasing (obviously), out-of-order transparency, volumes etc. Searching the web for performance ...
Andreas's user avatar
  • 359
4 votes
1 answer
568 views

Best practice for managing many shaders and merging multiple shaders into one?

I have managed to greatly minimize draw calls on my recent project, but as I'm adding more shaders, I see that I have to switch more times and that is causing a lot of draw calls. What is the best ...
GnoSiS's user avatar
  • 63
4 votes
1 answer
567 views

Data structure and algorithm for clipping triangulation with leaf nodes of an octree

I have an application in which I am using an octree to store a volume mesh of axis-aligned bounding boxes (AABBs). Given a water-tight manifold triangle mesh, I need to: find if an AABB is ...
gnzlbg's user avatar
  • 141
3 votes
3 answers
226 views

Dealing with wasted space when using SIMD on CPU for vector maths

I've been getting interested in SIMD programming on CPU using SSE recently, but I'm a complete noob on the subject. I found this article describing how to make an efficient float3 type using the ...
russ's user avatar
  • 2,372
3 votes
1 answer
790 views

Can I use QueryPerformanceCounter to measure single draw or compute call performance?

I know I can use QueryPerformanceCounter for measure time for whole single frame. But can I when it comes to OpenGL draw or compute call? I always assumed that, as ...
mdkdy's user avatar
  • 2,109
3 votes
1 answer
136 views

Is there some book about how to design a 3D math lib? [closed]

3D math covers vector algebra and matrix algebra, which are easily calculated on paper, but not so easy when coding them effectively. I only leant some basic algorithms on matrix in my Data Structure ...
yanpengl's user avatar
  • 139
3 votes
2 answers
6k views

Optimizing compute shader with thread group shared memory

I'm currently learning compute shaders and I'm trying to write an optimized Game Of Life. I have a first version working that uses a Shader Storage Buffer Object. I dispatch a thread per cell I want ...
François Guthmann's user avatar
3 votes
1 answer
449 views

Compute shader textures compared 2D float4 arrays

I am wondering is there a difference in performance between using floating point textures as my 2D float4 array vs just passing in 2D float4 arrays? 2D float arrays eliminate the need to do texture ...
wduk's user avatar
  • 177
3 votes
1 answer
789 views

How to get unique nearest neighbour?

There's already something called K-nearest neighbour algorithm with gives nearest neighbour to points. But what I want is unique neighbour which is not shared by any other neighbour. I've implemented ...
PradeepBarua's user avatar
3 votes
2 answers
7k views

What are the differences between GPU instancing and standard instancing?

I have been reading a lot of debate on a new feature that will be available in the new version of the game engine Unity 5.4 - called GPU instancing. I understand the importance of instancing in ...
Louis15's user avatar
  • 273
3 votes
0 answers
40 views

Profile GPU performance in Direct3D 11

I'm trying to profile a d3d11 application using queries (pretty much exactly as described here). I noticed something strange with the data I was getting from the queries and I think I managed to ...
leone ruggiero's user avatar
3 votes
0 answers
54 views

Intel UHD extremely slow copy operations

Is there a way to make copy operations such as CopyResurce(d3d11) and glBlitFramebuffer(ogl) on multi-sample resources faster ...
leone ruggiero's user avatar
3 votes
0 answers
277 views

Projecting light shapes

I am wondering how professional light visualizer software (like Capture Argo - WYSIWYG - Realizzer - LightConverse) project the lights on the objects (like stage, floor, people), even projecting the ...
Freddy Violato's user avatar
2 votes
1 answer
51 views

Different Vertex structures in multi-purpose system

A typical definition of a Vertex structure in C++ might look something like this: struct Vertex { Vec3 pos; Vec3 color; } However, we found ourselves ...
Gary Allen's user avatar
2 votes
2 answers
510 views

What does the z-buffer look like in memory?

I am an amateur game developer, and I've been reading a lot on how computer graphics rendering works lately. I was reading on the Z-buffer recently and I can't quite seem to be able to wrap my head ...
Carmo's user avatar
  • 23
2 votes
1 answer
584 views

GPU not reaching 100% usage when frame rate is dropping

I am making an iOS game using Unity. I am testing some shaders that I have made for the game, and in some cases the device will run at under 30 FPS but not have 100% device utilization. Sometimes a ...
Gerald Lang's user avatar
2 votes
0 answers
152 views

Sparse voxel oct tree tracing, optimization tricks?

I have a working oct-ree raytracer and I am applying it to the sponza. The algorithm I have designed works like this at a high level: Collide with the bounding box of the model, move your ray to that ...
Makogan's user avatar
  • 1,696
2 votes
0 answers
248 views

Using GPU instead of CPU in Scala

I wrote a program that displays points expressed in 3D in a 2D canvas, using perspective projection. The aim is to display a cube. Each face of the cube is drawn by linearly interpolating the points ...
JarsOfJam-Scheduler's user avatar