Jump to content

how to use RW textures


photo

Recommended Posts

Posted

hi: I'm trying to use RW textures in my code to read and output the same texture

so far i have found only one sample in the render_rw_decal_renders()

 

 

texturerender->setRWTexture(0,buffers->deferred_normal);
  texturerender->setRWTexture(1,buffers->deferred_diffuse);
  texturerender->setRWTexture(2,buffers->deferred_specular);

for the RW textures how do i wrote the mat file? I tried but seems i can't use RW textures.

could you provide a better sample i could test?

 

thanks

 

Posted

also there is a 

#define INIT_RW_TEXTURE(NUM)		RWTexture2D<uint> s_rw_texture_ ## NUM : register(u ## NUM);

compare with a normal texture define

#define INIT_TEXTURE(NUM)				Texture2D s_texture_ ## NUM : register(t ## NUM); SAMPLER(NUM)

what's the difference between u ##NUM and t ## NUM. where i can find it from the c++ code?

thanks

Posted

Hi Cinetec,

 

Materials do not work directly with RW textures. RW textures is basically wrapper on UAV (DX11) and ImageStore/ImageLoad (OpenGL), so it's just analogue of RenderTarget (setColorTexure). You can use it only in TexutreRender.

 

There are few semantics available in UUSL: INIT_RW_TEXTURE TEXTURE_RW_STORE | TEXTURE_RW_LOAD.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

  • 2 years later...
Posted

We also got some problem on  TextureRender::setUnorderedAccess:

All demos on this interface is invoke while TextureRender::USAGE_COMPUTE is enabled, which means it could only be used in computational sharers.

We want to invoke this interface from normal rendering pass,  is there any demos we could refer to?

×
×
  • Create New...