BackBuffer and RenderTarget at one pass?
- Fu-Bama
- Topic Author
I'm trying to make interlaced effect, but current solution has two full-screen resolution render targets.
One to bypass effect and get raw BackBuffer image stored,
second to write that stored raw BackBuffer at the end of the shader to get previous frame without any effects applied.
Code:
Please Log in or Create an account to join the conversation.
- Marty McFly
Also:
int(ReShade::ScreenSize.y * UvCoord.y)
is vpos.y.
Please Log in or Create an account to join the conversation.
- crosire
Additional documentation beside the code Marty mentioned is here (see the "RenderTarget" pass state):
github.com/crosire/reshade-shaders/blob/...ERENCE.md#techniques
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Since it's interlaced shader we don't need full-res render targets, only half vertical resolution.
Even better, we can squeeze both render target outputs into one texture of a screen size.
But hey, if we flip flop write Back Buffer odd rows between top and bottom half of the Render Target, the previous frame will survive till second pass. And we can get rid of the third pass.
I managed to reduce it to 2 passes and one render target.
Here's how the render target looks like:
It flip flops current and previous frame from top to bottom at every frame.
The code:
Please Log in or Create an account to join the conversation.
But it works in Mirrors Edge (2007), RAGE and Blender.
EDIT*
It looks like
ClearRenderTargets = false;
is not working for those
Please Log in or Create an account to join the conversation.
- crosire
This is expected. OpenGL has its origin at the bottom left corner of the screen, while DirectX has its origin at the top left corner. ReShade fixes texture coordinates to match DirectX terminology, but doesn't do so for positions.Fu-Bama wrote: I just noticed that vpos : SV_Position is vertically reversed on OpenGL. Is it a bug? It's counting from the bottom to top at Y channel.
Please Log in or Create an account to join the conversation.
When you un-comment at line 57 where there is // Preview RenderTarget you can see flip flop flashing of black texture when in DX10. That means the game does not preserve data from previous shader run, but clears it. Can it be fixed?
Please Log in or Create an account to join the conversation.
- Marty McFly
Please Log in or Create an account to join the conversation.
Reading from InterlacedTargetBuffer is not necessary in that pass. If I could just leave one half of the target untouched in the memory. BlendEnable = true in pass settings suppose to do that, right? Blend the render target with whatever was present in memory?Marty McFly wrote: Hm. InterlacedTargetPass reads from InterlacedTargetBuffer and writes to it at the same time (...)
But I have no idea how to use it. I don't quite get it from the documentation. github.com/crosire/reshade-shaders/blob/...ERENCE.md#techniques
Please Log in or Create an account to join the conversation.
- Marty McFly
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
Thanks
Code:
Please Log in or Create an account to join the conversation.
- knowom
Please Log in or Create an account to join the conversation.