Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tearing graphics in SCNView

SCNView Tearing

Hi, I have a SCNView with some nodes, when rotating I get some strange tearing, the nodes on top have a higher rendering order, changing this seems to have no effect.

Is there anything I can do to get rid of the white lines?

It's like it's fighting for position??

like image 850
Chris Avatar asked Jan 17 '15 21:01

Chris


2 Answers

as said above, it looks like you're experiencing z-fighting because your colored objects and white object lie in a same plane.

You can avoir this

  1. By slightly offsetting your geometries, but this trick does not work in every situation (the user might notice the gap depending on the point of view)
  2. by changing the renderingOrder of your nodes but don't forget to tweak the writesToDepthBuffer and readsFromDepthBuffer properties of your materials
like image 52
mnuages Avatar answered Sep 28 '22 09:09

mnuages


When use NO.2 solution mnuages introduced:

node.renderingOrder = 100;//Max value to ensure your node render at latest.
//disable deep buffer for rendering
node.firstMaterial.writesToDepthBuffer = NO;
node.firstMaterial.readsFromDepthBuffer = NO;

This is only work for node's geometry locate top hierarchy otherwise will lead to a weird perspective scenario.

like image 38
ooOlly Avatar answered Sep 28 '22 09:09

ooOlly