January 13, 2011 at 12:57 pm #5138Brian ChasalowParticipant
test it out, let me know if you experience any problems. it’s on the google code syphon implementations website. All you have to do is add SyphonClientBridge to any chosen client objects, and SyphonServerBridge to your main camera.
If you’re using -any transparent shaders- in Unity, you should for now use ‘Syphon/Transparent/x’ or ‘Syphon/Particles/x’ instead of the default transparent shaders. Basically what I’ve done there is commented out any ‘Colormask RGB’ commands in the shaders so that they will write values to the alpha channel (and with surface shaders in particular you have to edit the compiled shader, but don’t worry too much about it if you don’t want to change anything)
terrain is an issue as they have an alpha value of 0.0f for efficiency reasons, so you need to modify the built in terrain shader to have an alpha of 1.0f. The relevant file is known as Hidden/TerrainEngine/Splatmap/Lightmap-FirstPass – you have to keep the same name when overriding terrain engine shaders and it will ‘magically’ use the overridden one instead. With terrain and syphon, you run into an issue where if you’re not looking at a solid mesh object in the scene at any point in time, the screen texture will go blank (!?) perhaps due to engine optimizations? this has occurred in the past, but usually it’s been due to having ‘colormask rgb’ in the scene in a shader somewhere. perhaps terrain has an optimization built in that similarly causes issues.
one workaround for this is to render a backdrop behind all objects in the scene, and this will prevent that from occurring. Bob Berkebile’s Backdrop script helps in this regard: http://pixelplacement.com/2010/12/17/the-solution-to-image-backgrounds-in-unity/ – i modified this for my own use but his should work just as well. You can even use a null image (transparent mesh geometry) as the background and this will fix it.
anyway, have fun- everything seems to work well as long as you have no ‘colormask rgb’ shaders in your scene.
brian chasalowJanuary 13, 2011 at 12:59 pm #5139Brian ChasalowParticipant
and this probably goes in the ‘implementations’ forum. oops.
- You must be logged in to reply to this topic.