guycalledfrank / bakery-issues

Bug tracker for Bakery
4 stars 0 forks source link

Undesirable bright spots around edges #14

Closed tkggwatson closed 4 years ago

tkggwatson commented 4 years ago

Hi there,

I'm trying to use Bakery to get a nice indirect ambient bake to blend with my realtime directional sunlight.

Artistically I want to achieve a lot of colour bleed between surfaces, so e.g. an orange wall should spill a lot of orange on to the floor below it. For this I'm using no direct bakery lights, and just a single skybox light with a flat light grey-blue colour, no texture, intensity set to 3 and indirect intensity set to 2 (side question - I can't actually tell what the difference is between these two, they both just seem to make the lightmap brighter?).

This produces the colour bleed effect I am after, but there are very undesirable white spots around close edges. Take a look at the attached screenshot around where the pavement joins the road surface.

How can I achieve the quantity of colour bleed I am after (or more!) without getting these bright dots? I notice even with the skybox intensity settings set to 1 I still see the bright spots, they just aren't as prominent.

I am using Unity 2019.3.13f1, Bakery 1.71, Universal Render Pipeline 7.3.1, with a GeForce RTX 2070. I don't think it should affect anything but I am also using EnviroSky for my skybox.

Thanks Graham

Fireflies

Skylight

BakerySettings

guycalledfrank commented 4 years ago

I can't actually tell what the difference is between these two, they both just seem to make the lightmap brighter?).

Indirect intensity only affects bounced lighting. Intensity affects direct lighting coming from skylight.

Regarding spots: yup, that doesn't look right and shouldn't happen. Can you check if it happens without denosing?

tkggwatson commented 4 years ago

Hi @guycalledfrank , nice to meet you. Thanks for the quick response and great work on this lightmapper!

Turning off denoise does look like it improves it, though it is a little hard to tell as the result is extremely speckled. I've attached 2 images to show the difference.

Thanks Graham

WithDenoise

NoDenoise

guycalledfrank commented 4 years ago

Thanks Graham! This is... quite speckled for a single gray sky light. I'm assuming you have lots of emissive objects here? Can you check if it's them causing the effect? Very small/bright emissives can be noisy and are good candidates for Light Mesh component usage. Can you also check if using Legacy Denoiser (https://geom.io/bakery/wiki/index.php?title=Manual#Legacy_denoiser) works better than the default one?

tkggwatson commented 4 years ago

The Legacy Denoiser looks a little better, though artefacts are still visible.

LegacyDenoiser

There are a couple of emissive lights over on the building at the back of the picture - a bright sign above the window. Above us in this image there are emissive neon lights running along the underside of a pathway, and the windows in the building have custom metapasses with high emissive so I get the nice sprawling white in front of them (visible at the top left of the images).

However these are there to give the light bleed effect I'm after - notice how the ground here is quite pink, that's from the neon lights above it on the underside of the pathway.

However - on the very first image I posted, there were no emissive surfaces near that that I know of.

guycalledfrank commented 4 years ago

There is a hard-to-fix (because I can't control meta pass shaders) issue with emissives making them sometimes bleed over other objects when packed in a lightmap. I recommend you to try Light Meshes (https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Light_Mesh) for most of your emissive lights apart from either very small/dim or really large. Light meshes don't need to be packed to light maps and can't leak over unrelated charts; they also give higher quality distant lighting (less noise). Hopefully it's not hard to convert them in your case.

tkggwatson commented 4 years ago

I've disabled all emissive in my scene, and I'm still seeing the artifacts. See screenshots below:

NoEmissive

Below is the 'Emission' view from Unity's Progressive CPU, showing that the metapasses are outputting black for all my shaders. This seems to be coming purely from albedo?

EmissionMeta

tkggwatson commented 4 years ago

Also to double check that I've got things disabled properly, here is a screenshot of the generated lightmap with the skylight disabled, so I think this rules out emissive surfaces as the problem?

NoSkyLight

tkggwatson commented 4 years ago

One more test - this is with the skylight re-enabled and the intensity and indirect intensity reset to 1. There are still artifacts here, and this now is with no special or extreme settings.

SkylightIntensity1

guycalledfrank commented 4 years ago

OK, this is confusing. Can you detach a small part of this scene and send it to me as unitypackage? I can probably ask you another dozen of questions, but it'll be quicker to just go over the scene and test things myself.

tkggwatson commented 4 years ago

Certainly. Thank you for your help. Is there a private address I can send the package to please as I don't want to share our shaders etc. on here.

guycalledfrank commented 4 years ago

somemail256 at gmail.com

tkggwatson commented 4 years ago

I've sent you an email with the unitypackage attached. Thanks!

guycalledfrank commented 4 years ago

... so the problem was caused by

Mostly fixed by: