#How do you post process a render texture?

1 messages · Page 1 of 1 (latest)

desert arrow
#

I am working to replicate this 'Outline and edge highlight pixel-art look'

I know HOW to achieve this - Capture your scene at a smaller resolution, sample the depth map and the normal map, perform robert's cross or another edge highlighting process, blit that back overtop.

But how do I actually DO that? I've tried a few attempts using Full SCreen Pass renderer features, but they don't work because the full screen is 1920x1080 and I don't want to actually downscale my full entire viewport.

The workaround I have is I have a camera that is outputting to a small render texture that is then a Raw Image in the UI layer (for now, just to get this working) but the problem im having there is I don't know how to blit a render texture.

How do you apply shader proccessesses to a render texture?

unique juniper
#

Maybe there was more to it, like waiting a frame on the capture. Been a minute

desert arrow
#

Oh like have a component running in scene calling blit on update?

#

I thought this would have to be part of the render pipeline or something

unique juniper
#

This is more local and not really full-screen though. It's like taking the image then applying the shader it to so local post-processing

#

You can use Graphics.Blit to create post-processing effects, by setting mat to a material with a custom shader.

desert arrow
#

Hm I see, and do the shader code in that material

#

I guess I will look into graphics blitting on update to the render texture file?

unique juniper
#

yeah I think that's the idea. I know for sure this is the quickest way to really do screen capturing with the API because I was dealing with frame drops with every other methods I'ved tried

#

Are you sure though that using render texture on a quad then applying a shader doesn't meet the requirements?

#

Like fullscreen quad

desert arrow
unique juniper
#

rather, I'm not entirely sure of the problem with the full screen pass with post-processing. Is the problem that you don't want all the geometry downscaled? In that case I would just do independent outline materials and forget post-processing. Another idea is use a secondary to viewport to render those you want with outlines and ignore the rest (may need to resolve sorting issues), then do the outlining after it's rasterized if the post-processing outlines don't provide decent outlining

#

So, the blit idea would work for the independent renders if you want to modify the texture afterwards

desert arrow
#

I'm trying to replicate this look, thats my goal, by any means possible

#

the problem is the outline code requires the source image to be very small

#

it has to be actually 160x90, not 1600x900, or else it doesn't outline right

#

but I dont want my entire unity game to be 160x90, I want high res UI and other tech

#

so I need some way to render, get a downsized capture of the game to perform shader code on, one that contains depth and normals

#

but I dont know how to do that

#

here is another example that shows that its do-able

#

but I dont want to buy their package because I dont like using other people's code, I struggle IMMENSELY to achieve MY specific look and workflow when using someone else's code, other people's code is a black box that I find impossible to understand and modify

unique juniper
#

I've seen this style around quite a bit lately and been meaning to try something out similar myself

#

not a big fan of the outlines though, at least on the character. It's pixelizing after the post-process lines which seems pretty harsh but I guess that's just the style

#

like the geometry it looks nice

desert arrow
#

Yeah it doesnt look good if you use a high detail model