Questions tagged [metal]

For questions about the Metal graphics/compute API.

Filter by
Sorted by
Tagged with
0 votes
1 answer
47 views

Are stencil buffer dimensions required to match render target dimensions?

I may not need as precise pixel-perfect stenciling as my render target during stencil tested render pass. I could be okay with stencil test happening at half or quarter of resolution to save bandwidth,...
simd's user avatar
  • 105
0 votes
1 answer
150 views

Is it possible to fill in Stencil Buffer programmatically via fragment shader?

I've never worked with stencil buffers, but I'm researching if it is the right tool for my task. Basically I don't understand yet if stencil buffer can only be filled in by some hardcoded rules during ...
simd's user avatar
  • 105
1 vote
0 answers
116 views

Does WebGPU Have Significant Feature/Functionality Gaps As Compared to Vulkan/DirectX12/Metal?

A friend and I are considering using webgpu native (more specifically C++ bindings) for a project. We were wondering, since WebGPU likely runs on top of Vulkan XOR DirectX12 XOR Metal at any given ...
The Floating Brain's user avatar
0 votes
0 answers
45 views

Raytracing Diffuse Function not Working as Expected

I am trying to write a raytracing renderer using compute shaders in Metal. My implementation is based off of Peter Shirley's Raytracing in One Weekend: https://raytracing.github.io/books/...
oli2's user avatar
  • 1
1 vote
0 answers
60 views

Normal Map Under rotation Issue

I have been trying to apply normal maps to a rotating sphere with light shining directing from above the sphere (0,1,0). but lighting does not look correct under rotation as one side of the sphere ...
Sina Dasht's user avatar
0 votes
0 answers
46 views

Why is my texture stretched from 1 row of pixels? Metal/Swift

I have the following code below, and it generates the following render. I am using a texture test image, and it looks like its just taking the bottom row of pixels of that image and repeating then. It ...
Bryan Potts's user avatar
1 vote
1 answer
65 views

Metal API clips all primitives?

I am trying to port my simple app from D3D12 to Metal and I am stuck at rendering a simple triangle. The window does not show any primitives; only the clear color is visible. Debugging my application, ...
Julian Kirsch's user avatar
1 vote
0 answers
358 views

Is OpenGL to Metal translation layer plausible?

I am not sure if I understood it correctly, but OpenGL is high-level like Java and Metal is low-level like Assembly, aren't they? Apple seems to have abandoned OpenGL in favour of Metal, but there ...
Damn Vegetables's user avatar
0 votes
2 answers
453 views

Ray Tracing, why does the GGX make my rendering result darker and darker for each frame?

I am trying to add GGX and PBR textures to my GPU ray tracer. The result is very strange, it's getting darker for each frame. ...
iaomw's user avatar
  • 131
-1 votes
1 answer
149 views

When do people need to work directly with a graphical API (eg: Direct3D) instead of using already made software?

I had this doubt in my head for several months and have been unable to find an answer anywhere on internet. I know what OpenGL, DirectX, Vulkan, Metal, etc... are, I already know what they are used ...
lorenzo's user avatar
  • 101
3 votes
2 answers
4k views

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 ...
gndpsingh's user avatar
1 vote
2 answers
3k views

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 ...
gndpsingh's user avatar
4 votes
0 answers
371 views

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 ...
Kaarlo Räihä's user avatar
2 votes
1 answer
1k views

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 ...
Richard Stover's user avatar
1 vote
0 answers
83 views

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 ...
Richard Stover's user avatar
11 votes
1 answer
9k views

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 ...
MisterGeeky's user avatar
1 vote
1 answer
221 views

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 ...
J.Doe's user avatar
  • 1,445
6 votes
1 answer
236 views

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 ...
J.Doe's user avatar
  • 1,445
1 vote
0 answers
174 views

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 ...
J.Doe's user avatar
  • 1,445
2 votes
2 answers
3k views

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 ...
J.Doe's user avatar
  • 1,445
2 votes
2 answers
5k views

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 ...
J.Doe's user avatar
  • 1,445
1 vote
2 answers
3k views

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: ...
Labeno's user avatar
  • 31
1 vote
0 answers
253 views

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 ...
hyperknot's user avatar
  • 111
2 votes
1 answer
534 views

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): ...
Labeno's user avatar
  • 31
6 votes
1 answer
198 views

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 ...
J.Doe's user avatar
  • 1,445