Hot answers tagged

8

There are many, many ways to draw things in OpenGL, so this is naturally confusing sometimes. The first method you describe, setting the shader parameters and issuing one draw call per object is usually the most inefficient, due to the high API overhead. The second one, using instanced drawing is a much smarter approach for objects with the same parameters. ...


6

I think you may want to take another look at the iOS user interface if you consider real-time blurs to be out of range of mobile hardware: Blurs are totally in range of mobile hardware. Yes, you need a fairly large number of texture samples for a blur with a large kernel, but the texture samples are also cached very well, and you can use a separable blur, ...


4

In OpenGL ES there is Instancing which provides allows for rendering one object multiple times. When using Instancing, you can use uniform arrays to provide different information, e.g. a transformation matrix, for each of the particles. In the shader you can then use gl_InstanceID to distinguish between the individual particles and pick the appropriate ...


4

There's no way around it. If you want the area behind the textboxes to appear blurry... you're gonna have to blur it. One way to mitigate the performance cost is to be sure to use a 2-pass separable blur. Another measure that will probably help (depending on how much of the screen your textboxes cover) is to use scissoring or a stencil test to only compute ...


1

This is more a comment than an answer, but since I'm new here with no reputation, I can't comment. I was trying to use your method 2 to read a metal texture (having hit problems with your other methods, too, as well as half a dozen other methods from other threads). I used a .waitUntilCompleted method, so figured my problem didn't have to deal with ...


1

maybe you forget to call MTLBlitCommandEncoder.synchronizeTexture to sync VRAM to system memory. please check: https://forums.developer.apple.com/thread/30488 and document: https://developer.apple.com/documentation/metal/mtlblitcommandencoder/1400757-synchronize


1

Generally, with VSYNC, your CPU is effectively doing nothing 99% of the time, as it merely sent the simple vertex buffer batch (few triangles, as you said) to the driver. If the shader is bandwidth-heavy, it takes multiple frames to render. In your case, you said it's 12 fps, e.g. 60/12 = 5 frames. So, the CPU (or the core that runs your thread), is ...


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