benkuper / Unity-Plugins

My collection of Unity Plugins
BSD 2-Clause "Simplified" License
17 stars 6 forks source link

DX9 mode? #8

Open hybridherbst opened 9 years ago

hybridherbst commented 9 years ago

I took a look at the source and saw that DX9 mode is just not implemented yet. Do you have plans to do one in the near future? I'm experiencing issues with DX11 mode on Windows 8.1 (sharing from Unity to SpoutSDK does not work, inbetween Unity does).

sheridanis commented 9 years ago

Unity doesn't use directX 9 only 11 - Also unity to spout2 works fine for me with Ben's tools for both 32 bit and 64bit under Windows 8.1 - what GPU are you using?

hybridherbst commented 9 years ago

Of course Unity can use DX9 and DX11. And what is not working for me is sharing from Unity DX11 to any other Spout DX 11 application, including the samples (https://github.com/leadedge/Spout2/tree/master/DEMO/Win32). Does that work for you? Using the DX9 mode, at least the Spout samples work on Windows 8.1.

GPU is Intel HD 5000, should be fully DX11-compatible.

leadedge commented 9 years ago

soraryu,

the problem is likely to be with the Intel graphics. Several other people have had problems with Intel and the only solution has been to use DirectX 9. Versions of plugins and applications compiled for both DirectX 9 and DirectX 11 are planned for the next Spout release, but Unity requires DirectX 11.

Sorry that I have been unable to track down exactly what is failing because I don't have an Intel machine set up. I believe it is Intel's implementation of the GL/DX extensions but with Processing we found a different backbuffer format from the usual default, so there might be other reasons.

If there is a way to use DirectX 9 within Unity I would be keen to see how it can be done and Ben also I am sure.

Lynn Jarvis

hybridherbst commented 9 years ago

Too bad, since for this project I'm bound to Intel Graphics (has to run on specific machines). I think for Unity using OpenGL directly (can be chosen on Win via command line flag) should be a possibility, any chance to get a plugin for that?

Why does Unity require DX11? According to the docs, the NativeTexturePtr (http://docs.unity3d.com/ScriptReference/Texture.GetNativeTexturePtr.html) is also available for DX9 and OpenGL inside Unity.

benkuper commented 9 years ago

Yes, it is true that Unity supports OpenGL, but Spout is using DirectX to share texture. OpenGL apps using Spout actually convert the texture to directx before sharing them. I originally developped Spout with DX9 in mind, but this was constraining the texture format to GBRA, which is really not convenient. This was then a common decision with the Spout team to move to DirectX11 and drop the support for DX9. Sorry for the inconvenience..

benkuper commented 9 years ago

I may have some time next week to look into OpenGL support. I'll keep you updated

hybridherbst commented 9 years ago

That would be cool! I already found a workaround for my current problem (I dropped Spout entirely and just used shared DX11 textures directly, so please don't feel pressured to do that work now if you feel that other things are more needed), but still it would be good to have that option.