Ok, so a couple nights of trial and error I have both ends of this implemented. I can get a video drawing to a material via DrawableQueue, and I can display different imageFiles to each eye in a shaderGraphMaterial. I can't figure out how to glue the two bits together though... I changed the image files in the shader into color inputs, and then at load time I try to:
if var material = cube.model?.materials.first as? ShaderGraphMaterial{
do{
try material.setParameter(name: "left", value:.textureResource(drawableTextureManager.textureResource) ) // <-this throws a ShaderGraphMaterial.Error.incorrectTypeForParameterName
//try material.setParameter(name: "left", value:.color(CGColor(red: 1.0, green: 0.5, blue: 0.0, alpha: 1.0)) ) // <-this works
} catch {
print("oops")
}
cube.model?.materials = [material]
}
So I guess my questions are:
are color inputs the correct way to get textures into a ShaderGraphMaterial?
who do I setParameter with a texture/TextureResource/DrawableQueue
Thanks!