sebastian.vesenmayer Posted January 20, 2022 Share Posted January 20, 2022 Hi, we want to prototype some modifications on the TAA Shader. Therefore we need to add a new input Texture in the TAA Shader. We also need a Shaderpass between the finished Velocity Buffer and TAA invocation where we can read velocity buffer texture and write to the texture which the TAA shader should consume. Are there any code samples to achieve this or can you give us some pseudo code, how to do it. Thanks Sebastian Link to comment
sweetluna Posted January 21, 2022 Share Posted January 21, 2022 Hi sebastian, You can try using Render::CALLBACK_BEGIN_TAA and pass it to Render::addCallback. To get velocity buffer - Render::getTextureGBufferVelocity. To get temporary texture - Render::getTemporaryTexture. Hope it helps! May RenderDoc/Nsight Graphics/Intel GPA bless you Link to comment
sebastian.vesenmayer Posted January 21, 2022 Author Share Posted January 21, 2022 Hi sweetluna, thanks but a bit to high level and I run into problems here. RenderTargetPtr rt; TexturePtr texture; void callbackBody() { auto width = Renderer::getWidth(); auto height = Renderer::getHeight(); texture = Render::getTemporaryTexture(width, height, Unigine::Texture::FORMAT_RGBA8, Unigine::Texture::USAGE_READWRITE | Unigine::Texture::USAGE_RENDER); auto mat = Materials::findBaseMaterial("new_Pixels"); Renderer::setMaterial(Render::PASS_POST, mat); if (!rt) { rt = RenderTarget::create(); } rt->unbindAll(); rt->enable(); rt->bindColorTexture(0, Renderer::getTextureGBufferVelocity()); //rt->bindUnorderedAccessTexture(0, texture, 0); //<- Crashes Ffp::renderScreen(); rt->disable(); rt->unbindAll(); } int AppWorldLogic::init() { Render::addCallback(Render::CALLBACK_BEGIN_TAA, MakeCallback(callbackBody)); return 1; } Code compiles but I get no screen ouput when callback gets executed asn sometimes crashes when Ffp::renderScreen gets executed. I also cannot bind and Unordered Access Texture. It will crash immediatly when I try this. And how do I get my texture into the TAA shader then? Is there any in deep documentation or examples on these callbacks? Thanks :) Link to comment
sebastian.vesenmayer Posted January 21, 2022 Author Share Posted January 21, 2022 Hi I managed to get it working with a compute shader now and have been able to move the texture to the taa shader. Thanks. 1 Link to comment
sebastian.vesenmayer Posted January 26, 2022 Author Share Posted January 26, 2022 Another question, in which shader does the value taa_pixel_offset gets applied? Link to comment
silent Posted January 26, 2022 Share Posted January 26, 2022 It's applied directly to the final projection (on CPU side): How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted January 26, 2022 Author Share Posted January 26, 2022 Is it possible to overload this? Link to comment
silent Posted January 26, 2022 Share Posted January 26, 2022 I suppose so, you can try to do it in RENDER_CALLBACK_BEGIN_SCREEN (do a projection matrix compensation). How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts