Solution for artefacts in shadows?

Udart's picture

Hi again, I've been playing around with the shadows option in the Lighting patch and while it's far from perfect I am giving it a try for drop shadows.

I would like to get rid of the 'jagged' aliased edges where the drop shadow is close to the duck.

Anybody have any ideas?


(Maybe putting the duck in a 'render in image' and blurring the edges of it? I've been playing around but haven't solved it. Basically it seems like the object is being rendered without the shadows so that the edge pixels has the color they would have if there were no shadows.)

PreviewAttachmentSize
Screen Shot 2012-08-21 at 10.08.41.png
Screen Shot 2012-08-21 at 10.08.41.png177.54 KB
Drop shadow.zip109.1 KB

Udart's picture
Re: Solution for artefacts in shadows?

Nevermind - it seems that the shadow 'layer' simply doesn't extend to the edge of the object - creating lighter pixels along the edge sometimes. And there doesn't seem to be any way to separate the 'shadow pass' from the rest of the render so that it could be corrected :-(

gtoledo3's picture
Re: Solution for artefacts in shadows?

I think it's a side effect of you having MSAA turned on in the private settings. Maybe the shadow pass doesn't do any type of MSAA, so when the stuff is composited, there are no pixels for the smoothed out edge areas, along the "jaggies".

Maybe you can try placing everything in a Render In Image patch (this kills MSAA), which will also allow you to use v002 or NI "FXAA" as an antialiasing technique instead.

Udart's picture
Re: Solution for artefacts in shadows?

Thanx for the suggestions. But even without MSAA there is a problem with lighter edge pixels. There definitely is no antialiasing on the shadows so the contrast is very visible when MSAA is on for the rest of the scene.

Also what is FXAA in a Quartz context?

Udart's picture
Re: Solution for artefacts in shadows?

ok to quick there - I found vade's fxaa patch in a search

gtoledo3's picture
Re: Solution for artefacts in shadows?

Udart wrote:
Thanx for the suggestions. But even without MSAA there is a problem with lighter edge pixels. There definitely is no antialiasing on the shadows so the contrast is very visible when MSAA is on for the rest of the scene.

Also what is FXAA in a Quartz context?

Oh that's too bad then that turning off the MSAA doesn't make the pixels match up to each other better. I think if there's still "light" colored pixels, there's not too much that you can do. Multiple FXAA can be used in series and make it progressively softer but there's going to be a performance trade off... and the light pixels will probably still be visible somewhat, but the overall image might be more palatable. (eh, you're probably fiddling with this right now!)

Udart's picture
Re: Solution for artefacts in shadows?

Yep, I am fiddling but don't really get any breakthroughs. Currently I am thinking I can do without the shadows on the main object. So I can concentrate on creating cast shadows on the background plane. Perhaps a custom glsl shader - or a distorted render of a copy of the object so it looks like a flat cast shadow.