Search Unity

Native plugin interface texture manipulation

Discussion in 'Scripting' started by iko79, Nov 20, 2014.

  1. iko79

    iko79

    Joined:
    Jan 21, 2013
    Posts:
    45
    Hi folks,

    I'm trying to manipulate a D3D9 Texture in native code. I used the RenderingPluginExample42 as a reference. Everything works fine, as long as I assign the Texture to a Renderer Material just as in the example. As soon as I'm trying something slightly different (drawing it via GUI.DrawTexture in the OnGUI method or using it as a source texture for a Graphics.Blit) Unity crashes. I can't imagine I'm doing something terribly wrong in the plugin itself since the code is pretty much straightforward and I just replaced the code that fills the content of the texture.

    Is there some basic limitation to manipulating textures in the UnityRenderEvent, which I'm not aware of?

    Thanks a lot,
    iko

    <edit>
    AAAARGHH!! Guess what. I DID something terribly wrong. Just not comfortable outside of OpenGL, so I thought there must be some mysterious DirectX magic to this. Glad to see it's actually quite simple.
    </edit>
     
    Last edited: Nov 20, 2014