Jump to content
  • Advertisement
Sign in to follow this  
parroteye

Render to specific cubemap mip

This topic is 491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

  Hey all! 

 

I am starting to implement dynamic cubemaps in my renderer. I have to top level mip by rendering 6 faces into 6 separate RTs. I then merge them into a cubemap. 

 

All of this is fine, I now want to filter the mips with some brdf convolution a-la UE4.  I can't find how can I render to a specific mip of the cubemap? I assume I need to render to different cubemaps and then merge them into a mip chain? How can I do this? I am not finding info online...  

To be clear, I am not asking for the convolution technique per se, but just how to set the render to separate mips in d3d or how to merge separate targets into a mip chain. 

 

Thank you very much

 

Jacques

Edited by parroteye

Share this post


Link to post
Share on other sites
Advertisement

If you're using a pixel shader and you would like to write to a specific mip as a render target, you need to create a render target view that specifically targets the mipmap and face index. You can do that by specifying the appropriate values for MipSlice, FirstArraySlice, and ArraySize in the D3D11_TEX2D_ARRAY_RTV struct that's a member of D3D11_RENDER_TARGET_VIEW_DESC (it's the same for D3D12 if you're using that API instead of D3D11). If you're using a compute shader, you have to instead create an unordered access view that targets the mip level that you want to write to. It's basically the same as creating the RTV, where you set the appropriate values for the MipSlice, FirstArraySlice, and ArraySlice members of D3D11_TEX2D_ARRAY_UAV, which is a member of D3D11_UNORDERED_ACCESS_VIEW_DESC.

Share this post


Link to post
Share on other sites
Something to note, the uav way open optimisation as you can produce severalemips in one pass, reducing load bandwidth for example.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!