A set of shading attributes that define the appearance of a geometry's surface when rendered.
Questions tagged [scnmaterial]
29 questions
1
vote
1 answer
Hide area of an SCNMaterial
I'm using SceneKit and ARKit 1.5, once a surface has been mapped I apply a material to it.
I would like to only show what's under the camera in a certain radius with an alpha effect. I want to keep the material static meaning that it does not move…

Adrien Yvon
- 662
- 7
- 18
1
vote
1 answer
Scenekit: How to get all of node's materials?
Ok, from what I understand materials can be created for .dae or any 3D model being used as an SCNNode in Xcode here, in the model's editor:
The topmost material gets applied automatically and all is well. My problem is that I want to…

blue
- 7,175
- 16
- 81
- 179
1
vote
1 answer
SCNMaterial with semi-transparent layer contents appears white
I'm trying to create a material for my SCNBox with colored borders and transparent sides. Here's the code I use for creating material:
class CubeSide: UIView {
override func draw(_ rect: CGRect) {
let path = UIBezierPath(rect: rect)
…

Rinat Khanov
- 1,566
- 10
- 32
1
vote
0 answers
Issue with geometry rendering - SceneKit
I have a set of SceneKit custom geometries. When rendered, and under certain viewing angles, they seem as if they are transparent (one can see through their outer surface and see what is behind, or one can see the inner surfaces). Their material…

aac
- 21
- 4
0
votes
0 answers
SceneKit - Colored material based on environment light or rotation
I want to create a material for my object to be appeared like below, How should I config my material object?
This is what I've done but didn't work:
let colors = [UIColor.green,
UIColor.red,
UIColor.blue,
…

Hossein
- 797
- 1
- 8
- 24
0
votes
1 answer
How can I print out shader modifier output in ARKit?
I'm using SCNMaterial and set it diffuse.contents using surface shader modifier.
I want to log some color values that is being fed to shader but I couldn't find to do that.
Is there a way I can read and print _surface.diffuse.rgba after the…

Ozgur Sahin
- 1,305
- 16
- 24
0
votes
1 answer
SceneKit, how to support opacity (or transparency) map properly for geometry on the back?
As the image below, it's a cube with opacity map. We can see the front 3 faces rendered correctly with transparency. But the back 3 faces totally disappeared. Logically, we shall see something from the back faces.
So, what is the correct steps to…

iaomw
- 720
- 6
- 21
0
votes
0 answers
Scenekit using uiview as material texture breaks with autolayout
Using a UIlabel as a diffuse texture works great in Scenekit but when I rotate the device it breaks and the materials go blank. I've tried also adding the labels to a view offscreen but unfortunately the problem persists. Is there a way around that…

Toby Evetts
- 123
- 1
- 9
0
votes
0 answers
SceneKit SCNMaterial setValue - Pass SCNVector4 as NSValue to shader
It works for my textures but not for SCNVector4 being converted to NSValue? I'm just trying to get vec4 to my surface shader
This question suggests it should work https://stackoverflow.com/a/39407262/273312 - I just keep seeing this Error 'No exact…

The Way
- 594
- 5
- 15
0
votes
1 answer
SceneKit: Geometry not visible behind semi-transparent texture. Box inside Box
I work with SceneKit and I have a problem:
When I make two cubes, one inside the other, one of which has a semi-transparent texture, the cube inside is not drawn.
How it should be(scene created in XCode)
How actually is(I made a few pixels with…

Freename Freefam
- 1
- 2
0
votes
1 answer
Draw dashline cylinder in scenekit like measure app?
I've followed this question to try to make the dash cylinder
final class LineNode: SCNNode {
convenience init(positionA: SCNVector3, positionB: SCNVector3) {
self.init()
let vector = SCNVector3(positionA.x - positionB.x,…

Eddie
- 1,903
- 2
- 21
- 46
0
votes
1 answer
How to resize a texture for meters in ARKit
I need to tile a texture across a plane with updating geometry (floor fill), and I need the texture to be scaled to fit real-world dimensions in centimeters. It is a square floor tile of 50cm, and the texture size is 1024 pixels. How do I convert…

Lee Probert
- 10,308
- 8
- 43
- 70
0
votes
1 answer
Custom SCNGeometry not displaying diffuse contents as texture
I'm creating a custom SCNGeometry. To start, I'm developing it as a flat plane. It displays, and I can apply a colour to its' diffuse contents, but if I try and apply anything such as a UIImage, or a CALayer, it displays as white.
Code:
let…

Andrew
- 7,693
- 11
- 43
- 81
0
votes
2 answers
Image is shown as black and red colors only in ARKit
We are trying to create a SCNNode with a SCNMaterial which has an image (.png extension) in ARSCNView with the ARKit framework.
The problem is that image rendering has a problem that image is shown as black and red colors only, it doesn't render…

ondermerol
- 524
- 1
- 11
- 29