This is the code in the pass i use to do the copy of the textures
Pass //2 BLIT BACKGROUND
{
Name "ColorBlitPasss"
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
//#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
#include "BlitTAA.hlsl"//v0.2
#pragma vertex Vert
#pragma fragment Frag
//
float4 Frag(VaryingsB input) : SV_Target0
{
// this is needed so we account XR platform differences in how they handle texture arrays
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
// sample the texture using the SAMPLE_TEXTURE2D_X_LOD
float2 uv = input.texcoord.xy;
half4 color = SAMPLE_TEXTURE2D_X_LOD(_BlitTexture, sampler_LinearRepeat, uv, _BlitMipLevel);
// Inverts the sampled color
//return half4(1, 1, 1, 1) - color;
return color;
}
ENDHLSL
}
Note that this code below worked in the pre-RenderGraph system
It actually does, but there is a few cases where does not work or need to control the event it goes into. The issue is with the jitter that may conflict with other temporal AA implementations that are per module.
The Temporal AA i use is also much more stable then STP, so is more ideal, is same as the Unity Temporal on camera and little better
This is great to hear! Thanks that you kept pushing and for the feedback. It is encouraging that this thread could help and that the transition has positive results.
I have to say i was surprised by how it all worked directly after realized what had to do to incorporate the 3D texture rendering into the RenderGraph, it is really very powerful and much easier as well because of no need to handle the texture clearing.
And is same performant or more now that perfected all work, which is amazing
Thanks again for the guidance on this, really helped a lot find the right way to go about addressing the issue
Iām trying to understand how rendergraph works by readingcodes From URP Samples(like DLC in packages),something weird happened.
In rendergraph sample - FramebufferFetch which shows how to get activeColorTexture B channel and copy it backļ¼to introduce how fetch works.
first step works wellļ¼but in copypass ļ¼the _UnityFBInput0 might changed to depth texture but not our resultsā¦
I try to change copy pass to Blitpass ļ¼except for losing fetch, it works fine.(Better to write another fetchPass like sample does,but Isnāt that what copypass does?).
The same problem occurred with sample-copyRenderFeature, which use addcopypass,sometimes it will change to depth,Sometimes works wellā¦
my version is 6000.23 and use urp template project.
how copypass actually worksļ¼depth texture is error fallback?
Itās really frustrating to have an error in the sample(because Iām wondering if Iāve got something wrong until I find out why)
what graphics api are you using? there is currently an issue with the framebuffer fetch fallback on directX. On graphics APIs that FBF is not natively supported, we automatically handle that using a regular texture sample but there are some issues with that currently. Does it work if you switch to vulkan? the fix should land this week, and can be available in patch release in a few weeks.
Iām using default DX11, unity6-0.23, URP17.0.3ļ¼URP template project, PC-RPAsset, RTX2060.The code is FrameBufferFetchRenderFeature in RenderGraph of URPSample
After taking your advice I switched graphics APIs to DX12 and vulkan also wrongļ¼It doesnāt look like the graphics API is causing the problem.
I tried to tweak some settings and found some issues-
The first is that in RPAsset if you set Opaque DownSampling to none (or just turn off the OpaqueTexture setting) the effect is correct.
Then I tried to modify the injection queue for the pass which original code was BeforeRenderingTransparent (450 in enum)
Environmentļ¼ DX11 DX12 vulkan cause same error(not your guys fault lol), PCAsset
First, the Fallback with the red Depth is not affected by the pipeline turning off the DepthTexture.
At 300-399, regardless of whether OpaqueTexture is on or not, the Scene view is correct, and the Game view (MainCamera) is still Depth.
At 450-499, the effect is correct with OpaqueTexture off, but error when it is on,in both Scene and Game.
Itās working fine at other ranges.
I noticed that when I turn on OpaqueTexture there is an extra CopyColor Pass, is the problem related to this pass? If itās not related to the graphics API, could it be a problem somewhere in the code? Hope this helps.
Anyway, I can get it working correctly now, thanks for the suggestion~.
ah missed that you were using a depthTexture. Framebuffer fetch (that is used in the copyPass) doesnāt work with a depth format. In most cases the depth copy is a color format, but not always (for example when using a prepass). You need to use BlitPass instead.