Comments (7)
Texture formats are limited by the GL/DX interop extension. The specifications do not specifically describe DirectX formats other than an example using D3DFMT_A8R8G8B8, so I tried every format possible by trial and error. This is a while back now but the results for 8 bit formats are documented in "SpoutSDK.h". Final supported formats are documented in "SpoutGLDXinterop.cpp". On the OpenGL side the format has to match, so GL_RGBA is used throughout.
from spout2.
I should add that SendImage supports OpenGL RGBA, BGRA, RGB, and BGR if that is any help.
from spout2.
I think there should be a way to send grayscale texture, because converting frame at 1280x1024@240fps is annoying :-)
Moreover when I send this texture as a regular colorful texture, I receive some data on the other side but they are taken as a color image and thus wrongly unpack.
So one workaround I see to the DX limitation (if it still exists) is to send grayscale texture as color texture but add some meta data to say the receiver this is a grayscale image and it should process it differently.
I don't know how metada (resolution for instance) are passed to the receiver nor if there is such a communication channel with SPout
from spout2.
From tests I have made, the GL/DX interop does not support luminance format. The only way is to convert using OpenGL methods and I have thought more about this.
In your case, you need to send image pixels and not a luminance texture. So if you create an rgba texture you should be able to fill it with the luminance image data using glTexSubImage2D .
glBindTexture(GL_TEXTURE_2D, rgbaTexID);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, (GLvoid *)pixels);
glBindTexture(GL_TEXTURE_2D, 0);
Then use SendTexture with the RGBA texture.
If that works, SendImage could be modified to accept GL_LUMINANCE. I am committed to other work at the moment, so can't investigate this right away but will put it on the list.
from spout2.
Also you might need to add -
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
from spout2.
thanks a lot, it works !
from spout2.
OK. I will look at what is involved to add it to the SendImage function. Meanwhile I will close this as resolved.
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
- Receiver的图像翻转了,如何把他摆正方位 HOT 2
- It seems that Directx 12 support is not included in pre-built binaries of the libraries by default? HOT 2
- Questions about SpoutDX and SPoutDX12 HOT 5
- Release 2.007.014 seems incorrectly tagged as v2.005 HOT 1
- Spout2 suddenly not working in obs 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.