Questions tagged [scntechnique]

An SCNTechnique object describes a rendering technique that uses one or more additional drawing passes, each of which uses a custom OpenGL shader program to augment or postprocess SceneKit’s rendering of the scene.

21 questions
7
votes
2 answers

Use SCNTechnique with Metal Shaders in Swift Playgrounds

I want to use a SCNTechnique with Metal shaders in Swift Playgrounds on a SCNView. Therefore I tried compiling my shaders with the following code: guard let metalDevice = sceneView.device else { return } if let path =…
6
votes
1 answer

Blank depth buffer from ARSCNView in DRAW_QUAD pass of SCNTechnique

I'm trying to do depth-testing in a post-processing step of an AR SceneKit demo. I would need the depth map of the rendere ARSCNView for that. It seems impossible to get it using an SCNTechnique. I keep getting blank (full of 1.0-s) depth buffers…
5
votes
1 answer

How to use stencils with SCNTechnique?

Basically, I would like to render an outline around a cube. To do this, I think I can use an SCNTechnique which has the following render passes: Render the cubes normally, and also write their occupied pixels to a stencil buffer. Render slightly…
Robert
  • 5,735
  • 3
  • 40
  • 53
4
votes
1 answer

SCNTechnique on ARSCNView does not affect CameraFeed (Scene Background) on iOS 13

Before iOS 13 (iOS 11 & 12) a SCNTechnique applied to an ARSCNView with a multipass setup that is first supposed to draw the entire Scene into a texture (via DRAW_SCENE) would also affect the ARKit scene background (the camera feed). Now with iOS 13…
arthurschiller
  • 316
  • 2
  • 9
3
votes
1 answer

How to use SCNTechnique to create a "masked" portal effect in SceneKit / ARKit?

I'm trying to wrap my head around how to use SCNTechnique with Scenekit. The effect I'm trying to create can easily be achieved in Unity by adding a custom shader to two materials, making objects with the "filtered" shader to only be visible when it…
mikehobi
  • 116
  • 1
  • 6
3
votes
2 answers

Motion Blur with SCNTechnique

I've been trying to get motion blur working with SCNTechnique for a few days now and I'm nowhere close to what I want. I've asked a similar question on the Apple forums but they're dead. So I'd thought I'd write a more exhaustive description of…
Chris
  • 2,739
  • 4
  • 29
  • 57
2
votes
0 answers

SCNProgram read from depth buffer

I am investigating some advanced rendering in Scenekit, and what SCNTechnique and SCNProgram can be used for. I would like to implement a multi-pass render like so: First; render the full scene using the in-built PBR shader, Second; render a single…
Nick
  • 261
  • 2
  • 8
2
votes
1 answer

Modify Metal fragment shading based on vertex world position Y coordinate

I am trying to use a Metal fragment shader with SCNTechnique to modify the fragment color based on the vertex Y world position. My understanding so far SCNTechnique can be configured with a sequence of render passes. A render pass allows for…
CloakedEddy
  • 1,965
  • 15
  • 27
2
votes
0 answers

How come SCNTechnique doesn't have a .library property like SCNProgram?

I'm working on a SceneKit project and I'm using metal to do the rendering. I wanted to apply post-processing to my scene using SCNTechnique, but SCNTechnique requires that the metal shader files need to be located at the default metal library…
2
votes
1 answer

Multiple SCNView audio error

I'm working on a game that support both normal playing and VR using SceneKit. When playing normally I have a single SCNView, one camera which also corresponds to the view audio listener. When switching to VR mode I split the screen into two SCNView…
Marco Boschi
  • 2,321
  • 1
  • 16
  • 30
1
vote
0 answers

writing to a depth target not working when using SCNTechnique with a metal shader

I have a SCNTechnique with multiple render passes setup. In one of those passes, I am sampling the depth of the lidar camera and want to write that to a target for use in a different render pass. It works fine if I write to a color target. As soon…
Davido
  • 2,913
  • 24
  • 38
1
vote
0 answers

How to stop Swift ARKit app from reverting SCN Technique, and world tracking issues

I am making an ARKit swift app, and have followed this post on how to apply a mirroring effect to the camera feed. However, I've run into a couple problems. First, the mirroring effect stops after a while. This often happens when the images I am…
Charlie
  • 136
  • 1
  • 8
1
vote
0 answers

How to access the original ARKit camera image in a custom shader or SCNTechnique?

ARKit materials have a .blendMode property that allows you to overlay the color of your rendered object on top of the video image. This works great, however, I need to use a different blend mode to apply the color to the video image. I have tried…
Davido
  • 2,913
  • 24
  • 38
1
vote
0 answers

How to add "excludeCategoryMask" for two different Categories in the same pass?

I have multiple Category Bitmaps. I need it like that for other reasons. (ARKIT w/ SCNTechnique + Metal) I have a SCNTechnique.plist with a specific pass where i want to exclude 2 specific categories, but i can't add 2 "excludeCategoryMask" in the…
Alan Cruz
  • 83
  • 1
  • 11
1
vote
1 answer

Metal / SceneKit Fragment Shaders - How to avoid rendering ontop of other geometry?

Given this basic SceneKit scene with a cube, sphere and pyramid positioned next to each other, where the sphere intersects the pyramid: And given the below, simplified Metal shader / SCNTechnique which just renders any nodes with a specific…
Adam Eisfeld
  • 1,424
  • 2
  • 13
  • 25
1
2