Silhouette Outline Shader Modifier via Metal in SceneKit












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.










share|improve this question

























  • 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 4 '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 4 '16 at 20:20











  • Are you saying that the shader modifier should be exactly the same between opengl et metal? The doc (developer.apple.com/reference/scenekit/scnshadable) seems to suggest that there should be some slight changes at least

    – Guig
    Sep 16 '16 at 1:09
















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.










share|improve this question

























  • 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 4 '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 4 '16 at 20:20











  • Are you saying that the shader modifier should be exactly the same between opengl et metal? The doc (developer.apple.com/reference/scenekit/scnshadable) seems to suggest that there should be some slight changes at least

    – Guig
    Sep 16 '16 at 1:09














2












2








2


1






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.










share|improve this question
















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.







ios swift scenekit metal metalanguage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 11:07









Flimzy

40.2k1367101




40.2k1367101










asked Feb 4 '16 at 3:40









OxcugOxcug

4,79522342




4,79522342













  • 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 4 '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 4 '16 at 20:20











  • Are you saying that the shader modifier should be exactly the same between opengl et metal? The doc (developer.apple.com/reference/scenekit/scnshadable) seems to suggest that there should be some slight changes at least

    – Guig
    Sep 16 '16 at 1:09



















  • 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 4 '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 4 '16 at 20:20











  • Are you saying that the shader modifier should be exactly the same between opengl et metal? The doc (developer.apple.com/reference/scenekit/scnshadable) seems to suggest that there should be some slight changes at least

    – Guig
    Sep 16 '16 at 1:09

















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 4 '16 at 20:02





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 4 '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 4 '16 at 20:20





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 4 '16 at 20:20













Are you saying that the shader modifier should be exactly the same between opengl et metal? The doc (developer.apple.com/reference/scenekit/scnshadable) seems to suggest that there should be some slight changes at least

– Guig
Sep 16 '16 at 1:09





Are you saying that the shader modifier should be exactly the same between opengl et metal? The doc (developer.apple.com/reference/scenekit/scnshadable) seems to suggest that there should be some slight changes at least

– Guig
Sep 16 '16 at 1:09












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35192078%2fsilhouette-outline-shader-modifier-via-metal-in-scenekit%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35192078%2fsilhouette-outline-shader-modifier-via-metal-in-scenekit%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

To store a contact into the json file from server.js file using a class in NodeJS

Redirect URL with Chrome Remote Debugging Android Devices

Dieringhausen