Light Bleed

I’m a bit stuck, and I’ve tried just about every solution I can find from:

  • Deferred Rendering
  • Casting Two Sided Shadow
  • Point Light Casting Shadows Is On
  • Tanking the Normal Bias
  • The walls have thickness.
  • The walls are overlapping, tried perfect butting too.
    ect

There are no directional or ambient lights. I’ve tried all of the lighting settings for compression, pixel, ect. Not sure where to go from here.

I have rooms which are procedurally generated by chunks, and I’m getting light bleed from the next room. I can not bake as everything is 100% procedurally generated. If I have to buy an asset that’s fine. I don’t need AAA lighting, actually something more akin to Doom 3 would be fine with me.

Example, see light bleed on edges and ceiling from next room.

Screenshots and Vid: Light Bleed - Unity Engine - Unity Discussions

If you could turn off all the lights except for the one in the other room that’s bleeding through, It would help diagnose the issue faster.

I’ll go one further, a single pointlight.

3342651--261078--upload_2018-1-4_23-4-50.png

The walls do have thickness, I intersected them at 4 points to seal them as a test, and I even tried Two Sided for shadows on them.

I went ahead and pumped up the wall thickness, same deal.
3342663--261079--upload_2018-1-4_23-23-4.png


see how the shadow from the inside wall look offset to where the red arrow is. if you change shadow bias (not the normal bias) really close to 0, like 0.001, that will bring that red arrow closer to where the shadow should actually start.

also set normal bias to zero.

I did so, and that seemed to help a bit, but I’m still getting light leak from the corner. I didn’t mean to take up your time with this tonight, I do appreciate the help anyhow.

3342673--261081--upload_2018-1-4_23-48-26.png

Are you changing this setting on every light? You have to do it for every one.

Last thing to check is what quality your shadows are set to, Check unity quality settings and put them in the highest to see if that helps. Unity’s shadows are pretty bad…

Yeah, I’m instantiating a prefab with a point light, so when I change the settings for it, they are all changed. I restart the game just to make sure the graphics setting changes have taken full effect. The shadow quality is set to “Very High Resolution”. No dice.

Send me your model

There are no models, the floors, are simple 1x1 quads and the walls are simple 1x1 cubes with .5 thickness. To reiterate my first post, there is no lightmap baking, this game is 100% procedural. There are no premade models outside of those pieces, that it assembles the room with.

  1. Your problem is related to Edit->Project->Quality settings (Specially shadows)
  2. Your model scale is too small . Increase its scale according to 1x1 metter simple unity cube
1 Like

If I make the model any bigger it won’t work, a model of 1 x 1 x .5 should be plenty thick enough for shadows. For a test I doubled the size and it didn’t help.

I have tried every solution related to quality settings. I’ve searched through every post on Unity Forums related to this matter. I’ve been through several pages of Google. The only solution I can come up with is going to be custom shaders.

Should I report this as a bug? I can’t seem to find anyone who has had this problem, and found a solution to it. If I had to guess, a pieced together procedural room isn’t possible without shadow acne and light bleed, regardless of settings.

Not sure if you’re lightmapping or it’s all realtime lighting. Honestly confused sorry :confused:

All realtime. No lightmapping. The rooms are assembled from pieces, the rooms are dynamically generated. Thanks for any tips, pointers, help, anything. Additionally, I tried to find if there was a way to generate lightmaps while the game is running, so when I generate a room I can generate the lightmap on the fly. No dice.

OK some more questions which I need clear answers to:

  • do you have a screenshot of a game’s visuals you want to copy
  • does it need to be modular at runtime or modular at edit time
  • is it for mobile devices or VR?
  • Do you refer to the bleeding on the vertical wall segment here and NOT what Lexie is talking about?

3345084--261381--upload_2018-1-7_15-53-5.png

  1. I’m alright with Unity’s default lighting system if I can get it to work. I would prefer a style of idTech 3’s engine, but Unity is fine.
  2. Modular at run time. The rooms are generated from pieces, the rooms are destroyed and made on the fly.
  3. PC only no VR.
  4. It happens on the horizontal and vertical where the walls meet and the ceiling/floor meets the walls, it doesn’t happen between wall pieces. In that image that wall is 3 units high, that means it has 3 1x1x.5 meshes stack on top of each-other and extending the length of the wall.

Small example of bleeding. Associated screenshots, these aren’t the only settings I’ve tried either, this is just the current attempt with Unity’s lighting system. To clarify, once again, this is all 101% procedurally placed. Nothing in the scene is placed before it starts. The rooms are created and destroyed on the fly.

3345113--261383--upload_2018-1-7_11-16-37.png

3345113--261384--upload_2018-1-7_11-16-49.png

3345113--261385--upload_2018-1-7_11-17-12.png

1 Like

Any lights which aren’t set to cast shadows will cause bleeding. Because of how realtime rendering works: lights always have an effect* but shadows mask it. If the light does not cast shadows, or the shadow distance is too small, your lights will appear to be bleeding.

In reality, the shadow simply isn’t being rendered either due to max range or the mesh cannot receive shadows or the light is not set to cast shadows.

Note: you will not get an exact Quake 1/2/3 look because you have no radiosity in your scene, only realtime shadows. This is easily fixed later and we can address that separately if it’s even required.

*Assuming no tile based light culling is taking place and it won’t be for legacy unity renderers - you can disregard this until SRP HD.

I might be wrong here, but all of my settings above have the light casting shadows, and I even set the meshes to Two Sided as an experiment at one point. You can see the settings of my lights in the above images. I have the environmental light set to nothing so I can have a completely pitch black room if I want one. So the lights are set to cast shadows, I tried hard and soft, and the meshes are set to cast shadows.