MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / createDepthShader

Function createDepthShader

source/MaterialXRender/Util.cpp:38–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38ShaderPtr createDepthShader(GenContext& context,
39 DocumentPtr stdLib,
40 const string& shaderName)
41{
42 // Construct a dummy nodegraph.
43 DocumentPtr doc = createDocument();
44 doc->setDataLibrary(stdLib);
45 NodeGraphPtr nodeGraph = doc->addNodeGraph();
46 NodePtr constant = nodeGraph->addNode("constant");
47 OutputPtr output = nodeGraph->addOutput();
48 output->setConnectedNode(constant);
49
50 // Generate the shader
51 GenContext depthContext = context;
52 depthContext.getOptions().hwWriteDepthMoments = true;
53 ShaderPtr shader = createShader(shaderName, depthContext, output);
54
55 return shader;
56}
57
58ShaderPtr createAlbedoTableShader(GenContext& context,
59 DocumentPtr stdLib,

Callers 2

getShadowMapMethod · 0.85
getShadowMapMethod · 0.85

Calls 5

createShaderFunction · 0.85
addOutputMethod · 0.80
createDocumentFunction · 0.50
addNodeMethod · 0.45
setConnectedNodeMethod · 0.45

Tested by

no test coverage detected