Matchbox API Questions

This is a questions for @FriendsFromAutodesk. Not sure what the correct channel is for some of these, if there’s a better process, please let me know. Specific question below, but may have other questions in the future.

I have another matchbox shader I’m thinking about, that would benefit from multiple outputs (in a simple case it could be multiple image textures, but in this case I’m actually thinking data channel). It’s a shader that represent a pre- and post-process step and I’d love to pass on some data from the first to the second instance. But it would be easy to encode that in the the first few pixels of a standard 2nd image texture output.

Right now all shaders I looked at only use gl_FragColor.

There’s a multi execution shader example that’s great, and there’s a mipmap example that uses gl_FragData to pass two sets between passes. But I haven’t found an example of a shader that can output two image textures on the final pass. Kind of what the Separate node does with outputting RGB textures.

Is such a think structurally impossible, or is it possible and there’s just no example?

After looking into the code options more, this particular idea doesn’t seem a good fit/is not feasible as a shader. So I turned it into a feature request instead.

It could be a straight forward improvement to the resize node which has just gotten a nice facelift. Purpose is to simplify the handling of ROIs in a batch node graph by adding an ‘invert’ to the crop node. And possibly auto-detect the ROI from the matte input.

Feature request, in case anyone wants to upvote it: Welcome to our Feedback Community

1 Like

I believe Matchbox is limited to a single output.

LS_Lumps only outputs one pass at a time - if Lewis can’t do it, it probably can’t be done.



That’s what I suspect, and I looked at L_Lumps among others for that reason.

GLSL has a mechanism for returning multiple textures, and one of ADSK’s sample shaders uses it, but it’s only used between render passes, not as the final result.

So I’m assuming the code used to run a shader is not paying attention to more than one. Which is not unreasonable by any means, but an unfortunate limitation, if confirmed.