#How to make only certain objects pixelated/have different post processing in URP?

1 messages · Page 1 of 1 (latest)

fading juniper
#

as the title suggests, how can I make it so only certain GameObjects are pixelated? looking to add an option to my game where the player can give themselves a pixelated look, while the rest of the world/environment is still full res

#

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?

marsh crow
fading juniper
#

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

marsh crow
#

Right, make yourself a pixel shader and just toss it on random objects and you'll get the idea

fading juniper
#

oh huh, alright, didn't think that'd work and thought I'd need to do some post processing shenanigans

#

thank you

marsh crow
#

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.

fading juniper
#

it'd be 3d, like turning a single character into a pixelated one, while letting other objects co-exist in full res

#

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

marsh crow
#

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

fading juniper
#

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

marsh crow
#

Dude could have gave his video another few minutes instead of forcing people to rewind it every step

fading juniper
#

haha true, it is also a 5 year old video

#

so I think something might have affected things

marsh crow
#

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

fading juniper
#

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

marsh crow
#

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

fading juniper
#

same thing, and the operation is the same as the vid

marsh crow
#

Probably something outside of the shader then like the wrong display

marsh crow
fading juniper
#

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

#

and just like that we got it workin

#

thank you for guiding me in the right direction mao lol

marsh crow
#

aye noice work

fading juniper
#

thank ya

fading juniper
#

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

left maple
fading juniper
#

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

left maple
#

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.
fading juniper
#

I am on windows, and hmm, I’ll look into those, thank you

solemn saffron
#

@fading juniper Hey, did you figure out how to fix it?

fading juniper
#

Haven’t really put the time in to figure out the discrepancy between the editor and player, no