#Pixelated Lighting

1 messages · Page 1 of 1 (latest)

still star
#

Hi everyone, I have been trying to achieve pixelated lighting but in 3D. I am using URP and wanted to essentially reduce the smoothness of lighting falloff emitted from light sources.

A lot of resources I found pointed me toward this not being possible with shaders, which led me to believe I had to create a Rendering Feature for this. I’ve kind of got something going but Im struggling to wrap my head around it all. My current approach takes the lighting source and applies a custom radial pixelated falloff that replaces the original lighting, just kind of gets slapped on top of everything and just looks kind of meh. The lighting calculations done by Unity are much more advanced and nicer looking. I wish I could just take their lighting and apply the pixelation onto it.

I’ve attached an example of what Id like to achieve. I also can’t simply apply pixelation onto the whole screen since my textures are already pixel art and would get destroyed :/

Wanted to get some direction as to whether this truly is not possible with shaders and whether I need to do it through a feature.

Thank you!

amber silo
#

Just curious but have you messed with the shadow options inside of your rendering assets? You can get some very pixelated shadows by just decreasing the quality of it all

still star
#

Will definitely check this out, thank you! Ive been hyper focused on the lights, havent ventured into shadows yet

idle heath
#

I think it's better if you make a local URP copy and edit the shaders to remove PCF filtering

still star
amber silo
#

"A lot of resources I found pointed me toward this not being possible with shaders"
I don't see why you couldn't. You can grab the lightmap data directly inside of the shader to manipulate and do as you please. Unity is very generous at giving you a lot of control compared to the other well-known game engines.

#

Alternatively, I think you can manage something by applying a light cookie mask

still star
# amber silo "A lot of resources I found pointed me toward this not being possible with shade...

Looking further into this. Just to confirm, I would essentially be swapping out all my materials with this shader so that the light cast onto it is manipulated correct? Or are you referring to a post-processing shader? The post-processing shader is the approach Ive been attempting but giving me lots of issues for now. Im still working on it, but if there is a better/easier approach Id rather do that than sink more time into post-processing

amber silo
#

"Looking further into this. Just to confirm, I would essentially be swapping out all my materials with this shader so that the light cast onto it is manipulated correct?"
That would be it, yes. Post-processing is another idea too, and I've seen it work nice for some projects, but I feel like most screenspace production is harder to refine than something done at the local shadering level.

still star
hexed herald
# still star Hi everyone, I have been trying to achieve pixelated lighting but in 3D. I am us...

Snapping to pixels and filtering the shadows are two separate steps, or so those techniques have worked in my experience
Assuming the texel snapping just rounds whatever lighting or other data there is at fragments if those texels to a specific point in it, means any smoothing prior to it will create a smoother result
More shadow filtering or smaller shadow resolution could help, but your mileage may vary