LWRP, Render Pass Blit and VR

Hello,
I’ve come across these videos ( this one and this one) on youtube about custom renderer for LWRP, with “Blit” and “Render Object”, and I wanted to try it in my VR Project.
However, the rendering is messed up: it renders 2 eyes in each eye…
I am linking the 2 scripts + the SobelFilter shader that I am using, which come from the second linked video above, and I have no idea where the issue might come from (probably the Blit, but my knowledge is limited).
Could you please help me pinpoint the problem?
Thanks !

5163335–512045–Blit.cs (1.84 KB)
5163335–512048–BlitPass.cs (3.04 KB)
5163335–512051–SobelFilter.shader (4.24 KB)

use UnityStereoScreenSpaceUVAdjust.

see Graphics.Blit() section.

warning.
core.hlsl doesn’t include UnityStereoScreenSpaceUVAdjust function.
i copy it from UnityCG.cginc.

Thanks ! It worked !!

Tsequier podrias mostrar un ejemplo mas claro tambien estoy con ese problema y aun no entiendo

@morenogarciaalejandro07 Here is the correction of the SobelShader that I linked in the original post using UnityStereoScreenSpaceUVAdjust, I think every modification happen in the frag{ }

Hope it helps!

5332140–537231–SobelFilter.shader (4.36 KB)

2 Likes

Ah we can update the shader to proper support XR. If anyone is curious URP declares UnityStereoTransformScreenSpaceTex function which is the same as UnityStereoScreenSpaceUVAdjust

1 Like

I’m spending a chunk of time tracking down these new function names to update old shaders. I wish I had found this doc page sooner:
https://teofilobd.github.io/unity/shaders/urp/graphics/2020/05/18/From-Built-in-to-URP.html

Also, I’ve found two files that define general purpose shader functions with new names, which I am using as my reference:

nooooo!
@chrismarch_1 the link is down sadly.
Thank you anyways for sharing

1 Like

Web Archive is your friend for resurrecting old links:
https://web.archive.org/web/20201128101109/https://teofilobd.github.io/unity/shaders/urp/graphics/2020/05/18/From-Built-in-to-URP.html