Comments (2)
Yes for 2.006 there are :
bool spoutGLDXinterop::WriteTexture(ID3D11Texture2D** texture)
bool spoutGLDXinterop::ReadTexture(ID3D11Texture2D** texture)
For a sender you have to make sure the sender is created and the texture sizes match. A receiver has to monitor the sender size to make sure the receiving texture is updated.
I have been working on DirectX examples. You could use the beta code, but I am not happy with the SpoutDX class and it's under revision. Hopefully the examples will give you some idea.
The important thing to note is use of the sender mutex before the shared texture is copied. The 2.007 methods include a frame counter, but that can be removed for 2.006 applications.
Problems I have found are. Matching format is important if you want to create a shader resource view of the received texture. If the sending texture has a keyed mutex, it must be accessed or the texture will not be copied. You will have to check for this if the texture is used to interface with a Vulkan image. I will be updating the mutex check to include keyed mutex if the texture has one.
It might seem ideal to access the sender's shared DirectX texture directly, but it is not that simple. The main difficulty is with CopyResource which is asynchronous. The received texture might not be updated immediately, depending on the command queue. This means that a receiver will display a new frame after a random delay. If this happens to occur right on vertical sync, you could see hesitations.
To overcome that I have introduced a flush and wait until CopyResource is finished. This is not a problem if the DirectX device is created simply for the purpose of creating and copying textures, because there is no queue. But it could be a problem if the application device is used and the command queue is backed up. Then you might get a stall. This is extremely difficult to test, so it is a matter of trying it with or without the flush.
So it is achievable with some caution. The Unity and Unreal Engine plugins use DirectX texture copy already and they are having success. I think they shoud use the sender mutex but it seems to be working for them.
from spout2.
Thanks, that's great, will try to integrate it like that !
from spout2.
Related Issues (20)
- I found 1-2 frame delay fluctuation when I used spout for texture transmission. How can I eliminate this delay? HOT 7
- Windows on ARM binaries missing HOT 8
- Exclude binaries from repo HOT 1
- Recommended API and method HOT 4
- A way to build Demo/SpoutSender.exe and Demo/SpoutReceiver.exe HOT 1
- Getting nullptr textures with spout receiver HOT 5
- Spout with WebGPU HOT 6
- D3D11 Format HOT 28
- SpoutSender/Receiver sourcecode HOT 5
- SpoutLibrary : unable to setup multiple named Spout Receivers HOT 11
- Unused #include <d3d9.h> in SpoutLibrary.h makes compilation with JUCE fail. HOT 2
- GL-Spout-NDI-DX ? HOT 3
- Global registry settings HOT 3
- Multiple Senders in SpoutDX HOT 4
- CPU sharing flag is always false in OpenSpout HOT 7
- Small code issue in SpoutGL.cpp HOT 3
- Use SendImage without using OF, Cinder, etc. HOT 2
- flickering because receiver sometimes can't access the shared texture. HOT 5
- Add ossia to the list of Spout-compatible software :) HOT 3
- Should the solutions be removed from the repo? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spout2.