3

What is the difference between files named "name. Shader" & "name. vsh" & "name. fsh" in scene kit ?when i call some shaders in my project my model would be like a purple mask. What should i do?

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
iSibDev
  • 340
  • 5
  • 18

1 Answers1

5

there are three kinds of shaders when working with SceneKit.

As for every OpenGL app there are vertex shaders and fragment shaders. Vertex shaders often have the .vert or .vsh extension and fragment shaders often have the .frag or .fsh extension. These shaders are used with the SCNProgram class.

In addition SceneKit exposes the concept of shader modifiers which often have the .shader extension. Shader modifiers can affect either a vertex of fragment shader and are used with the SCNShadable protocol.

These file extensions are just indications and could be really anything you want.

mnuages
  • 13,049
  • 2
  • 23
  • 40