VR Singlepass Instanced blit not working

I have been trying to wrap my head around getting any kind of screen space effect running in our project, this is a VR only project, using the Universal Render Pipeline and the ScriptableRender Feature

URP version: 10.4.0
Unity version: 2020.3.5f.1

I am not sure what the problem seems to be, but when I try to use CommandBuffer.Blit to apply any effect to the current camera texture, the result is a grey screen for the left eye, and the right eye rendering gets stuck, this seems to happen whenever I try to apply any texture to the camera color texture. But only after drawing Opaque’s, if I do it before, the result simply gets overridden, but rendering still works.
Here is the result whenever I attempt to blit to the camera:

7424894--908789--BlitResult.PNG The Shader used for the Blit is a simple Stereoscopic debug shader that renders the left eye green, and the right eye red, taken from the Unity webpage about Singlepass Instanced rendering: Unity - Manual: Single-pass instanced rendering and custom shaders

I have tried newer Unity versions and URP versions, but none seem to fix the issue, also it does not occur in multi-pass rendering.

@ThomasZeng Sorry for tagging you directly in the post, but after searching through some older forum posts I saw your comment about Blit not working correctly in Singlepass Instanced VR, but I could not find any other official information on this issue.

This is a common problem with VR and I’m not sure if it’s a bug (if you force both eyes the perspectives don’t match).
I have a VR fractal project on GitHub where we fixed the issue. I’m not sure how exactly since I’m not the shader dev, but you can find the code in assets/graphics/raymarching

Thanks for taking the time to reply, I took a look at the project, but unfortunately it’s done with the OnRenderImage function.

This function is not usable in URP, and has been replaced by ScriptableRenderFeatures, which is where I encounter the issue.

It may help you

@Sheynes Thank you very much, this worked!

I did take a look and tried it with cmd.DrawMesh before because that’s what Unity also does for PostProcessing, but I guess I made a mistake earlier.

1 Like