2

Shader modifiers have multiple entry points. Following this: http://wiki.unity3d.com/index.php?title=Silhouette-Outlined_Diffuse I should have two entry points, one after the Vertex shader (SCNShaderModifierEntryPointSurface) and the frag shader (SCNShaderModifierEntryPointFragment). Are these the correct entry points?

Also, if anyone has any tips on writing Metal shader code, that'd be greatly appreciated. Some general notes on how to translate it from the glsl shader would be amazing. Honestly, I've never had a problem reading code before, but this stuff is like Japanese to me.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Oxcug
  • 6,524
  • 2
  • 31
  • 46
  • SceneKit shader *modifiers* aren't Metal shader code — you write GLSL for these, and SceneKit automatically translates that to a Metal shader for Metal-capable devices. – rickster Feb 04 '16 at 20:02
  • I don't read Unity very well, but it looks like that "shader" actually adds an extra render pass to draw the character twice (once for the outline, once for the regular appearance). A shader modifier can't add render passes; it can only modify the output of one pass. Take a look at `SCNTechnique` instead. – rickster Feb 04 '16 at 20:20
  • Are you saying that the shader modifier should be exactly the same between opengl et metal? The doc (https://developer.apple.com/reference/scenekit/scnshadable) seems to suggest that there should be some slight changes at least – Guig Sep 16 '16 at 01:09

0 Answers0