- Home /
Can I get Direct3D pointer of Texture2D in Unity3.5?
In OpenGL mode , I can get OpenGL texture name(ID) with Texture2D GetNativeTextureID().
From Unity3.5 , I can get Direct3D device pointer(IDirect3DDevice9) , but I can't find to get Direct3D Texture Pointer(LPDIRECT3DTEXTURE9).
Is there any method to get Direct3D texture pointer of Texture2D?
I don't know of a way for you to get this. Sorry.
Answer by GeeEll · Mar 08, 2012 at 12:13 AM
Hi!
I have the same problem, getting the texture. How do you get the IDirect3DDevice pointer out of Unity? Have you succeeded in doing so?
Let me know.
Thanks,
Answer by yamaken · Mar 08, 2012 at 04:30 AM
Hi!
I gave up to use Direct3D. Now ,I'm using OpenGL in Windows Standalone & Windows Unity Editor.
Unity.exe -force-opengl <<< for Unity Editor preview
Standalone.exe -force-opengl <<< for Standalone
In standalone build process , [Build&Run] and cancel to run , and I execute it with .bat file .
And using OpenGL 2.x in Windows is very tiresome , but now it works well . ( If you use opengl , search 'glext.h' and 'wglGetProcAddress()' etc)
Thanks
Answer by yamaken · Mar 08, 2012 at 04:30 AM
On Unity 3.5 release , the plugin help was changed , and official example explains to get IDirect3DDevice pointer.
c.f. http://unity3d.com/support/documentation/Manual/NativePluginInterface.html
Thanks
Answer by GeeEll · Mar 08, 2012 at 04:43 PM
Hi!
Thank you so much! We'll definitely look into that, and should we not be able to grab the LPDIRECT3DTEXTURE9 pointer, we'll revert to OpenGL like you did.
Could you not access the texture by using IDirect3dDevice9->GetTexture(stage, ppTexture)? You could make a "fake" texture stage assignation, then pass the stage value to your plugin and get the texture pointer immediately thereafter?
Let me know what you think.
Thanks
,Alright! Thanks!
Answer by yamaken · Mar 08, 2012 at 07:17 PM
Sorry , I'm not sure. I didn't try IDirect3dDevice9->GetTexture(stage, ppTexture).
Your answer
Follow this Question
Related Questions
Unity 3.5 New texture2D not transparent 2 Answers
Non power of 2 question with pixel painting 1 Answer
Texture2d.LoadImage too slow for use (iOS) 1 Answer
Object Texture Showing Blur In Game 1 Answer
Can I create a sprite at runtime? 3 Answers