Post

Replies

Boosts

Views

Activity

Reply to How do I get the time in a fragment shader in the Metal shader language?
I have been scratching my head on this, but found a solution thanks to this gist. It contains a dump of the Metal interface containing the inputs provided by SceneKit. No more guessing!I am absolutely stumped that this is not mentioned anywhere in Apple's documentation.Example fragment shader:#include <metal_stdlib> // using namespace metal; #pragma body _output.color.b = sin(scn_frame.time); // OR _output.color.b = scn_frame.sinTime;
Apr ’20