#How to make only certain objects pixelated/have different post processing in URP?
1 messages · Page 1 of 1 (latest)
How to make only certain objects pixelated/have different post processing in URP?
I saw on a reddit post that different post processing for certain objects isn't possible anymore in URP, but is there another way to render them at a lower resolution than the rest of the environment?
So there's three ways to go about this, just do shaders materials local to that object, use multiple cameras and use different post-processing profiles per rendering (terrible idea usually unless stacking cameras makes sense), or via pipeline scripting or render objects to apply material overrides to specific layers.
custom materials would make it so it renders them at a lower resolution? like the edges and everything around the object would get pixelated and not just the textures?
if I do go with the layered method, I'd also need to implement holdouts for the objects in front of them, which is also something I'd have to learn
Right, make yourself a pixel shader and just toss it on random objects and you'll get the idea
oh huh, alright, didn't think that'd work and thought I'd need to do some post processing shenanigans
thank you
Actually, are we talking 2D or 3D? 3D may be a little more complicated as you'd probably don't want to be using transparency
Well, if you're doing orthographic 3D top-down then potentially it would be fine. I still think you need a way to y-sort it though as depth wouldn't work.
it'd be 3d, like turning a single character into a pixelated one, while letting other objects co-exist in full res
Check out my Basic Tutorial here for more info on the first steps: https://youtu.be/6Pg0kDw1aqc
GitHub Repository: https://github.com/Madalaski/PixelatedIntermediate
My itch.io page: https://madalaski.itch.io/
Steps:
- Create a second Camera which only renders the Layer which all pixelated objects are on.
- Set its output to a low-resolutio...
found this video, messing with it to see if I can get it to work
it seems like it might work
actually yeah, this one should work, it doesn't use the post processing stuff that the reddit post I found was talking about, just multi-camera layering and render textures
the shader for that render texture handles the depth checking, like I was a little worried about
Yeah that looks promising. I was thinking you could potentially get something working with opaque alpha cutting through the fragment
I feel like a geometry shader would probably be the better idea if that was easily doable
hmmmm, I've got this method working up until the depth shader, whenever I put the material with the shader onto the rawimage with the pixelated rendering, it just renders black, not sure where I went wrong lol
Dude could have gave his video another few minutes instead of forcing people to rewind it every step
haha true, it is also a 5 year old video
so I think something might have affected things
but the idea is solid. He's just rasterizing a camera rendering and applying the pixel effect to the whole thing, then comparing depth with the other rendering.
not entirely sure how the execution ordering works with shader graph and render textures, but this implies that the first rendering and depth is processed
I think the issue is with how unity 6 does depth textures
it seems like setting the format of colour to none enables depth rendering, but aside from that I there's no real option for depth rendering anymore
you can see it renders in the shader, but the output is wack
try plugging in the depth directly into color
if that works then it's w/e the operation you're doing there that's the problem
same thing, and the operation is the same as the vid
Probably something outside of the shader then like the wrong display
when I say depth here I meant the sample texture that's capturing depth and not the current scene depth
ik, I did that
hmmm, yeah I got nothin, only thing I can think of is I need to render a depth texture a different way
guess I'll roll with some solutions found in here
https://discussions.unity.com/t/depth-buffer-on-render-texture-missing-2021-3-4f1/885271/4
and just like that we got it workin
thank you for guiding me in the right direction mao lol
aye noice work
thank ya
update
it works in editor but not in the build... for most of my shaders, there is one where it works, but it's very strange and I'm not sure what's going on
Can you get new people up to speed on how you implement it in the editor?
I setup a second canvas to handle specifically the pixellated object overlay, since I do plan on bringing this elsewhere in my game I wanted to maneuver it independent from the hud canvas, then I did these two things and it just worked
And it works perfectly fine in the editor with all my shaders for the object, but in the main build it seems like it only works when the object has a a cel-shader on it
Which is strange
The editor is running at a different screen resolution, 16:9 instead of fullscreen for the build, which is 16:10, but that doesn’t affect much since the cel shader still has it show up, albeit stretched (which was a given)
Nothing else changes, so I’m confused
Several things to check/confirm:
- the build platform uses the same quality settings by default.
- if the target platform. Is not windows, try to make a windows build and see if it works there.
- check the frame debugger both in the editor and the build and see where the differences come from.
I am on windows, and hmm, I’ll look into those, thank you
@fading juniper Hey, did you figure out how to fix it?
Haven’t really put the time in to figure out the discrepancy between the editor and player, no