#How to properly capture screen behind the object (2D URP)

1 messages · Page 1 of 1 (latest)

fierce turtle
#

I recently started learning shaders and I wanted to create effect that would warp space around object. I did create it, but am struggling to apply it to like world space instead of object texture.

Simple example: I place an empty frame in scene, I want scene pixels in that frame to get into my shader.

I tried using Scene Color node but all it does is render grey color. I made sure to set graph type to unlit (also tried just about every graph type), transparent surface type, enabled opaque texture both in main camera and URP asset, but it's still grey...

I had some success with fullscreen shader but I'd like to avoid using it as it affects entire view instead of specified area like I want it to.

Unity version: 6.3

limpid frigate
#

Afaik Scene Color node doesn't work in 2D. (In 3d it uses the "opaque texture" which doesn't make much sense in terms of sprites which are usually all rendered in transparent queue, so URP doesn't generate it for 2D Renderer)

The 2D Renderer asset should have a "Camera Sorting Layer Texture" option which is similar (passed to _CameraSortingLayerTexure Texture2D reference, global/unexposed)

green lagoon
#

Shaders must always be on an object, or the whole screen, so conceptually you cannot "place" a shader between two objects

#

The Camera Sorting Layer Texture feature captures specified sorting layers onto a texture, which can then be used by objects in their shaders

fierce turtle