Using Related Functions in Scenekit

I don’t see an obvious way to change the blending function (glBlendFunc) for a set of node or geometry plots - it does not seem to be part of the material, and this is not very obvious from the documentation on the script set, how it organizes pass transfers. Do I need to make a Render delegate for node that just changes the GLblending mode, or do I need to somehow configure different rendering passes, etc. (The documentation doesn't show how I even manage things like rendering passages)?

+1
source share
2 answers

From what I can say after several hours of experimentation, there is no way to actually set the blending mode used to render part of the geometry, or to control the general blending mode used to render the passage using SCNTechnique.

SceneKit has only two blending modes: one where blending is off - if it considers the material to be opaque and “transparent” blending mode (GL_ONE, GL_ONE_MINUS_SRC_ALPHA) when it considers the material to be transparent. This is bad news if you want to display things like radiance, because it is not possible to get anything similar to the blending mode (GL_ONE, GL_ONE) that you want to display light rays or a glow.

, , , , , , :

SceneKit GL_ONE, GL_ONE_MINUS_SRC_ALPHA, - 0. , , SceneKit shader - 0, . - - 1 ( , 8 1-255). - 0, . , , .

, , -, "SCNShaderModifierEntryPointFragment", - . , .

, :

#pragma transparent
#pragma body
_output.color.a = 0;

"#pragma transparent" - SceneKit , .

, - .. - , , , , .

+1

? - SceneKit

! iOS 9 OS X 10.11 ( -) blendMode , SceneKit , .


- ... SceneKit iOS 8.x OS X 10.8 10.10 API .

, , .

1. GL-

glBlendFunc , SceneKit , SceneKit , . , SceneKit .

GL renderer:willRenderScene:atTime: renderer:didRenderScene:atTime:, . , , . node node, , SceneKit node .

, . handleBindingOfSymbol:usingBlock:, ?

2. ( iOS)

iOS . , - , Photoshop.

SceneKit - gl_LastFragData _output. , .

#pragma transparent
#extension GL_EXT_shader_framebuffer_fetch : require
#pragma body
_output.color = gl_LastFragData[0] + _output.color;
+2

All Articles