Jump to content

Inject Shader between finished Velocity Buffer and Taa Shader


photo

Recommended Posts

Posted

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

Posted

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 :)

Posted

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.

  • Like 1
Posted

Another question, in which shader does the value taa_pixel_offset gets applied?

Posted

Is it possible to overload this?

×
×
  • Create New...