keijiro / KlakSpout

Spout plugin for Unity
The Unlicense
664 stars 99 forks source link

sending spout that renders only 1 layer doesn't work #12

Closed zombience closed 6 years ago

zombience commented 6 years ago

I encountered an issue where a spout sender attached to a camera that is only rendering one layer sends an image that includes all render layers.

Unity 2017.3.1f1, Win 10 GTX 1080Ti

keijiro commented 6 years ago

Thanks for reporting. Could you provide a minimum project that reproduces the issue?

zombience commented 6 years ago

I have used the "Test" scene from the github project. I created two cameras, one rendering only "layer1", and the other rendering only "layer2". If these are the only two cameras, I do not receive a spout image in receiving application.

(For this test I am using Touch Designer build 16620, I have included a very basic TD file that I used to test) In Touchdesigner, I receive no Images unless I turn on the toggle for "Use Spout Active Sender" and then I get both layers visible. If there is another camera in the scene rendering only the skybox, with NO spout sender attached, the skybox appears in Touchdesigner (but only when "Use Spout Active Sender" is active. Otherwise no image appears).

Thank you for looking into this. I appreciate your high quality work!

SpoutLayerIssue_TD.zip LayerIssueExample.zip

keijiro commented 6 years ago

It sends both layers because the camera clear flag is set to "depth only" (the render is mixed because the cameras don't clear the frame buffer). Please change the clear flags of these cameras to "Solid Color" or "Skybox", then I think it works as you intended.

zombience commented 6 years ago

Thank you for looking into this issue. In this Spout / Unity plugin, spout senders from Unity are able to handle sending camera data with a clear flag set to depth only, such that only the desired layer is sent over the spout sender. I wrongly assumed that yours would do the same.

I see this issue is not a bug. Would you consider making this a feature? The other spout plugin for unity has a bug that prevents me from using it in a build.

Thank you again for your work

keijiro commented 6 years ago

I think you can send only the desired layer by setting the camera clear flag to "Solid Color".

keijiro commented 6 years ago

I'm closing this issue. Please feel free to reopen for further questions.