MTKView stands for MetalKit View, a class provided by MetalKit designed to render Metal. Use this tag alongside [metal] or [metalkit] for questions about the usage or behavior of this class.
Questions tagged [mtkview]
30 questions
1
vote
0 answers
Why my MTKview is drawn like if there is a dark overlay on the top of it?
I'm under macOS and I create an MTKView, and I set this MTKView as a subview of the ContentView of my NSWindow.
when I'm inside my MTKView.drawRect method and when I call NSView(Super).getRectsBeingDrawn it returns me nothing! why?
But my main…

zeus
- 12,173
- 9
- 63
- 184
1
vote
0 answers
How to inherit MTKView and fallback on NSView/UIView for older OS devices that don't support MTKView?
I am new to Objective-C, and this compatibility issue of MTKView really confuses me.
I have a view class, and it's used to be like this,
@interface MyView : NSView
@end
@implementation MyView
// A lot of implementations
@end
I am now trying to…

CookCookie
- 35
- 7
1
vote
1 answer
Interoperate MTKView (MetalKit) and SceneKit
I am using MetalKit and have a complex rendering pipeline. The results are rendered into a MTKView.
Now I would like to feed the contents of the MTKView to a SCNScene and using a SCNCamera to perform post-process effects like HDR.
How is this…

Summon
- 968
- 1
- 8
- 19
0
votes
0 answers
Accessing vertex data from a MTKView
I am drawing am image in a MTKView using a Metal shader based on the 'pointCloudVertexShader' used in this sample code. The image can be moved with a 'dragGesture' in the MTKView, similarly to the 'MetalPointCloud' View in the sample Code.
I want to…

David Koch
- 11
- 3
0
votes
0 answers
SDK for MediaTek and Documentation
How can we get (paying) the SDK for MediaTek MTK7526G/MTK7525 and courses about that?
I need to customize router firmware with that chipset to that i only need the knowledge to uncompact and compact again to work in tbhis chipset…
0
votes
1 answer
iOS - Metal not rendering color with low saturation and alpha
I'm using MTKView to render some triangles. Everything works fine until I decrease the color's saturation and opacity value which makes the triangle completely transparent. Creating SwiftUI's Color with the same values shows correctly. This only…

Son Nguyen
- 1,124
- 2
- 10
- 24
0
votes
1 answer
How to render multiple triangleStrips using Metal?
Now I have already known how to render multiple triangles in Metal:
let vertexBuffer = device.makeBuffer(vertices_triangles)
renderEncoder.setVertexBuffer(vertexBuffer, offset: 0, index: 0)
renderEncoder.drawPrimitives(type: .triangleStrip,…

Yang_____
- 117
- 8
0
votes
0 answers
What is the implementation principle of MTKLog based on Android platform??
I want to learn a little bit about how MTKLog records logs, MTKLog can store all kinds of logs in a local file, it's amazing, anybody know? Please give advice, thank you

Karen Cheng
- 1
- 1
0
votes
3 answers
How do I position an image correctly in MTKView?
I am trying to implement an image editing view using MTKView and Core Image filters and have the basics working and can see the filter applied in realtime. However the image is not positioned correctly in the view - can someone point me in the…

Duncan Groenewald
- 8,496
- 6
- 41
- 76
0
votes
0 answers
on macOS, MTKview colorAttachments[0].clearColor seam to not work
Under macos when i do :
MTLRenderPassDescriptor* renderPassDesc = [MTLRenderPassDescriptor renderPassDescriptor];
MTLRenderPassColorAttachmentDescriptor* colorAttachmentDesc = [MTLRenderPassColorAttachmentDescriptor…

zeus
- 12,173
- 9
- 63
- 184
0
votes
1 answer
Are UIViews that are subviews of MTKViews being handled / rendered on the GPU?
I am adding a UIView to a MTKView and animating the UIView in the DRAW delegate method of the MTKViewDelegate.
Will this animation be handled by the GPU / Metal? Should the animation be smoother or the same as if I were using UIView.animate?
…

SkankHunt42
- 11
- 3
0
votes
0 answers
Optimize performance of rendering MTLTexture to Display?
I am presenting a MTLTexture to the display with the following code. It is a large (~12k) texture that is taking about 10ms to draw. Since I need to render at least 30FPS (33ms/frame) it is taking nearly one third of my computing time just to…

Jeshua Lacock
- 5,730
- 1
- 28
- 58
0
votes
1 answer
MTKView frequently displaying scrambled MTLTextures
I am working on an MTKView-backed paint program which can replay painting history via an array of MTLTextures that store keyframes. I am having an issue in which sometimes the content of these MTLTextures is scrambled.
As an example, say I want to…

Plutovman
- 677
- 5
- 22
0
votes
1 answer
MTKView clear display
I want to set the contents of MTKView (or GLKView/CAEAGLLayer) to black as soon just as the application resigns active. What is the quickest and most reliable way to set it to it's clear color(say black) and display it?

Deepak Sharma
- 5,577
- 7
- 55
- 131
-1
votes
2 answers
MTKView currentRenderPassDescriptor clear color
I am drawing in an MTKView using
override func draw(_ rect: CGRect) {
var pixelBuffer: CVPixelBuffer?
syncQueue.sync {
pixelBuffer = internalPixelBuffer
}
guard let drawable = currentDrawable,
let…

Deepak Sharma
- 5,577
- 7
- 55
- 131