cakeslice / Outline-Effect

Outline Image Effect for Unity
MIT License
1.48k stars 201 forks source link

SRP Compatibility #47

Open StewVanB opened 4 years ago

StewVanB commented 4 years ago

We used this to great effect before we upgraded to the LWRP. I think that the shaders are not SRP friendly and thus are not being rendered by the render pipeline.

JimmyCushnie commented 4 years ago

You're correct that this library has not been updated for SRP. Currently it only supports the built-in render pipeline.

blakedgross commented 4 years ago

I got a similar effect to work in URP in 2019.3 by adding unique RenderPipelines per Camera in URP. What I did was set up two camera, one main and one rendering to a RT. The main one did the normal blit/sobel pass for edge and took in a texture. The second camera wrote to a RenderTexture and has a custom render pass that rendered whatever renderers were passed to it with an override mat that just did a unlit color pass. Then the sobel shader would get that texture (a frame behind) and check to see if there was color data, and then change the edge color based on that.

JimmyCushnie commented 4 years ago

That sounds very cool. Would you consider open sourcing your implementation?

blakedgross commented 4 years ago

I'll make a branch this weekend with it

xDavidLeon commented 4 years ago

I'll make a branch this weekend with it

I've been trying to port this effect to URP with no success. I've also tried porting the Outline effect from https://github.com/alelievr/HDRP-Custom-Passes , but can't seem to make it work. Do you still plan to share your fork?

blakedgross commented 4 years ago

Yes! Sorry, I realized my way was very inefficient. I can still try and share it. I've been working on another method that uses extra render data.

blakedgross commented 4 years ago

Here's my current progress, the blit isn't working for some reason in this branch, will look into it more, but this is the method I was using: https://github.com/Katerpilet/Outline-Effect/tree/multi_camera_outline

Multiple layers could help make it more like the example

JimmyCushnie commented 4 years ago

Thanks for sharing! I'll take a look at this when I have the time :)