Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spout Input as Sprites! #26

Open
OfficialIncubo opened this issue Feb 7, 2024 · 6 comments
Open

Spout Input as Sprites! #26

OfficialIncubo opened this issue Feb 7, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request important Something important needs this issue being very active. need help Anyone needs help!
Milestone

Comments

@OfficialIncubo
Copy link
Owner

OfficialIncubo commented Feb 7, 2024

Hey! It would be cool if this feature will be integrated in! This will be the true Mini-NestDrop!

The usage:
If you want to invoke a sprite as a Spout Input, then beatdrop_img.ini will be necessary to access images/Spout Inputs.

Add Spout/SpoutInputName before img= on any digit headers you want, so it should be able to access it. SpoutInputName is the Spout Sender name that you want to invoke it, else it gets an error.

For example: The Spout OBS Plug-in Sender Name that I route from a YouTube Video is YouTubeSpoutActivator, so it should be img=Spout/YouTubeSpoutActivator in the [img11] header on beatdrop_img.ini.
If I try to change to Sprite Mode and type 11 (e.g. K11), it will invoke a Spout Input Sprite routed from OBS.

Killing/Clearing a Spout Sprite (e.g. In sprite mode, pressed DEL or CTRL+SHIFT+K), it should stop and releasing the received Spout texture, freeing up some resources.

Hey, @leadedge, a.k.a. Lynn Jarvis, you are the one who made the Spout Output Integration of BeatDrop and I am the one who improves this project. Will it be possible to add a Spout Sprite Input functionality like the example that I have mentioned?

Closes Issue #4.

@OfficialIncubo OfficialIncubo added enhancement New feature or request need help Anyone needs help! labels Feb 7, 2024
@OfficialIncubo OfficialIncubo added this to the Version 1.3.2 milestone Feb 7, 2024
@OfficialIncubo OfficialIncubo added the important Something important needs this issue being very active. label Feb 7, 2024
@leadedge
Copy link

leadedge commented Feb 8, 2024

You would have to set up a receiver or multiple receivers somehow, but it should be possible. I can't remember whether you are using OpenGL or DirectX but The example receiver source code for OpenGL or SpoutDX for DirectX and Windows applications would be a reference.

@OfficialIncubo
Copy link
Owner Author

OfficialIncubo commented Feb 8, 2024

I can't remember whether you are using OpenGL or DirectX but The example receiver source code for OpenGL or SpoutDX for DirectX and Windows applications would be a reference.

Yes! BeatDrop only uses SpoutDX for performance improvement, also for Spout Output (I think).
Where can I paste the entire code of "Tutorial07.cpp"? In plugin.cpp, I think there's a Sprite Activation, so what should I enable support for Spout Input Sprites when it detects img=Spout/InputName?

@leadedge
Copy link

leadedge commented Feb 8, 2024

Tutorial07 is a complete example from Microsoft, modified for Spout functions, so it's not possible to copy/paste the entire thing.

Unfortunately, I forgot that BeatDrop uses DirectX 9, so this is a relevant example using SpoutDX9. ReceiveDX9Texture will give a texture to work with. I am sorry that I can't assist with BeatDrop code.

@OfficialIncubo OfficialIncubo moved this to Version 1.3.2 Milestone in BeatDrop Version Milestone Feb 9, 2024
@OfficialIncubo
Copy link
Owner Author

I am sorry that I can't assist with BeatDrop code.

Well ok! :) If you have more time assisting the BeatDrop code, then tell me.
This should be postponed in version v1.3.3 because it's been long months that the new version isn't released. After finishing the Drag and Drop MilkDrop Preset Feature, I should release the version 1.3.2 with lots of fixes and optimizations (and a new feature).

@OfficialIncubo OfficialIncubo moved this from Version 1.3.2 Milestone to Version 1.3.3 Milestone in BeatDrop Version Milestone Feb 26, 2024
@OfficialIncubo OfficialIncubo pinned this issue Mar 5, 2024
@OfficialIncubo
Copy link
Owner Author

But hey, @leadedge! You can take a look in plugin.cpp -> bool CPlugin::LaunchSprite -> part of the comment starting from // 1. read in image filename. This is a functionality that gets an image filename, which it would have ability to read the Spout\ prefix then the sender name, so it should have to receive the Spout Texture as a sprite and it will be effected by the init and per-frame code from the image ini file, like NestDrop.

You can also look in texmgr.cpp -> int texmgr::LoadTex. As you can see that it's an algorithm that it loads a sprite or a texture.

A question: should it work if I try to receive a selected Spout Sender Texture (ex. YouTubeSpoutActivator) read from the image ini file, for example ReceiveDX9Texture(YouTubeSpoutActivator)?

@leadedge
Copy link

leadedge commented Mar 6, 2024

There is no support in SpoutDX9 for image files or pixel buffers. You might be able to import the images to a surface with D3DXLoadSurfaceFromFile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request important Something important needs this issue being very active. need help Anyone needs help!
Projects
Status: Version 1.3.3 Milestone
Development

No branches or pull requests

2 participants