Questions tagged [scnmaterial]

A set of shading attributes that define the appearance of a geometry's surface when rendered.

29 questions
10
votes
3 answers

Apply .jpg and .mtl file to .obj file in SceneKit

The designer has delivered three files: image.jpg something.mtl whatever.obj I can successfully load the .obj file into my scene like such: SCNView * sceneView = [SCNView new]; sceneView.frame = view.bounds; [view addSubview:sceneView]; …
Johnny Rockex
  • 4,136
  • 3
  • 35
  • 55
7
votes
0 answers

Blur effect in SceneKit material

Is it possible to achieve a Gaussian blur effect for a SCNMaterial in SceneKit? It should look like frosted glass, similar to a UIVisualEffectView with a UIBlurEffectStyleLight or UIBlurEffectStyleExtraLight in UIKit.
Ortwin Gentz
  • 52,648
  • 24
  • 135
  • 213
6
votes
1 answer

Add UIView (from xib) with transparency to SceneKit

I'm trying to load a UIView into SceneKit with a translucent background, but currently, it just fades to white as I decrease the opacity. I have a very simple UIView layout in a .xib file that I want to load into SceneKit. So far I can display the…
maxxfrazer
  • 1,173
  • 6
  • 15
5
votes
0 answers

SceneKit: understanding how to set scale for floor material?

Can anyone explain how the two Scale properties work in the Material Inspector of the Xcode Scene Editor? Ostensibly, it seems the first represents scale along the X-axis while the second represents scale along the Y-axis. There is no discussion of…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
3
votes
1 answer

Scenekit: recolor diffuse texture with shader

I want to write some shader (surface/fragment/...) to recolor my diffuse texture in some new color. Currently I have this version of shader (I'm trying to recolor texture in real time): //sm_surf uniform vec4 colorTarget; (used in full…
Joker
  • 263
  • 2
  • 16
3
votes
1 answer

SCNMaterial prevent stretch

I have a custom geometry quadrangle and my texture image is displaying on it, but I want it to display as an Aspect Fill, rather than stretching or compressing to fit the space. I'm applying the same texture to multiple walls in a room so if the…
Marc Hampson
  • 257
  • 1
  • 4
  • 17
3
votes
3 answers

How do I efficiently map a high-res SKScene in SceneKit?

Possibly related: Optimizing SceneKit performance with high-res textures I am mapping a SKScene onto a board geometry to create a board game. The scene needs to be relatively large (2048x1024) so that I can zoom in on the action and still have…
Double M
  • 1,449
  • 1
  • 12
  • 29
2
votes
1 answer

Render a 3D model (hair) with semi-transparent texture in SceneKit?

I'm trying to render a 3D model in SceneKit but it looks incorrect. For example this model (it's an SCN file with texture and you can reproduce it in your Xcode): In Xcode Scene Editor it is rendered like this: Transparency -> Mode -> Dual…
Joker
  • 263
  • 2
  • 16
2
votes
0 answers

SKVideoNode not respecting aspect ratio

I'm mapping an SKScene with SKVideoNode onto one of the sides of a SCNBox. I'm struggling to get the aspect ratio of the video correct. Here's the code: NSURL * url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", [[NSBundle…
Johnny Rockex
  • 4,136
  • 3
  • 35
  • 55
2
votes
0 answers

SceneKit PBR - multiply albedo

I need to multiply a bitmap on top of an albedo/diffuse. I’m using PBR shading. Ex: apply a tattoo (bitmap) on top a skin (albedo/diffuse), multiplying so you can see the tattoo overlaying the skin. Question: this tattoo (bitmap) should be a second…
Mane Manero
  • 3,086
  • 5
  • 25
  • 47
2
votes
1 answer

SceneKit PBR rendering- displacement map going crazy

I am using a displacement maps for subtle fabric wrinkles. It should give smooth results, but instead it’s going crazy. Bellow is a perfect sphere, totally messed by the displacement. Is should be like the image bellow, giving subtle wrinkles This…
Mane Manero
  • 3,086
  • 5
  • 25
  • 47
2
votes
1 answer

How do I use a web mercator projection map for SCNMaterial on an SCNShere geometry?

I have a simple globe view in my app. Previously we were using WhirlyGlobe, but have opted to use SceneKit instead. Everything works great and we are happy with it EXCEPT we used map tiles in Whirly Globe and the do not work (as far as I can tell)…
1
vote
1 answer

Set the diffuse contents does not work in SceneKit

When I try to give the geometry a material with the diffuse.contents of red, I get a white object instead. Here is the code I have used to create the node: let geo = SCNBox(width: 1, height: 1, length: 1, chamferRadius: 0.1) let mat =…
Michaelll
  • 37
  • 6
1
vote
2 answers

SCNBox – Map a texture onto five of six sides

I'm trying to create something like canvas in SceneKit using an SCNBox, with a UIImage "wrapped" around from one surface and onto the four others adjacent to it. The only way I can currently think to do this would be to chop up the UIImage into five…
Luke
  • 9,512
  • 15
  • 82
  • 146
1
vote
1 answer

SceneKit selectively color a face by a certain index

My objective: given some index i and some UIColor c, make the face at that index turn into that color. let vertices = // all of my vertices in the format of SCNVector3 let vertexSource = SCNGeometrySource(data: verticesData, …
7ball
  • 2,183
  • 4
  • 26
  • 61
1
2