Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
jobrandh's avatar
jobrandh
Honored Guest
9 years ago

Update texture in OculusRoomTiny example (DX11)

Hi!

I've been digging through the wonderful examples in the 0.8 SDK and I've been writing my own application by modifying the tiny room example. I'm currently stuck on trying to update a texture dynamically (every other frame or so), and my DX11-fu is not nearly strong enough to figure it out.

Does anyone know how to update for example one of the walls to use data from an image frame (assume data is well formatted in an array with size known)?

The Win32_DirectXAppUtil.h has a Texture struct that seems to be the right place but I cant figure out what I need to do.

Thanks for any help!

4 Replies

  • jobrandh's avatar
    jobrandh
    Honored Guest
    Thanks for the link, but I was wondering if anyone else had specific experience with the example in Win32_DirectXAppUtil.h. The link is about DX9 and the 0.8 SDK implementation is using DX11. My googling has led me to believe that I may need to use the "Map" function https://msdn.microsoft.com/en-us/librar ... 57(v=vs.85).aspx, but I was looking to see if anyone else had tackled a problem like this before.

    Thanks!
  • IMO this should be easy, however depending what you want to do.

    I would recommend starting with switching between two textures:
    * Create two D3D11 textures
    * Fill them with whatever resources are needed
    * At rendering stage, switch between them by binding different textures to the same shader slot

    As far as I remember D3D11 correctly, there is this thing called Shader Resource View (SRV). You need to do the binding there.

    More details when I get home from work. :)