Godot 4.2.1 bindings for Spout.
The Godot 3 engine module is located on the godot-3
branch.
Precompiled builds of the plugin can be found in the releases section of github.
The sender/receiver apis have been implemented. Please open an issue if something doesn't seem to work.
Prerequisites:
- Windows (Spout only works on Windows)
- git
- bash
- scons
- a C++ compiler capable of compiling Godot
- cmake
Clone the repository: git clone --recurse-submodules https://github.com/you-win/spout-gd.git
Run build.sh
in a bash-compatible terminal. This will:
- Compile Spout2
- Compile the gdextension bindings
- Compile spout-gd
Once compilation is finished, the following files should be moved to your project's addons/spout-gd
folder (create it manually if it does not exist):
spout_gd.gdextension
Spout2/Binaries/x64/SpoutLibrary.dll
out/pick_the_correct_file_here.dll
var spout: Spout
var my_image: Image = load_from_somewhere_idk() # Provide your own image somehow
func _ready():
spout = Spout.new()
spout.send_image(my_image, image.get_width(), image.get_height())
Provided as a convenience is a Texture resource for receiving streams from a Spout sender. You can use this any place you can use any other kind of Texture, including places like UI elements and Materials on 3D objects.
The sender is polled per render cycle.
![](https://private-user-images.githubusercontent.com/316728/287570341-989389ab-23ed-4ae0-8ccc-ca9ba51f6346.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1ODU1NDIsIm5iZiI6MTcyNDU4NTI0MiwicGF0aCI6Ii8zMTY3MjgvMjg3NTcwMzQxLTk4OTM4OWFiLTIzZWQtNGFlMC04Y2NjLWNhOWJhNTFmNjM0Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNVQxMTI3MjJaJlgt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SpoutViewport, you can easily send render target contents over Spout. Simply use it the same way as you would a SubViewport, and assign a sender name for it to assume.
The SpoutViewport is designed to only send during application run time, not within the editor. This helps prevent creating multiple senders with the same name during testing, allowing for more stable capture.
![](https://private-user-images.githubusercontent.com/316728/309019358-08a021a6-eaab-408e-9961-51adac31e958.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1ODU1NDIsIm5iZiI6MTcyNDU4NTI0MiwicGF0aCI6Ii8zMTY3MjgvMzA5MDE5MzU4LTA4YTAyMWE2LWVhYWItNDA4ZS05OTYxLTUxYWRhYzMxZTk1OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNVQxMTI3MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kMzc2ZmMwYmZiMjFiZDY1ZDRiMzUxMjQ0MzA5Y2EwMWNiZWUyYTc5ZGFiNTBlZjBjNzhlOTJlNzFiMGI3MDNlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.3KDJWr9H-__rfEvDrwE9vvLzt-MKjxfTK8coszjwVpI)