1
0
mirror of https://github.com/CLfamilaris/VRDOM.git synced 2024-11-23 18:50:56 +01:00
VRDOM/addons/spout_gd
2024-03-10 13:33:49 +01:00
..
~spout_gd.windows.template_debug.dll Foot tracker support and Spout2 for capture! 2024-03-10 13:33:49 +01:00
README.md Foot tracker support and Spout2 for capture! 2024-03-10 13:33:49 +01:00
spout_gd.gdextension Foot tracker support and Spout2 for capture! 2024-03-10 13:33:49 +01:00
spout_gd.windows.template_debug.dll Foot tracker support and Spout2 for capture! 2024-03-10 13:33:49 +01:00
spout_gd.windows.template_release.dll Foot tracker support and Spout2 for capture! 2024-03-10 13:33:49 +01:00
SpoutLibrary.dll Foot tracker support and Spout2 for capture! 2024-03-10 13:33:49 +01:00

Spout GD

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.

Status

The sender/receiver apis have been implemented. 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())

SpoutTexture - Simple Receiving

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.

SpoutViewport - Simple Sending

By wrapping the scene you wish to render in a 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.