Amazing project aimed at bridging together an output option from Godot 3.4.2 via Spout has arrived from you-win developer on github. Godot is a free and open source game engine that provides many possibilities in whichever multimedia direction you desire.
Upcoming Godot 4.0 (currently in alpha)
Being free and open source with healthy development cycles, we can expect a lot to come out from this. We will be following up with updates and share upcoming news around 4.0 development ( currently in alpha state.)
and now..
Spout for Godot
spout-gd Godot engine module adds support for Spout2 and uses SpoutLibrary.
To note: Spout is Windows-only as noted on their website.
Compiling
- Setup your environment to compile Godot
- Download the SPOUTSDK from the Spout2 repository and place into the
thirdparty/
directory. A dummy folder has been provided - Copy the folders in this repository into their respective folders in Godot
- Patch in FBO support to Godot using the patch provided in the
patches/
directory - Compile Godot
- Copy the
SpoutLibrary.dll
located atthirdparty/SPOUTSDK/SpoutLibrary/Binaries/x64/
next to your new Godot executable. The editor will refuse to run without it -
SpoutGD
is now available to be used via GDScript
Usage
Send the default icon.png
file over Spout. NOTE: This is cpu-bound and is slow relatively to Spout's full capabilities.
var spout: SpoutGD
var image := Image.new()
func _ready():
image.load("res://icon.png")
spout = SpoutGD.new()
spout.set_size(image.get_width(), image.get_height()) # Implicitly used by SpoutGD when sending the image
func _process(delta):
spout.send_image(image)
Send the viewport over Spout. This utilizes the GPU and, in theory, should be very fast.
var spout: SpoutGD
var viewport: Viewport
var viewport_fbo: int # The OpenGL framebuffer object (fbo)
func _ready():
viewport = get_viewport()
spout = SpoutGD.new()
spout.set_size(viewport.size.x, viewport.size.y) # According to the Spout docs, this isn't necessary
# texture_get_fbo must be patched in since this isn't normally exposed by Godot
viewport_fbo = VisualServer.texture_get_fbo(VisualServer.viewport_get_texture(viewport.get_viewport_rid()))
func _process(delta):
spout.send_screen(viewport_fbo)
Spout GD
Godot 4.1.1 bindings for Spout.
The Godot 3 engine module is located on the godot-3
branch.
Status
The sender/receiver apis have been implemented but are mostly untested. Please open an issue if something doesn't seem to work.
Building
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
Basic usage
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())
Discussion (2)
Aw man. Now I have to learn a new visuals suite. Shucks. There goes my evening/weekend/month. /s
XD Looks super cool. Have not messed with Godot yet. Actually really excited. Will be my first compile, too. (Excluding linux make command)
whats XD?