Questions tagged [metal]

For questions about the Metal graphics/compute API.

Metal is Apple's low-level graphics and compute API and LLVM-based toolchain.

21 questions
11
votes
1 answer

What are Metal and Vulkan?

I keep coming across the terms 'Metal' and 'Vulkan' on this site. Guessing this to be some CG software, I'm interested to know what these are exactly and what the intended and most common usage is. A quick search shows me a video about why metal in…
MisterGeeky
  • 211
  • 2
  • 5
6
votes
1 answer

Same draw call causing extremely different GPU usage under different triangle orders

So I have a bit of a predicament I am trying to solve. I have 10,000 triangle strips I am trying to draw. Each one has a z-order for the entire strip and within each strip the most recent triangles need to have a higher z order than the older one.…
J.Doe
  • 1,445
  • 11
  • 22
6
votes
1 answer

How do you design the code of a graphics engine to target multiple frameworks

I am starting to think about how I can make my app (currently written in Metal) available on older device that dont have Metal as well as Android. This is a predicament because while I could write two separate rendering classes that use the…
J.Doe
  • 1,445
  • 11
  • 22
4
votes
0 answers

Are there any reasons to use power of two textures with modern mobile platforms?

Are there any reasons to use power of two textures (like 128x128 sized) if one targets modern mobile platforms (with OpenGL ES 3.0, Metal and/or Vulkan)? With iOS the PVRTC only supports power of two textures that have equal width and height, but…
3
votes
2 answers

Debugging tools for OpenGL on macOS

I am porting some code from Metal to OpenGL since we want to run our app on Windows too. Xcode is my preferred IDE, but the newer versions of Xcode do not support any OpenGL debugging. Question: What do people usually use as a debugger for OpenGL?…
gndpsingh
  • 43
  • 1
  • 5
2
votes
1 answer

How to capture frames in a MacOS MTKView for recording to a video

I have created a 3D model of a local outdoor performance space and I have an app that uses Metal on MacOS 10.14.2 to display the model. I want to create an animation by flying the camera around the scene, while recording each frame (actually every…
2
votes
2 answers

How to perform additive blending in Metal. What do these terms mean?

Forgive me, I dont really understand the basis of alpha blending. Like I know the formula but when it comes to the terms blending operation, source blend factor, and destination blend factor I am absolutely lost. The goal is to do additive blending…
J.Doe
  • 1,445
  • 11
  • 22
2
votes
2 answers

MTLTexture getBytes returning blank image

Inside of my application I am trying to convert a MTLTexture into a CGImage or CIimage for use in other parts of the app. I am having a difficult time doing so because none of the example code I find seems to work properly. For some reason something…
J.Doe
  • 1,445
  • 11
  • 22
2
votes
1 answer

Mipmap sampler in Metal compute kernel (not vertex or fragment shader)

I have a source texture (480x480) that was created with mipmapped set to true (error checking removed to simply this post), and a dest texture (100x100): // source texture var textureDescriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat:…
Labeno
  • 31
  • 3
1
vote
2 answers

FXAA vs MSAA on modern hardware

looking for suggestion whether it is worth implementing a post process FXAA pass on modern mobile GPU's (mainly looking at apple A Series chip), or should i simply use the MSAA. Did a basic test with implementing basic FXAA which took eight…
gndpsingh
  • 43
  • 1
  • 5
1
vote
0 answers

What is best way to use wavefront material file color parameter Kd to set vertex color in MetalKit submeshes?

I am developing a MacOS program using MacOS MetalKit and ModelIO. The ultimate goal is to use the 3D model to analyze the acoustic properties of a performance space. Initially I'm just creating a visual image of the space (stage, walls, seating,…
1
vote
1 answer

Are the benefits of a Metal early depth test limited to one draw call

I should preface with currently this question is mostly asking about Metal and iOS GPUs. That being said if this is GPU or OS specific and you can go into detail about other platforms that would be great to as this application will eventually be…
J.Doe
  • 1,445
  • 11
  • 22
1
vote
0 answers

Sorting my geometry for alpha testing

Here is my predicament. I am trying to draw a multitude of dots that leave trails behind them real time. Heres the difficulty, that line fades. Each dot line has a defined z position and the goal would be for everything to blend properly, in real…
J.Doe
  • 1,445
  • 11
  • 22
1
vote
2 answers

Passing parameters in Metal Compute Kernel using Swift 4

On the CPU side, I have a structure I want to pass to the compute kernel: private struct BoundingBoxParameters { var x: Float = 0 var y: Float = 0 var width: Float = 0 var height: Float = 0 var levelOfDetail: Float = 1.0 …
Labeno
  • 31
  • 3
1
vote
0 answers

Triple buffering without buffers?

Metal Best Practices Guide states that The setVertexBytes:length:atIndex: method is the best option for binding a very small amount (less than 4 KB) of dynamic buffer data to a vertex function I believe this means that instead storing uniforms in…
hyperknot
  • 111
  • 3
1
2