#Custom stylized DoF for 2.5D pixel art

1 messages · Page 1 of 1 (latest)

untold spruce
#

Ok i'm gonna do my brainstorming here, hopefully someone can chime in

#

Custom stylized DoF for 2.5D pixel art

#

This is the latest progress

#

This is 1 of the passes, CellReduce

#

This is all the passes in order

#

Yes it's gotten this far from AI, and now for the last bug fixing i gotta do my own brainstorming

#

So this thing has near/far strength parameter to control the blur for near/far separately

#

When it's off, it's no blur. WHen it's on until full, it's pixelated like this

#

Basically a screen space pixelated

#

Each cell finds the brightest pixel and apply that color to that whole cell

#

This is the inspiration pretty much

untold spruce
#

So after questioning the AI a few times, it finally came up with this approach for the passes:

  1. CoC circle of confusion. ALtho i dont understand CoC fully but this pass pretty much outputs to SFloat tex where -1 is near, 0 is focus, +1 is far
  2. CellReduce. RGBA SFloat. RGB is color, A is the CoC, and all are reduced/quantized to cells
  3. Near. Processes the blurring from Reduced tex as source, only for near objects,
  4. Far. Processes the blurring from Reduced tex as source, only for far objects
  5. Composite. Puts them together. Far, then Focused (source), then Near at last
untold spruce
# untold spruce This is the latest progress

This all should work fine, except that the issue is for some reason, the near pass does not render results that's outside of the < 0 in CoC range. This is a close up look. The red ball's outward exterior blur is only expanding outwards if it's in front of that bigger stripey green blue circle (that is also in the near space). But the exterior blur should also be expanding all around the red ball, even the part where the background is the far objects. For some reason, it's not, bcoz the CoC info (already reduced to cells) is like that for some reason

#

Well, that reason is like that bcoz the CoC is only 1 channel. It can't represent both far, focus, and near when they may have overlapping parts once the blur exterior is considered

#

So this could be fixed by correcting the code somehow. But before that i'm wondering if the layout of the whole passes is even correct

normal merlin
#

So what’s being used in vfx for adding a dof effect as compositing process is a min filter. So basically for half transparent pixel only the object closer to camera is being taken into evaluation

#

That fixes artifacts around the border of an object that is in front of another one which is very far away

untold spruce
#

Omg u scared me hi

#

Yea from the pics, there are a lot of wrongs. But trust me there were times when it's looking better

#

I'm just focusing on fixing this 1 issue at a time, and it seems the order of operation also needs to be reworked a bit

#

The shader in the OP is outdated n not used anymore

#

So these are the controls now
Blur radius is... how much the blur spreads, in pixels (i guess?)
Pixel Step is the cell size

untold spruce
untold spruce
#

Better ref, no mixel

untold spruce
#

A bit more final polish, then optimize where needed, then it's fully done