#archived-lighting

1 messages · Page 22 of 1

scenic epoch
#

does anybody know what might be causing baked lights to not work in specific parts of a scene? It seems like they appear in the lightmap, but are not visible in the shaded scene

#

Realtime lights work flawlessly

scenic epoch
#

Unity version is 2022.3.4f1 btw

scenic epoch
#

I believe I've fixed the problem. I had forgotten to make sure the Lightmap Static checkbox was checked for those few meshes that didn't receive light

willow jewel
#

Hello I have the same previous problem of ligthing as the last time but sine I switch to an other version of unity I don't find this settings anymore .

worthy trail
willow jewel
reef fern
#

do anyone know how to fix this when i remove my directional light it goes away but when i place it back it come back

deft fiber
deft fiber
median bridge
#

ok, so my item has lighting in it but im getting this really weird box outline per light, and im trying to fix it

reef fern
teal vale
deft fiber
#

Newer versions may have changed slightly in appearance but the button hasn't gone anywhere

deft fiber
willow jewel
#

this is the difference between when I start directly on the game scene and when I start the game on the lobby scene

deft fiber
willow jewel
#

I was wrong I check and I am not on a recent version ... I'm on the 2021.3.16f1

And their is nothing more on the bottom of this window

deft fiber
willow jewel
#

how can I fix it ?

deft fiber
#

Window>Layouts>

willow jewel
#

thx It worked 😁 👍

dawn mantle
#

heey, does someone knows why fog doesn't correctly works?

#

it just makes an strange halo on the road instead of making diffuse the horizont

#

i don't even know why those four halos are projected on the ground

#

any ideas?

worldly beacon
#

how to fill the area evenly with light?

Point and spot light have "origin" of light propagation and have the shape of a sphere

chilly kettle
worldly beacon
chilly kettle
worldly beacon
dawn mantle
keen notch
#

Does anyone know why GPU baking suddenly started crashing 2021.3.32f1? It happens in empty projects too. I've even completely reinstalled Unity Hub, Unity 2021.3.32f1, and did a clean install of fresh Nvidia drivers. All the log editor says is using my GPU then Crash!!!

chilly kettle
keen notch
#

Well like I said it just mysteriously started crashing Unity.

#

How come there isn't an actual error? It'd give me a Microsoft Visual Runtime Error and other times just nothing.

chilly kettle
#

Did you try it with a lower or higher version?

keen notch
#

I was using a Unity version from months ago

chilly kettle
#

I think you did everything i would have done

#

Like updating drivers, reinstalling unity

#

Do you have some 3rd party assets that may cause a problem?

chilly kettle
keen notch
#

Bakery?

chilly kettle
#

Bakery is a 3rd Party Asset for baking lightmaps

keen notch
#

No I just use Unity

#

Is that any better?

chilly kettle
#

It was much better years ago, but unitys built in lightmapper is great now.
I switched back from Bakery to Unity Lightmapper

#

In your case i would open a support ticket.

keen notch
#

I did send a crash report a couple of days ago

chilly kettle
keen notch
chilly kettle
#

ah wait thats the non technical one

#

i guess you have to use the forum for techical issues

random geode
#

anyone please help? i am hopeless here

chilly kettle
deft fiber
steady halo
#

I am a super noob when it comes to lighting. I tried to bake lighting recently and it all went horribly. Now I'm trying to restore my original default lighting, but in doing so came across this:

intensity 8: 1 of 2 walls receive the light
intensity 10.4: 2 walls receive the light
intensity 53.91: floor finally receives the light

why is this happening? I feel like I've messed up something simple and fundamental to my project/models

deft fiber
steady halo
deft fiber
steady halo
#

but that's fine

#

I have another problem lol because I'm determined to get baked lights to work

deft fiber
#

The problem in your screenshot is exclusive to realtime/mixed lights

steady halo
#

pre-bake and post-bake

after I bake the lighting, the light "disappears"

#

it's set to "baked," what am I missing?

deft fiber
steady halo
deft fiber
steady halo
deft fiber
steady halo
#

I restarted Unity and it's working now. A bug I guess?

random geode
random geode
quiet mango
#

I think my ambient occlusion settings might be off or something. I feel like the scale of the shadows is weird.

trim magnet
#

how do i prevent this light bleed img1
is there a way to make a light longer? a rectangle even if that makes sense like img3 (im new to this sorry, feel free to ask questions)

chilly kettle
lost granite
#

really dumb question but does anybody know why this might be happening

#

this is HDRP, the reason there are so many lights is because this scene is just going to be used for a video so performance isnt super important

#

this happens when I bake the lighting

#

im baking cos if i dont it flickers like crazy

#

i manually set certain lights to be baked and others are mixed

#

for comparison this is what it looks like when its not baked vs baked

chilly kettle
lost granite
#

yeah

#

its as if the baked lightmaps are being mapped weirdly to the mesh

chilly kettle
#

Did you generate a lightmap UV?

lost granite
#

i didn't tick it in the unity importer because when I do it looks wrong in a different way

#

ill redo it like that so you can see what I mean

chilly kettle
#

Okay. If you didnt provide selfmade Lightmap UVs from your 3D Tool you must check that checkbox

lost granite
#

this was with blender

#

i didnt make lightmap UVs though no

chilly kettle
lost granite
#

the mesh uses a lot of differnt materials cos i didnt think I needed to bother optimising it as well in case thats relevant

#

okay im baking it with "generate lightmap uvs" ticked

chilly kettle
#

are the parts with the circle on meshes that you repeated/duplicated somehow?

lost granite
#

i did do a lot of duplication but not really like that

#

like it appears on parts of the mesh that I extruded and stuff

#

i wouldve thought that it would be more related to the UV mapping if anything

chilly kettle
#

i would suggest you bake it with the generate uv checked and if thats not working, write again ^^

lost granite
#

if theres a definite way to generate the UV lightmaps manually in blender i would appreciate pointers, optimisation is not important here

lost granite
#

and looks as weird as it did before

#

hold on a sec

lost granite
#

worth noting that the chairs in prominent view are actually the only non-static row since they are gonna move

#

idk whats going on here

dawn mantle
#

Does anyone know how could i optimize this simple scene? It works not as fluid as i would like on my mobile... I have to say that there is nothing programmed yet, so all is that. Some technique i could apply to it... , is for an endless runner...

trim magnet
earnest cypress
#

Would removing lighting altogether increase FPS and how would I do it if that were the case? By removing lighting I mean no shadows, everything is illuminated like a Playstation 1 game

chilly kettle
chilly kettle
earnest cypress
#

How would I go about removing lighting?

chilly kettle
sand marsh
#

Can someone help me with lighting? This scene doesn’t look great and I’m not sure what is wrong. I have no experience with lighting, so if you think the issue is with anything else (textures, models, etc) lmk. Let me know if you have any pointers. 🙂

chilly kettle
sand marsh
#

Wow thanks! I’ll look into that. Yeah I think got mixed up in trying to add a bunch of small lights and they’re all the same intensity. Now it looks flat.

chilly kettle
sand marsh
#

It is. And that makes sense. Do all the lights in the scene render the whole time? So should I worry about the number of lights in the whole scene or the density of light sources?

deft fiber
# sand marsh It is. And that makes sense. Do all the lights in the scene render the whole tim...

In forward rendering path they render each per mesh that's within their range, so if no meshes are in their range they don't render
Inversely if many complex meshes are in their range, they all render again for each light
In deferred rendering path lights only render each per screen pixel that's affected by them
In both rendering paths shadow casting lights render one viewpoint for point lights, six viewpoints for point lights
There may be an overhead cost to shadow casting light, but generally it's only as big as the complexity of the meshes within the shadow casting light's range (multiplied by shadow resolution)

sand marsh
#

I see. Thank you vm 👍

dawn mantle
deft fiber
# sand marsh I see. Thank you vm 👍

The lights still need to do some kind of range check even if all meshes around them have been culled, so dormant lights will have a nonzero performance cost
But it likely is trivial unless you have hundreds of them

sand marsh
deft fiber
#

"Jittering" how exactly? Occlusion culling should only be disabling/enabling mesh rendering

deft fiber
#

All the staff I know do work hard, but it's a big company and big engine so sometimes stuff falls through the cracks
Nobody in the posts made in recent years mentioned having filed a bug report, so you could do that
This prompts the QA team to make some statement about it

#

From what I recall occlusion culling often underperforms and they're looking to replace it

merry yacht
#

is there any way to save environment data like skybox images, so I don't have to reinput all of the settings every time I make a new scene?

sand marsh
#

My directional light global illumination is being received by objects that arnt included in the light's culling mask, they should not receive light on my lightmap

regal gulch
#

Not really knowing what you mean, but I think I can provide an answer from what I understand. The sun sends a massive light source throughout the entire scene.

regal gulch
#

Can anybody help me with the point light here? 2022.3.13f1

deft copper
#

Is there a setting that toggles if objects are going to have their lighting updated while the game is running? All objects keep the lighting level they had before the game started, and I really cannot find the cause for this. Can't be baked lighting, since I tried turning them off.

twilit elm
twilit elm
tardy quarry
#

im trying to make a flash light, it works out of play mode but in play mode it doesn't work any fixes? ( I use baked lighting and URP)

timber lichen
#

I love Unity's lighting

deft copper
twilit elm
deft copper
jade stone
#

anyone have any idea why my shadows are like this? i want hard shadows but it doesnt seem to work
my related settings are also here

#

normals of my object also seems ok

#

wait... increasing the casecade count worked... but why??

twilit elm
jade stone
twilit elm
#

oh yeah probably

#

are there any other shadow resolution settings

jade stone
#

I sent picture of all the shadow related settings i know 😭 maybe im missing some others

deft fiber
deft fiber
#

Your shadows in the image are "hard shadows" which means they have minimal filtering, and the visual result is expected

#

They're still bound to the shadow resolution, they're not like the old "stencil shadows" that precisely conform to the shape of the mesh but cannot be softened/filtered

#

Only the third screenshot, of the URP asset inspector is relevant to realtime shadows

#

The Low/Medium/High shadow resolution tiers are arbitrary categories so that you can choose shadow resolutions per light in the light component's inspector, but that's that's only for lights other than directional light

jade stone
slim vector
#

I'm trying to set up 2 spotlights nearby but seems that only the one slightly nearest to the camera gets rendered, why?

deft fiber
slim vector
#

where can I change this setting?

timber lichen
#

is there any way to make light not go through walls?

#

For reference this is what I mean. The lights are on the other side of the wall

#

I'll also note that the wall is just a cube

#

I will also note that this is a spotlight in builtin RP

#

What is weird is that there are no leaks in the walls, they literally go beyond the upper and lower ones notlikethis

crude wind
# timber lichen

You can try making the walls thicker and/or using a higher Shadow Map resolution on the light

deft fiber
#

In that case you may need to increase lightmap resolution and/or mesh scale in lightmap to improve the resolution
The best solution for lightmapping would be to have the walls and floors be a continuous mesh rather than overlapping separate pieces

#

But I guess it's a realtime light?

deft fiber
# slim vector where can I change this setting?

Quality settings, but it's a complex issue that might not be appropriately solved by simply increasing the limit so it's best to research the topic
If you search "light limit" here you can find many explanations by me

timber lichen
#

The thing about the continuous mesh

#

But I had no idea how to do that and went the easy (and dumb) way... lol

#

Anyway, as soon as Im on my computer I'll check all your points, thanks!

quartz lily
#

Denoising Mode (on the Fog Post Proc component) was set to Both, changing to Gaussian stops it

azure river
#

does anyone know why my lights dont work if i change them they dont work and pp doesnt work aswell anyone know?

steady halo
#

How can I bake light objects that are blocked by other objects?

I am using baked lighting in my scene. I have an object that sits behind another object (a rock) in the scene. When I bake the scene, the rock in front is lit perfectly, but when I move the object as part of the game, the object behind it is really hard to see because it's in shadow. I can disable the rock and bake the object behind, but of course then the rock doesn't get baked.

unique mango
radiant kettle
#

Is there a way to automatically convert all realtime lights to baked ones on mobile? (or suggested alternatives)

crude wind
#

I usually prefer gaussian though

timber lichen
#

Is there a good tutorial to add player customizable lighting to a unity project?

sand marsh
#

I am having trouble with lighting being transferred to my actual game build. Once I build my game to my IPhone 12 all of the cast shadows disappear. This is a comparison between my Unity editor simulator and my phone. Is there something I’m not doing to bake the shadows into my scene or is it a graphics setting?

#

I’m using the default iOS graphics settings, but should a baked lightmap have cast shadows?

quartz lily
quartz lily
quartz lily
deft fiber
# radiant kettle Is there a way to automatically convert all realtime lights to baked ones on mob...

Select all light components (from light explorer or by filtering hierarchy), set all their types to baked, bake
If your question is not how to set realtime lights to baked but rather how to have only mobile use baked lights, I don't think there's any pre-existing system to do that
as baked lighting and light type are both tied to scene, I'd make separate scenes with baked lighting and load those based on a settings option
Additive scenes are helpful to separate visuals from gameplay and to avoid duplication in this case

radiant kettle
deft fiber
#

Not that you can use baked lightmaps with procedural generation anyway, additive scenes or not
The custom script "prefablightmapping" may help in that case though

radiant kettle
#

So I guess it wont be straight forward then, but maybe I can just instantiate a Baked Light instead of a non-baked one, and then does it get baked at run time or just wont work?

radiant kettle
#

I'll read a bit more into it.. I'd assume people probably combined procedural generation and lights before!

deft fiber
# radiant kettle I'll read a bit more into it.. I'd assume people probably combined procedural ge...

They are generally considered a poor combination and a hassle to work together, so much so that Unity doesn't even make it possible out of the box as baked lighting is entirely tied to scenes and can't be moved
Even if it can with something like prefablightmapping, you run into the issue of discontinuities in light calculations and seams between parts
Here's one relevant talk about it: https://youtu.be/KbxiGH6igBk

radiant kettle
analog lantern
#

So been having issues with lighting in unity that i have never had before, when i am baking my lights, this always has happened. no lighting settings were changed, yet i just cant fix the lights. Any ideas?

sand marsh
radiant kettle
#

When using Dynamic Resolution on Mobile (and Unity Player) Built-In, things seem to mostly work except one thing: lightmaps (i assume) seem to work correctly at first but then, when a new scene is loaded, they seem to be limited to one screen corner making most of the scene dark, proportional to the dynamic resolution scale

#

This example would be what it look like of a scale of about 0.4

#

In-game example
SOLVED turns out there was another camera i didn't know about

sweet blaze
#

Hi, I'm having a really weird lighting problem by default

#

There's literally nothing in the scene. I created the project rn, added a transparent plane, and an object underneath, ticked hard shadows on the light and this happens
The shadowmap

#

I'm using built in

night shell
#

The shadows are dithered shadows cast by the transparent plane @sweet blaze

#

And since you have the shadow casting of the light set to hard shadows, the dithering used for transparent shadows becomes really apparent

#

Shadow casting from transparent objects don’t really work the way you’d expect

#

So there are a couple of solutions to help hide the artifacts your seeing of the semi transparent shadows, you can use soft shadows which makes those artifacts less apparent, or just simply disable shadow casting of the transparent plane

#

Another solution also is light mapping but that’s a whole other thing

#

I should note that this is only caused when you have transparent materials casting shadows

#

Any shadows cast by non transparent objects would be fine

sweet blaze
#

okay, i see, thanks

night shell
#

Green are valid texel, red are invalid. Such problems are caused by geometry that have back faces exposed (basically see through parts of a mesh)

#

This can be fixed by either fixing the mesh itself to close any of those holes, repositioning the objects so that those holes are not visible to the player, or on the material settings for the object with see through faces, enable “double sided GI” in the material settings

analog lantern
#

Just wandering, what could have triggered it? Wasn't having before until earlier today

tight parcel
#

hey, im having this issue with the lighting in my game. when i shine a light on a mesh, tiny lines of light slip through the edges/seams of it. right now im using a probuilder mesh to make a tunnel but im pretty sure it happens with everything, im in urp and the materials being used have the render face set to both (might be relevant idk)

night shell
#

Solution is to either thicken your meshes, or more simply you can enable Two Sided on the shadow casting mode for that mesh renderer

tight parcel
gilded mantle
#

Could someone tell me what is happening and how i could fix this? cuz iknow the camera is too far but i need the spotlight to be rendered by the camera aswell

glossy pike
#

i think youd have to increase the light distance or shadow distance thingy on ur hdrp settings

#

idk ive never used hdrp

sand marsh
deft fiber
brittle pecan
#

Does anyone know how to fix this pop-in lighting? Second picture is moving slightly to the left, you can see the light isn't actually on it

chilly kettle
deft fiber
deft fiber
#

That may be because of the shader, or maybe something batching-related

sand marsh
sand marsh
#

So this lighting glitch is not happening when I use deferred rendering. But this is a mobile game so I was hoping there would be a workaround. Does anyone know what the issue is?

deft fiber
sonic sparrow
#

hi guys i've been using unity since 2017. I worked as a programmer all the time and i want to switch to become a lighting designer/programmer due to my college major(i'm physics student and it's focused on optics field). where should i begin?

chilly kettle
sonic sparrow
chilly kettle
# sonic sparrow i'm not interested in any kind of mobile applications. I want to merge my physic...

Ok. So you have to work with HDRP lights and can ignore URP Lights.
I guess this is a good start: https://www.youtube.com/watch?v=yqCHiZrgKzs

In this video, you'll learn how to create AAA-quality visuals for current and next-gen games. We’ll also show you HDRP’s key rendering features and how to tune settings for anti-aliasing, lights, shadows, exposure, and more.

Speaker:
Pierre Yves Donzallaz (Senior Rendering & Lighting Artist)

Did you find this video useful? Room for improvement...

▶ Play video
golden dock
#

in realtime

#

and baked

#

why is it like that, looks terrible

#

using hdrp btw

sand marsh
# deft fiber So, which rendering paths are you trying with?

I have tried with the built in and I think it can’t handle as many real-time lights as I would like. So I switched to URP and tried forward and deferred. Deferred seems to be way too memory intensive for my phone. This glitch was happening with Forward Rendering.

sand marsh
deft fiber
# golden dock and baked

Baked probes only include "reflection probe static" renderers, whereas realtime probes include everything

golden dock
#

all the materials except the tree material use hdrp lit, tree use unlit
and in baked probes the only objects it include with colors are trees, everything else is pure black for some reason

deft fiber
golden dock
#

like everything is full static

deft fiber
# golden dock all the materials except the tree material use hdrp lit, tree use unlit and in b...

There's no obvious reason to me why they wouldn't show up, so that's something to look into
I'd make a simple test scene with default cubes to figure out the correct set of steps to make probe baking work and see what differs
Something that may sometimes look weird is probes being visualized in the preview with vastly different exposure, making them too dark or bright
For this reason you should have a sphere or a capsule with very smooth metallic material next to your test cubes

golden dock
#

well realtime and baked

deft fiber
#

This suggests it might be a problem with the probe's rendering frustum
Confirm that near and far planes of the probe make sense for the scene

golden dock
golden dock
#

thats what the probe exr looks like lmao

deft fiber
#

Something did change as the reflections we see near the edges here faintly disappeared

#

There could be both frustum and shader problems here

#

Hence I recommend making the test scene as I explained

supple coyote
#

Hello, I have a problem with lights in HDRP. So everything was working fine. We didn't even change anything. Suddenly the lights starts to behave like this:

#

reflection probes baked
ligthmaps baked
occlusion culling baked

#

the funny thing is, this only appear in builds

#

you can see the glitch on houses (they are static). It somehow disable objects/shadows. idk. Its hard to figure you because on editor everything is fine 🙂

wet gazelle
#

My lights aren't showing

deft fiber
#

@supple coyote Looks like it could be somehow related to high quality shadow filtering
Might be worth testing with medium and low
If some problem is build-specific always check which quality level you're using in editor the confirm it matches so tests are comparable

supple coyote
#

I have low, medium and high and the problem is on all three of them

#

high quality shadow filtering - where I can find this option?

deft fiber
supple coyote
#

this is on medium quality

deft fiber
# supple coyote

That seems to confirm that filtering is not the culprit, even if it's always present at the crime scene
It could be some issue related to scales, shadow atlases or directional light clipping planes perhaps
But those are just stabs in the dark

#

I'd try to isolate the problem into a smaller test scene with default cubes, or to try to reproduce it in a fresh test project

supple coyote
#

I have the smaller scene I will try to fix this on these scene for now.
Funny thing is that we don't change any settings, the lightmaps and settings are the same from few months
Zero updates, zero changes

wet gazelle
#

I changed my lights to directional lights

vale flower
#

Shouldn't ADPV be fast for baking? :v

#

or I misunderstood guy in a video

supple coyote
#

can be something with GPU instacing material checked and making static objects?

deft fiber
supple coyote
#

ok in few minutes I will check

#

I also discovered something but it will be hard to explain, but maybe it will be a clue

supple coyote
#

ok so it was because of GPU material instancing

#

but why suddenly? idk

sonic sparrow
#

can i work on ray tracing and path tracing using unity and c#?

vale flower
deft fiber
vale flower
#

and yeah it hang up

deft fiber
# vale flower 2023.1

That's an experimental version and out of date too by now, so I'm not super surprised if there are hitches

vale flower
#

I'm trying to recreate lighting similar to what's seen in games like Half Life and Half Life 2 (using GoldSrc, Source Engine) in Unity HDRP. I've spent two days on this, watched countless tutorials, and still can't seem to achieve the desired effect. My main issue is with exposure - to match what was done in Source, the exposure needs to be constant, right? I was considering using only real-time lighting, but then I thought maybe mixed lighting would be a better approach? This leads me to another issue - the light baking isn't giving me the results I want and I'm constantly struggling with it. To get a satisfactory effect, do I need to place reflection probes everywhere? I Want to have indoor/outdoors in one scene P.S. My version of Unity has the adaptive probe volume system.

Also, how to proper configure volume for something like that?

screenshot for example

night shell
# vale flower I'm trying to recreate lighting similar to what's seen in games like Half Life a...

a screenshot with what you currently have would also help. but honestly trying to match source 1 style gfx especially in HDRP is a strange decision to say the least knowing how rather basic source 1 rendering is.

source barely has any realtime lighting, most lighting done in source titles were all baked with lightmaps, those of which were at a really low resolution. No mixed lights or nothing because they were very expensive at the time.

Post processing also was rather minimal in such games, so exposure yes would be constant, there was no eye adaption. (there was bloom, although the bloom was basic). But beyond that no SSAO, no SSR, not even tonemapping or anything like that.

Reflection probes also weren't really a thing and weren't used that often (they were also basic and didn't use any parallax correction). PBR shading was not a thing back then so reflections were used VERY sparsely

So in terms of matching exposure not only do you have to have it constant and no eye adaption, you really have to keep a consistent intensity for all lights in your scene roughly. So sunlight intensity wise would be similar light intensity wise to any lights you have indoors

#

because this was an era where HDR wasn't really in full swing all the way through (it was beginning to get implemented of course, but not to its fullest)

vale flower
# night shell a screenshot with what you currently have would also help. but honestly trying t...

Thank you so much for your reply. I am not gonna to fully match source-like lightning but I want to look it like this.

I am noob about lightning in Unity and that's the reason why I am asking about light probes - I see that is something similiar to env_cubemap in source. But is it necessery to place them? Without them envirnoment looks strange.

You didn't answer my question - is it possible to achive source-like ligihtning only with realtimes lights in Unity?

I am asking about Global Illuminaton also

vestal canopy
# vale flower I'm trying to recreate lighting similar to what's seen in games like Half Life a...

Theoriginal Source used in hl2 dosnt have realtine lihtning, only baked. So yea you should go for mixed. And for the exposure, half life 2 has static exposure and no bloom (other then the coast levels). The game uses static reflection probes so thats what you should go for. Also you need light probes to have your objects change brightness in different lighting conditions when using baked lighting

vale flower
vestal canopy
#

Source just puts cardboard shadows for things that move which is why you need to use mixed lightning. Other wise, non static objects wont have any shadows

vestal canopy
#

Why would you want your graphics to look like a 2009 year old game anyway? People who are using source are trying to up the graphics with dynamic lights and shadows, but you are trying to downgrade your graphics?

night shell
#

in HDRP of all pipelines as well

night shell
vale flower
#

so that's why I am asking about it

night shell
#

well its important to understand what source was doing

#

makes it easier to nail down what you are after

vale flower
#

I was into source a few years. And I was trying to do lightning in Unity like in source - maybe that's was a wrong way

night shell
#

yeah their lighting systems and the way you work with them are not really that similar

#

if you want source style lighting, light probes and full baked lights is the route because that is what source did

if you want to go with a more modern approach, mixed lights are what you need along with lightmapping

#

we can go more in detail of course with the modern approach

#

but just a little confused as to what your attempting to achieve and what exactly your aiming for

vale flower
#

Do you have any tutorials which would help me understand unity lightning and baking it? Whenever I wanted to do for example dark interior I had problem with many things

analog lantern
#

So been having issues for around 4 days now with lighting in unity that i have never had before, when i am baking my lights, this always has happened. no lighting settings were changed, yet i just cant fix the lights. Any ideas?

deft fiber
#

@vale flower Source is remarkably similar to Unity's BiRP and URP (but misses most of what HDRP adds on top)
Both have a variety of realtime lights, rely a lot on lightmapping together with light probes and reflection probes

#

If you're familiar with designing lighting in Source, BiRP in particular has few surprises

#

One difference though is that Source generates light probes automatically whereas in Unity you'll have to configure light probe groups manually
Unless you're using APV but as I understand they're more of an alternative workflow you'd use instead of lightmaps, which makes them less like Source

#

GoldSrc also uses baked lightmaps and probes too to some extent, but they're much more limited as are each of its graphical features

vale flower
#

ok finally I have successfully baked some lightning (I guess), when they are baked there is no reflections, when mixed reflections appears.

#

and what settings for baking should I have?

#

for testing and final bake

vestal canopy
#

Im pretty sure rwaltime Environment shadows came with portal 2 and after. But realtime shadows did exist with flashlights, if thats what you mean

deft fiber
# vale flower Why makes less like source? What's the difference?

Lightmaps are textures that are limited by lightmap resolution, mesh UVs and texture compression which can give them recognizable visual quirks
APVs are interpolated points which can have their own quirks in turn
If you're emulating a specific engine's or game's signature look, you need to understand and mimic their technical limitations

vale flower
#

I do not wanna emulate, I wanna just achieve something similiar to it (not one-to-one)

deft fiber
#

I may be misunderstanding your goals here

#

Your "desider effect" was to "match what was done in Source" but it's a bit unclear what you were referring to precisely

vale flower
deft fiber
#

The example screenshot heavily relies on baked bounce lighting for its look, so you probably want that

vale flower
#

But firstly I must have understanding how baking lights works and my goal was something like source

deft fiber
#

As mentioned you do need reflection probes for reflections
Source used them copiously

#

Usually one per room

night shell
deft fiber
#

Quite so, specular response from mixed lights comes from their realtime part
Baked lights don't have that, but it can be approximated using reflection probes with the help of what's called "emissive proxies"

vale flower
#

ok it looks very close without any reflections

night shell
#

or with a custom shader but thats another whole ordeal

vale flower
#

yeah and my question now is if lights are in "mixed" mode, they have reflections, do I must still create reflection probe ?

deft fiber
#

(Source got realtime light reflections in Ep1, but before that there were no light reflections aside from reflection probes)

night shell
#

you can retain those "highlights" by using mixed lights

#

as spazi mentioned

deft fiber
night shell
#

you can also retain them with a bit of a hack that involves reflection probes, and using emissives to approximate the highlights

#

again as spazi mentioned

vale flower
deft fiber
vale flower
#

it still need reflections probe?

deft fiber
# vale flower ok but HDRP has RTX options and something like SSR

Reflection probes are used as fallback for those systems
How about you ask more questions once you've watched this video in its entirety
https://youtu.be/DlxuvvYZO4Q

Step into the famous Sponza Atrium to see how to beautifully light an environment from scratch using a mix of baked and real-time techniques. Pierre Yves will showcase the GPU Lightmapper, the new Probe Volume system, ray tracing, and path tracing.

00:06 Introduction
01:18 Speaker
01:40 Volume system
02:47 HDRI sky setup
04:16 Direct lighting &...

▶ Play video
night shell
vale flower
#

I watched this video and this realtime global illumination looks so nice

night shell
#

usually it goes like this to keep things simple (and general)

[usual rasterized reflection pipeline]

  • skybox reflection (360 image of skybox basically)
  • local reflection probes (360 image of the enviorment at specific spots, these can also be "parallax corrected into a cube shape to approximate the enviorment)
  • screen space raytraced reflections (performs raytracing in screen space to obtain more advanced and correct reflection information, but it can only trace whats on your screen)

[advanced]

  • "RTX" full raytraced reflections, usually a replacement for the entire pipeline you saw from before and are accurate, and are agruably way easier to work with (but of course very expensive)
deft fiber
vale flower
vale flower
vale flower
#

ok this is what I was talking about. PHysically based sky, and without reflection probe it looks like this...

#

Ok it was "include sun in baking"

deft fiber
#

But you probably don't

deft fiber
vale flower
#

yes with reflection probe it also gone

vale flower
deft fiber
vale flower
#

yeah because it's so expenesive

deft fiber
#

And complex to set up, which matters most in this case

#

Honestly you should be using BiRP or URP, especially if Source levels are your reference

vale flower
#

I will stay in HDRP because I wanna use things like water. But thanks for an advice

zinc flume
#

Are there any plan to handle/mitigate light leaking of APV? Left side is lightmapped, Right side is APV.
The capsule is dynamic object....

vale flower
#

are you sure about that that's apv issue? @zinc flume

zinc flume
#

Also, my screenshot contain geometry that is not axis aligned with the world, that might be hard for APV as well...

zinc flume
#

0.15m if I remember correctly

vale flower
#

I don't know, I wanted to replicate your case but it always is shaded properly and there is no leaks

zinc flume
#

And this is 0.75m probe spacing

vale flower
#

default one

#

Ok I see where your problem is propably

#

upscale your shadowmap resolution

#

tried even on probe spacing 5m and it is not leaking while I have high shadowmaps

zinc flume
#

‼️

#

Will try after work. Thanks.

zinc flume
vale flower
zinc flume
#

This is wild find out if it's true. and might be the reason why I could never get APV to not leak as I have never considered shadow map to be related to its leaking AT ALL.

#

So most of the time when leak happen I just mess with the probe setting and volume options.

vale flower
#

take a point that your directional light is mixed/realtime so I don't know if APVs have to do something with it
(I am noob in lightning too)

But I noticed that when I was checking it have nothing to do with mixed/realtimes lightning

clever hedge
#

I have some problem with baking lights on Unity.
In substance I have done all the UV, baked the texture and all is good.
I set all in Unity and when I bake it's all corrupted? I have only a directional light and the whole GameObject is set to static.

I'm using URP
How could I fix it?

vale flower
deft fiber
#

@zinc flume APVs have a bunch of options, manual and automatic for adjusting probe position and sampling to reduce leaking issues
They are shown in this talk https://youtu.be/iU7X5xICkc8?t=538

#

@clever hedge Unity's lightmapping uses the second UV channel for lightmap UVs, which to work correctly must be set up with some specific rules that ordinary UVs don't have
Unless you have your own authored lightmap UVs in the second channel, you should enable "generate lightmap UVs" in mesh import settings

#

Mainly the rules are there must be no overlap, there must be proper padding relative to lightmap resolution and all UV islands must be within normalized UV coordinates

supple kelp
supple kelp
#

like, you have to spend time filling each room with like 50 light probes? and if it's a big open area then you're gonna need to place hundreds of light probes in it? maybe thousands even?

there has to be a better way

clever hedge
deft fiber
deft fiber
supple kelp
#

17:29 is even worse, there's like 10k on the screen at once

#

10k light probes in that one area

deft fiber
#

Probes aren't that slow to place manually, as you can box-select many, duplicate and drag to quickly get a huge 3D grid of them, then delete or move the ones that are in bad spots

#

There are also scripts to automate that process

deft fiber
supple kelp
#

oh ok, probe volumes seem a lot easier to place. cause manually placing thousands of light probes seems like an impossible task. even if you can drag quickly, rooms arent always squares but very complicated shapes so you'll have to do a lot of work to fill them up properly.

so whats the advantage of using light probes instead of the volumes?

deft fiber
#

APVs are also meant to replace lightmapping afaik, which normally works in tandem with light probes

supple kelp
paper glade
#

hi guys, i have a random generated maze system, how do i bake the lighting during runtime?

deft fiber
paper glade
#

all the objects are instantiated when the player loads in the new scene, so the lighting has to bake again, how do i achieve this?

paper glade
#

what do i do then?

night shell
#

Real-time lighting

paper glade
#

where do i activate that?

night shell
#

It should be active by default when you create lights

#

The modes are set on the lights themselves

paper glade
#

i see

#

thx

night shell
supple kelp
night shell
#

With some work, yes

supple kelp
# night shell With some work, yes

i've heard posts about people wanting built in to be deprecated, is it really gonna be deprecated in the near future? cause it sounds like there's nothing wrong with it. and its not like urp and hdrp are straight up better.

night shell
#

As far as I know not really, but a lot of projects I know do use them still. URP still does not have feature parity with BiRP yet despite how hard they are pushing everyone to use it. Personally I would avoid both render pipelines because they are constantly changing. BiRP is rock solid and has been battle tested, and has the most resources available for it

deft fiber
#

I believe the decision to modernize the render pipelines was mostly because BiRP is built upon legacy code upon legacy code so making updates for it became too cumbersome

night shell
#

Despite that I find it still works very well

deft fiber
#

Implementing something like the SRP Batching would've required a rewrite of the rendering engine anyway

night shell
#

It’s up to you, you can always create a project and do some tests with each pipeline and see what you prefer

deft fiber
#

At current point in time URP is lacking only a few of BiRP's features, and surpassing it in other areas

supple kelp
deft fiber
#

Still, if you're making your own rendering features and your own optimization under the hood, you won't miss URP really

deft fiber
# supple kelp what areas does it surpass birp in?

It has SRP Batching, VFX Graph, now APVs, Forward+ rendering path, colored light cookies, higher quality shadow filtering are ones I've encountered
Light and shaders generally seem to be of higher quality, like per-pixel lit particles, more blend modes out of the box
Both have Shader Graph but URP gets more robust native support

#

The most notable thing that's missing is Screen Space Reflections
The new URP sample scene implements them but they're not a documented feature

supple kelp
novel onyx
#

hey is there any reason why the black void appares when I switch my additional links from per vertex to per pixel?

vestal canopy
deft fiber
# supple kelp hmm ok, but what is the difference in performance? if someone's playing my game....

URP is supposedly lighter but real world reports vary both ways
Obviously also depends a lot on the game's graphics features and what kind of optimizations you're using
With BiRP you're usually doing a lot of work to reduce draw calls using types of batching and instancing but SRP batching makes that unnecessary
So while the performance might be the same in ideal conditions, it does save some effort

#

URP's SSAO that's enabled by default probably takes up more frame time than all the other rendering combined which can skew the results sometimes

#

But it always depends
If you have a lot of lights, forward+ rendering path can reduce their cost significantly
In that case it may be possible to match the performance by limiting light ranges and slicing meshes, but it's nice to not have to you know

#

With all render pipelines it'd be best to work to their strengths rather than try to put them up in a one to one comparison
SRPs are smoother to use out of the box, but BiRP is much more expandable due to being picked apart for years by the community

supple kelp
#

thanks for the explanation. its hard to choose between birp and urp for sure

deft fiber
supple kelp
deft fiber
night shell
#

usually when something gets deprecated in unity in my experience, it still stays within the editor it just has a deprecated tag

night shell
#

i've been against render pipelines for a long while though, like BiRP as I mentioned is mostly untouched now but its been with unity since the beginning

#

and its been used on all kinds of games that have shipped, arguably its the most battle tested/hardened out of all the other render pipelines

#

vs with the others they are still very new but are constantly changing

deft fiber
paper glade
#

when i have a light on my ceiling

#

it can't be batched

#

why is this?

paper glade
#

so the only problem are the point lights rn

#

i've put my camera rendering to deferred

#

and my point lights all take up like 400 batches

#

disabling shadows brings this number down to like 70 batches

deft fiber
paper glade
paper glade
deft fiber
#

Each shadow casting point light must render 6 shadow casting passes that include all meshes within its range
Deferred rendering can't help with that

paper glade
#

when i disable deferred rendering, i get like 3k batches

paper glade
#

if i just get rid of all the lights, my batches are fine

deft fiber
paper glade
#

so, what kind of lights do i use then?

#

i need ceiling lights

#

cuz i tried this as a test version

deft fiber
#

Baked lightmapping could be applicable
Prefer shadowless point lights, and spot lights for shadow casting

paper glade
#

like, the map gets instantiated as soon as the player warps to the new scene

deft fiber
paper glade
deft fiber
#

But if you're stuck with realtime lighting you need to get clever
For example if you need shadows from a lamp you could have a spot light facing down, and another shadowless spot light facing up right below it to mimic soft bounce lighting

paper glade
paper glade
deft fiber
#

While I don't recommend swapping render pipelines mid-project, if you're using URP or HDRP you can rely on SRP Batching which eliminates the need to wrangle draw calls

paper glade
#

just have default

deft fiber
#

Still, only use shadow casting lights where absolutely necessary and prefer spot lights whenever possible

paper glade
#

like 1 big room

#

and 1 light under each ceiling tile

#

but that uses way too many lights

#

but i know its still possible

#

but idk how i should handle this

night shell
#

lighting with procedual generation is probably one of the hardest things you can do

#

unfortunately

night shell
#

and most of the techniques fly out the window

paper glade
#

but this is just a maze generated, it doesn't generate more maze when going to the barrier

deft fiber
#

It's a worst of both worlds scenario even if you don't have draw calls to worry about

paper glade
night shell
#

you can technically utilize baked lighting to light procedual worlds, although its difficult to explain

#

but this was done in a title done by bethesda which I forget

paper glade
#

oh

deft fiber
night shell
#

but essentially the game was procedual, but enviorments were preset and baked before hand

#

and were essentially stiched in such a way where they appeared seamless

deft fiber
paper glade
#

from those lights

night shell
#

you can probably write some additional code to handle culling of lights

#

if lights or such are occluded disable them

paper glade
night shell
#

same with meshes as well

paper glade
#

500+ draw calls in there

#

all from the light

deft fiber
paper glade
deft fiber
night shell
#

you can disable shadow casting (and even lower shadow resolutions of lights) with basic distance checks

#

essentially LOD'ing for lights

paper glade
#

i only put the "Shadow Type" to "No Shadows"

deft fiber
paper glade
#

but then still, 500+ batch calls

#

that's normal?

deft fiber
#

Something to note is that the stats window you're looking at is known to be inaccurate

#

If you want precise information you should be using the frame debugger

paper glade
#

yeah, i use that

#

there are still like 500+ draw calls in the RenderDeferred.Light dropdown

#

some have keyword "POINT UNITY_HDR_ON"

#

most of them

deft fiber
#

I would expect that deferred rendering doesn't need a lot of draw calls but I'm not familiar how it works in the built-in render pipeline

paper glade
#

and others are stuff like this

paper glade
#

do you recommend switching to another pipeline?

#

does it have benefits?

#

i had another project where i switched to URP and all my shaders were pink and couldn't fix it

#

well, only if i assigned the right texture back to each object

#

which took me hours

deft fiber
paper glade
#

yea

#

true

deft fiber
deft fiber
paper glade
#

always errors

#

so i did it manually

#

anyways, thanks for the help man!

#

i guess im just gonna spawn lights randomly

night shell
deft fiber
#

Yea, or the meshes
Lights don't do much unless they're lighting something

paper glade
#

alright, thanks

night shell
#

I've already suggested a basic way you could cull lights by reducing shadow resolution (and disabling shadows) based on distance, and you can do something similar with meshes too by reducing the amount of them drawn on screen by distance, or by other more advanced techniques

#

the less there is, the better

golden dock
#

have anyone tried making light culling system that works with distance? i have thousands of lights in my scene and it needs to be optimized, i guess unity doesnt have such function by default so

#

also is there a way to prevent this look

#

lightning gets extreme brighter on objects that are close to light but this is not what i want

tulip tendon
tulip tendon
golden dock
golden dock
tulip tendon
#

what render pipeline are you using?

golden dock
#

there are more lights than the amount unity supports so i have a lot of flickering and it looks horrible

tulip tendon
#

for the flickering set the render path to deferred, it gets rid of light limits

#

HDRP should be on deferred by default

tulip tendon
#

is it the same in game view?

golden dock
#

oh its normal in game view

#

but im not making a game, making a mod for some other game

#

i hope it will be normal there too

golden dock
#

looks really bad

tulip tendon
tulip tendon
golden dock
tulip tendon
#

do you have any indirect lighting in the scene?

golden dock
tulip tendon
#

meaning light that comes directly from the source

#

indirect lighting is light that comes from bounces of objects

#

lemme get some examples

#

this is only direct lighting

golden dock
#

oh i see what u mean now, but nah i dont think this scene has it

tulip tendon
#

this is with indirect lighting

tulip tendon
# tulip tendon

in this case i use SSGI to simulate realtime indirect lighting

#

but screen space GI relies on screen space data

#

meaning if the light is not in your camera view no indirect lighting will be calcluated

#

thats where raytraceing comes in but thats into the expensive lighting territory

#

so in your case you can try using SSGI combined with APV's

#

also add some LOD's to your scene

#

from that video you sent i can see the street lights are still there when very far from the camera

#

the street lights that are far like this can be culled and improve performance

tulip tendon
#

looks like lightmap UV issues

rose birch
#

how does one go about making your own then

#

since unity cant generate it correctly i think

tulip tendon
#

blender

#

or any other 3D modeling software

rose birch
#

is there a good tutorial to use

tulip tendon
#

i dont know any specific ones, go on youtube and search for one

chilly kettle
rose birch
#

been messing with the values all day, default included

zinc flume
# vale flower

Coming back to this, nope increasing shadow resolution didn't help. and you can see the sampling debug here showing that apv sampling from the other side of the wall notokay

zinc flume
#

The more I test apv, the more I'm convinced that this tech needs serious fix for light leaking before Unity should even consider basing precompute gi on this leaking mess. Why is Unity trying to push it so much when it can't even handle simple setup. 🤔

vale flower
#

as I mentioned it is not APV issue

zinc flume
#

So I will have to try with Unity 2023.2 later then

#

Although I am quite sure of what is happenning, since the probe sample debugger cleary show that it's leaking. Might as well not waste any more time

misty hearth
#

Hi. What is the best way to do 2d shadows and stop this from happening? I'm using Shadow Caster 2D and it doesn't seem to work very well

river hedge
#

im just getting started with lighting, and i added a couple of lights to my scene, but baking produces weird artefacts. what am i doing wrong here?

uneven grotto
#

im using real time directional light lighting in URP, but it looks awful and generates in strips, how can i make it smoother?

chilly kettle
chilly kettle
uneven grotto
#

i did some changes with the cascade and it now looks fairly good, but theres still the odd stuttering when the lighting moves and it has to generate more shadows. Can this not be changed to be smoother?

chilly kettle
#

Dont know what you mean

uneven grotto
uneven grotto
#

you can notice the stuttering when the lighting updates

#

theres lots of strips of shadow that seem to generate when the lighting updates which causes it. Im not sure if that can be fixed or thats just how the shadow works and cant be changed

chilly kettle
uneven grotto
#

And it’s a 5x5 grid

chilly kettle
#

so its 50x50 Units?
How does it look if you shrink it to 5x5?

uneven grotto
#

I’ll test it

deft fiber
zinc flume
#

also, invalidating probe just make the lighting data on the area getting lost

deft fiber
# golden dock now this is what happens on game view

This is a result of too many overlapping lights in forward rendering
You'd have to confirm that you're able to use deffered rendering
The light intensity issue can't be easily remedied, as HDRP is built around real-world accurate logarithmic light attenuation
It can be remedied with a tonemapping profiles to lessen the contrast between light and dark in HDR space
There's no built-in light culling system, but you could use any system that you use for culling/loading in gameobjects in general
Lights that affect no meshes don't do any light calculations, and in deferred rendering lights that can't be seen aren't rendered

deft fiber
# uneven grotto

This is kind of an unsolveable problem but as long as the resolution is high and soft shadows are enabled it may be acceptable
Using cascades doesn't make sense with orthographic camera, as all distances appear equally close
For this reason it's important that your directional light shadow max distance is as low as it needs to be, and camera's near plane is as high as it can be

#

It doesn't look as good as I'd expect from a 4K shadowmap so maybe the resolution is being wasted on incorrect distance

chilly kettle
deft fiber
# chilly kettle isnt the size of the gameobject a reason?

Only relative to shadow resolution and shadow distance
The actual math is more complex but it's helpful to think that the shadow's resolution is mapped up to the shadow distance
So basically if your scene fits within a shadow distance of 100 you're getting all 4K shadows across the level
If your level is only 10 units long in this example, it'd be getting a fraction of the shadowmap and appear with low resolution shadows
If shadow distance is decreased to 10, the shadows should appear just as accurate again as they did with big level and long shadow distance

#

I think the resolution is spread starting from camera plane, but I haven't confirmed that specifically
Usually camera near plane is very close to the camera but with an ortho camera it's important to check there's no wasted empty space there

deft fiber
#

@uneven grotto Oh and to fix the "strips" you may be able to rotate the directional light around it's forward axis, which realigns the pixel grid of the shadowmap
It may cause strips elsewhere, but it can be a good compromise
When the directional light turns, it may be worth trying to also rotate it in this way to kind of obfuscate the pixel shimmering that you see otherwise with a moving sun

#

You definitely need soft shadows enabled for that though

uneven grotto
golden dock
deft fiber
# golden dock how can i confirm that? i mean like its already set to deferred so and also how ...

HDRP has settings in many places so you may have to snoop around for all the necessary ones, can't say more precisely
Tonemapping is a volume override, where you can find other post processing overrides as well that may be useful
Tonemapping requires HDR and linear color space but HDRP by default has all those
Anything that culls meshes will reduce the cost of light, but I think occlusion culling specifically also removes lights

uneven grotto
#

maybe the rotation isnt smooth and its not actually a lighting issue

deft fiber
#

But might be mitigated with the steps I detailed

uneven grotto
#

dam. I guess how ill leave it as is, and slow down the rotation so its less noticable

#

thanks for all the help though

deft fiber
uneven grotto
#

The shadow res is on the highest 4096, and ive lowered the distance to 60 which is the lowest in can go before the shadows are cutoff

deft fiber
uneven grotto
deft fiber
uneven grotto
#

alright sure ill try it

deft fiber
#

If the camera/near plane is as close as they can be, I guess the conditions should be ideal

uneven grotto
#

yeah doing this just achieves the same thing no difference to the shadows. Ill just try to keep it as subtle as possible

compact rock
#

Hi all, I am having a issue with URP lighting. For some reason, it becomes all fucked up when it finishes baking (one without the emission).

#

Does anybody have any idea what the problem here is?

#

Nevermind, figured it out.

deft fiber
compact rock
#

Lighting compression

dusty warren
#

Hi all - I originally joined this discord to ask for help with a shader but while taking a screenshot to explain the goal I've noticed a different problem that I've spent half an hour failing to resolve

#

on the left is a reflective sphere, with reflections from a reflection probe in the center of the chain-link-box-thing

#

on the right is a reflective sphere somehow recieving reflections from an old version of the reflection probe that no longer exists

#

for some reason, everything in this scene not within the range of a specific reflection probe has this reflection, with the (no longer existing) red spotlight

#

even if I delete every single reflection probe in the scene I still get this reflection

#

how do remove this ghost reflection probe and make it so that every object in the scene not within the range of a reflection probe that exists just reflects the skybox?

dusty warren
#

update: this was fixed by clearing baked lighting

thin zephyr
#

If i use "Directional Lighting" on BiRP, my batches goes from 250 to 500 + is this just the way lighting works? it doubles the batches? or is there other ways to not double my batches and still light my scene (like i guess not using Directiona lighting?)

#

im generating a map realtime so i don't bake anything, i just use my 1 realtime light

deft fiber
thick lodge
#

Hi. My lights is not working in builded game. In editor it works perfectly. I have quality on ultra.

sudden leaf
#

Does anyone know why my baked lighting isn't visible? Baked GI is checked, there's a lightmap created, everythng seems to be ok, they're just... not visible

#

happy to provide more info to anyone that might know what the issue is, just shoot me a ping

#

lighting settings

#

and lightmap

#

all lights in scene are set to baked, other than the two directional lights I have, which are set to mixed. Those are the only ones visible on play

sudden leaf
#

rebaked it again with the exact same settings and it worked, whacky

deft fiber
thick lodge
quick shoal
#

In my game, the fogs away from the camera look sharp and ugly like this. How can I solve this?

crude wind
kind kraken
#

I'm a newbie to Lightmapping, I was used to Box Project the UVs of my models when I worked with realtime lights, but now that I have to bake everything it f*cks up the lightmap, how can I achieve the effect of Tiling and Box Projection UV but also be able to bake that?

thick lodge
#

Can someone explain line renderer to me? I dont get it at all

deft fiber
deft fiber
untold saddle
#

trying to light this small area, and I lit the room (red) first. it room (red) looks good now, but room (blue) doesn't, so I generate lighting, and it gets all messed up. any way to get it consistent across rooms?

chilly kettle
golden surge
#

So when unity warns about multiple scenes loaded with different lighting settings, is that something to worry about as long as i control which is the active scene? Or does it still matter?

snow pollen
#

Just a quick question
If we import Bakery into a project, then bake lighting, then remove bakery from the project, does the baked lighting stay?

chilly kettle
arctic isle
#

So it doesn't matter if you have different settings assigned to different scenes. I recently raised it internally that maybe we should remove this warning because it doesn't add very much value, but it's definitely not the priority right now.

spring glade
#

hey gang, im using URP an am getting this weird dark areas that dont seem to pe processed the same way the rest of the level is

#

any tips on what to look out for

#

oh yeah, its also a polyshape made with pro builder

arctic isle
# spring glade any tips on what to look out for

Make sure you have the 'generate lightmap UVs' (might have a slightly different label) checkbox on for the probuilder object. Beyond that I'd look in the debug draw modes to check that the UVs and charts are there, the texels are valid and finally that a lightmap is being generated for these faces.

chilly kettle
#

I am baking a outdoor & indoor scene with just the Environment Lighting and no additional light sources.
I thought that the environment light will lit the complete scene, but it seems that the house is throwing a "shadow".
The Environment Lighting is very dark indoors and bright outdoors.
Is there a way to light the whole seen at the same rate?
(Images with "Cast shadow" On and Off on the buildings mesh - nothing else changed)

deft fiber
chilly kettle
# deft fiber Is the first image not showing the result you want?

It does.
I disabled the Cast Shadow of the building.
But i wanted to add a sun also and this will cause the problem, that the sun is shining through the walls ^^.
I could add a realtime directional light for the sun, and enable the cast shadow of the walls after bake, but this is for mobile VR and i want to avoid realtime lights i guess.

I always thought, that environment lights will brighten up the whole scene, but i read that they dont and are more like an "emissive skybox" with light for the outside.

#

I could add some arealights inside i think.

deft fiber
chilly kettle
deft fiber
chilly kettle
main wolf
chilly kettle
main wolf
#

not if you bake it

thin zephyr
#

if i am stitching together a bunch of prefabs realtime to make a large maze level, what are my options with baked lighting? could I individually bake each prefab store them and somehow stitch them together in a realtime gen build? or should I just do realtime lighting with 1 source, and use emission and other things, and just use realitime Global Illumination post processing v2 BiRP stack? and just turn lights off via proximity so I am keeping my lights low in numbers ? (1-8) I am currently at around 300 - 1000 batches depending on whats on scene and trying to stay around there or less. performance wise im at around 160 fps-ish, but aiming to cap at 60 anyway for consistency (this is on a 3080 so im sure lower gpu will have lower fps). any thoughts? thanks!

deft fiber
# thin zephyr if i am stitching together a bunch of prefabs realtime to make a large maze leve...
  1. stitched together is possible but a lot of trouble, if you go with it you may find useful:
    https://github.com/Ayfel/PrefabLightmapping/
    https://youtu.be/KbxiGH6igBk
  2. PPv2 has global illumination? I'm not aware of it
  3. You'll probably want to just go with realtime lighting and cull the meshes and lights as much as possible
    Make sure to familiarize yourself with forward and deferred rendering paths if you use realtime lights
thin zephyr
#

on BiRP - PPv2 stack

#

left off / right on

#

but this is just a test, i actually have a directional light i turned off just to see the GI only

#

test just to see GI on emissive objects only

#

also, thanks for your reply

deft fiber
wise python
#

I'm trying to get Unity to stop baking my lighting. As far as I know all my lights are set to Realtime and Baked Global illumination is turned off. If I rotate my Directional light it starts baking and Unity will hang. Would appreciate any thoughts.

deft fiber
wise python
#

These are the settings I have currently

#

But I still get this

deft fiber
#

And if there's an option in the generate lighting button's drop down to clear baked lighting cache, that may help too

wise python
#

Sadly that didn't fix it, but ill keep playing with it. Thanks for the input.

rocky fox
#

Hi! I'm getting dark corners at the edges of my walls when baking lightmaps (using bakery). Anyone know how to fix this?

#

I only have a skylight and directional light in my scene. The room is only lit by the window. But even the wall facing the window still has the dark corners

#

ambient occlusion is disabled too

night shell
rocky fox
#

Increasing bounces didn't really help either. So idk maybe it is realistic and I just need to tweak the lighting more

Update: Changing skybox helped with spreading out lighting a lot more. I thought it was a bit odd of a "solution" for it to so dramatically affect how the lighting was spreading but maybe I just had some weird conflicting settings ^^' It was a throwaway skybox anyway

tulip tendon
#

you might have SSAO on

brazen sierra
#

Hello everyone, I'm looking for some advice on lighting my scene.

I've made some modular walls, flat textured, and I'm getting seams when I light with baked lighting in URP. No matter how I tweak the settings I can't seem to get rid of them. Here are my thoughts on what the problem could be,

Mesh
Meshes are created in MagicaVoxel, cleaned up in Blender with VoxelCleaner v2,
TheStrokeForge - Vox Cleaner

Here are the meshes as they appear in the Unity preview window. The fireplace module has a hole through it to resemble a chimney.

UV
UVs are generated by VoxelCleaner v2 as well, I know the generated UVs aren't 'padded' (I think that's the right term), so I do get some UV errors in Unity, however the UV errors don't appear to be next to the seams?

Lighting Settings
Finally, here are my as-is lighting settings, I've done a bunch of tweaking but seem to get the same results. The only time I've got rid of seams is when I moved to Realtime GI mode, but I'd like to use Baked lighting.

If anyone can give me some direction on this, I'd really appreciate it!

lofty quartz
#

I am using 2023.3 and the new settings for the shadow caster 2d on a tilemap. How can I get the shadow to cast on the wall behind the wall where the player is currently positioned? The shadows work, but if it's in the same tilemap it shows all tiles regardless if they are covered by a shadow or not.

quick heath
#

Does anyone know why my shadows look different if I start a scene from a different scene? When I run the scene using the Play button, everything looks fine.

deft fiber
deft fiber
#

No padding for UVs in general can cause texture bleed

quick heath
#

So, what can I do?

deft fiber
arctic isle
arctic isle
# quick heath So, what can I do?

Generate lighting on each scene manually. This occurs because the scene does not have any env lighting of its own. When you open it in the editor the environment lighting is baked for you but not saved anywhere (hence you see it when you hit the play button). Similarly it's baked as part of the build process. Playmode scene loading is stuck in between these two with no good way of invoking a bake while in Play mode.

This entire system is poorly thought out and we removed it in 2023.2. Now you need to bake the lighting if you make changes to it, leading to no such confusion. We will keep improving this in future releases.

tulip tendon
#

The APV's are most impressive

#

this is URP in unity 2023.2

#

everything is light probe lit

#

and these are the settings

#

i bumped everything to 11 and it only took 2m to bake

#

scene size for reference

#

these are the probe settings

#

no leaking or artifacting visible

#

yall gotta admit this is insane

#

actual in game view

wise python
arctic isle
#

We're still fixing some bugs with memory usage and very large scenes in APV. 2023.3 should be even better once the dust settles with the new features

#

Thanks for posting, very much appreciate the feedback!

tulip tendon
arctic isle
tulip tendon
arctic isle
tulip tendon
#

thank you

split grail
#

Hello, i'm trying to bake the lights for my house, it looks nice without baking or messing with lights whatsoever, but for perfomance and all that i need to bake the lights, tho whenever i do i get these really weird results, have tried playing with settings but nothing really seems to change:

#

Some walls just remain fully black, the ground gets random big tiles and it overall doesnt look at it should, without baked lights it looks nice

split grail
#

the big tiles on the floor are the "tiles" of my floor, they're separate square objects

arctic isle
split grail
#

I do have all that for the black objects, i will try ambient occlusion later, thanks in advance

mighty marlin
#

So I got a issue in my map, I got so many lights that they are flickering at least in the preview mode. What can I possibly do to avoid or fix this issue?

blissful dune
#

This will see like a dumb question, but... If I take a cylinder and stick it in the ground, and one side of it is shaded darker than the other, and that moves as I advance the time, is that a shadow? Nothing is rendered on the water.

I ask because I switched shadows off in Enviro3 (the only lighting source I have in the scene) and these shadings on the cylinder persist.

whole bramble
#

is it okay to have 4k lightmap texture for mobile?

#

i have some myths and itches with this "4k" thing , i know that the lightmap count will be significantly reduced but will there be any performance issue using a 4k texture ?

untold saddle
#

why is only part of this tunnel system lit? the "shell" was done first, and the "walls" second. both are done with probuilder, but the "walls" just aren't rendering correctly.... what can i do?

sonic mason
#

i removed the Light probes and i have no light probes on the scene , but all of my object is still effected

untold saddle
whole bramble
heady monolith
#

im using URP and a directional light

#

there are no shadows pls help :(

crude lintel
# heady monolith

Are shadows enabled on the renderer? Is the light source set to realtime shadows? Do the used materials/shaders support shadows? What is the shadow render distance setting set to?

brittle pecan
#

Is is possible for global illumination not to load properly in a build? When I started a new game most of the lighting wasn't working (objects were lit despite it being dark). However when I saved and loaded the lighting worked perfectly.

arctic isle
arctic isle
arctic isle
sonic mason
whole bramble
gleaming bone
#

What is there recommended way for handling baked lighting/probes when additively loading scenes?
Most of the resources seem to recommend designating a scene as the "master", load it as main and other scenes as additive and then bake. Does this still work?
Also, in runtime, does this setup require the master scene to be always loaded before the additive scenes. Or does it not matter?

deft fiber
deft fiber
#

The topic has been discussed a few times on this channel in the past week or so

gleaming bone
deft fiber
#

I can't fetch the earlier conversations from where I am but it shouldn't be an awfully long scroll up

tulip tendon
deft fiber
#

I guess procedural levels are not the root problem here as I assumed?

sonic mason
brittle pecan
blissful dune
whole bramble
#

probably you should clear gi caches

azure river
#

hey does anyone know why my lights dont work meaning if i try to mess with them they dont respond to any changes and pp does the same thing as well anyone know?

edgy root
#

Hey friends. Struggling with the lighting in my scene - shadows on the trees look different in editor vs build, I assume something's wrong with my shadow cascades? Confused why it's not popping in the editor, only in the build. Any ideas what may be the problem?

chilly kettle
edgy root
# chilly kettle Different Quality Settings?

solved it. was an issue with Dreamscape tree leaf shader. Had to declare light shadows and cascade light shadows on one line: #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE

timber lichen
gleaming bone
#

I actually did try the "bake everything at once under a master scene" approach and It seems to be working. I have a question though:

How are light probes handled for additive scenes? The light probes only existed in the master scene(positioned accoridngly for each additive scene). But in play mode I seem to be getting light probes and lightmaps working without needing to actually load the "master scene". Is it actually necessary to load the master scene in runtime after baking?

tulip tendon
gleaming bone
tulip tendon
azure river
#

hey does anyone know why my lights dont work meaning if i try to mess with them they dont respond to any changes and pp does the same thing as well anyone know?

#

anyone know how to fix?

ember ginkgo
deft fiber
#

What you mean by it looking "awful" could be due to many reasons

#

There's only one light and no ambient light so the shadows are unnaturally dark
The materials may be too rough so they show no specular reflection, or perhaps using a shader that doesn't implement specularity at all

ember ginkgo
#

How do I add ambient light?

ember ginkgo
#

Or am I being paranoid?

#

Look at the drinking cup

#

Those shades are shit

timber lichen
#

Also could be a bug, try rebooting

azure river
timber lichen
#

That's why

#

Change them to realtime if you want to have them respond to movement

azure river
#

but doesnt it mean just for them to be baked lights

timber lichen
#

Baked lights are not expected to be moved

azure river
#

oh but its not that my lights just stop working if i bake them

timber lichen
#

Then what's the issue? Be more exact

#

What are you trying to do that doesn't work

azure river
#

pp would stop working if i bake them and with my lights as well they just wouldnt be turned on

timber lichen
#

Weird

#

What pipeline are you using

azure river
#

i think it might be fixed now but i had to delete pp and download it back to and put new lights

#

im not sure

timber lichen
#

If you said donwload post processing then it's most likely built in pipeline

#

Since srp has post processing built in(urp and hdrp, for custom srp you have to code it yourself)

gleaming bone
#

Could someone confirm if the single master scene baking approach actually requires the master scene to be loaded at runtime? I'm finding unity forum posts that say I need to do that but probes and light maps are working for me in additive scenes without the master scene even loaded.

timber lichen
#

If you baked your lights, then you should be good to go

#

Afaik even if you load a different scene at runtime, your lighting won't be affected because it was baked in the editor

arctic isle
tulip tendon
quaint river
#

Hi, can someone help me please. I am getting pretty bad light bleed in my scene Baked , unbaked still produces light bleeding.

#

Light settings

deft fiber
# ember ginkgo It just looks odd

Check the lighting and the materials for the notes I gave
If you can share their properties it might be possible to give more specific suggestions

ember ginkgo
#

what about

#

enabling rtx?

#

and baking images to 4K?

deft fiber
ember ginkgo
#

just asking

#

if it could help

ember ginkgo
deft fiber
ember ginkgo
ember ginkgo
deft fiber
ember ginkgo
#

no

deft fiber
ember ginkgo
arctic isle
deft fiber
# ember ginkgo this?

Yes
It looks like they're not using any smoothness or metallic maps, so they'll default do dull 0 metallic and 0.5 smoothess
and your normal maps don't look right at all so the objects are not receiving lightfrom the correct direction
Simply put your PBR maps aren't exported in the way Unity expects

rain tartan
#

Hello people! I have a question, I was trying to use 2D lights in my top down game, but because everything is rendered in Y it makes it look weird at various times. I would like to know if there is a way to use a sprite and what settings I should put on it to make it look like a light

gleaming bone
timber lichen
#

Lol? That's...interestinf

whole bramble
#

what is the best lightmap compression format for mobile if i have lots of lightmaps like 20-25?

chilly kettle
#

What resolutions does your lightmaps have?

whole bramble
#

and sometimes, im thinking ....like should i use 4k textures for mobile?💁‍♂️

chilly kettle
whole bramble
whole bramble
chilly kettle
whole bramble
#

subtractive

#

and non directional

chilly kettle
# whole bramble

i would go with GPU instead of CPU Lightmapper, but the rest looks okay.
For the first Test Lightmaps i recommend using a lower Resolution like 5

whole bramble
#

obviously , in case of speed , progressive gpu is the winner

#

but i was concerned about quality , that's why i choosed cpu one(I lack a 4gb graphics card too^^)

night shell
#

The difference comes with what hardware is used to lightmap the scene

#

But the end result is the same

#

If your also concerned with lightmap counts, you might also be able to reduce things further by making some objects still contribute to the lightmap, but receive lighting through light probes

#

For example say you have trees in your scene, you can have those still marked as contribute GI static, but in the mesh renderer settings for the tree meshes you can change the “Receive GI” field to LightProbes instead of Lightmaps

#

Granted when you do that, that means any meshes using light probes have to have a light probe group setup for the scene

#

And since I know your concerned with performance, light probes are very lightweight

whole bramble
whole bramble
#

here is this , just for showing you

night shell
#

Looks correct to me

whole bramble
# night shell Looks correct to me

is it possible to have both lightmapped and lightprobed objects rendered in a single pass when using legacy vertex lit rendering path?

supple coyote
#

Hello, I have a question. Can I somehow make some gameobjects to ignore exposure? I have the effect when looking up to the sky/sun some of the gameobjects going really really bright. The effect is cool but it's to hard

#

the exposure itself is fine, I don't want to change it, but idk how to manage this transition in brightnes

mighty marlin
#

Does anybody here know what might be causing that it looks like two DirectionalLights might be cast? The one with a nice tint to it is baked, the light one is well, I don't know why it is there

deft fiber
# supple coyote Hello, I have a question. Can I somehow make some gameobjects to ignore exposure...

It's not practical to try to exclude anything from being affected by exposure, rather than fixing the exposure itself
I'd first look into the sky settings to figure out why it the exposure system sees it as so dark that everything else needs to be blown out
Also disable the particle system temporarily to rule out its interference
Then you could tweak automatic exposure settings to see if the problem is there, and consider if a fixed exposure works better in this case

#

If these don't reveal the issue you could ask in #archived-hdrp , they could know better how the HDRP adaptive exposure works precisely, which I assume you're using

deft fiber
deft fiber
mighty marlin
deft fiber
#

Normally baked lights are realtime in editor until baked, and then they disappear entirely
Mixed lights should appear as baked to some objects (after baking), but as realtime to others

mighty marlin
deft fiber
#

Remember to use GPU baking if you have one, and turn down the samples and resolution (not "max lightmap size") to speed up test bakes

mighty marlin
deft fiber
hot pelican
#

Hey guys, any ideas on how to fix lights leaking through walls? Im using a point light and URP

atomic parrot
#

How to make viewmodels that are under the influence of camera stacking follow the lighting of the scene?

#

The gun is bland and is not following the lighting of the scene

#

Nor does it project shadows

#

This is the material

#

This is the weapons camera

#

This is the pistol

sweet blaze
#

Hello, I have some lighting issues where my ambient light becomes 0 when im on a build

#

It looks fine on the editor, but on a build it's pitch black (the ambient light)

ember ginkgo
#

In HDRP, textures go white when I add a sky

#

why could it be?

distant yew
#

question...

#

we have a game with like 40 levels, each level has its own lighting in it though

#

is there any way to tell unity to bake all 40

#

rather than having to open each level one at a time and bake?

wanton knot
#

I believe you will run out of vram, but you can try

#

Just have them all opened and the lighting will bake for them all

arctic isle
# distant yew rather than having to open each level one at a time and bake?

hey, you can write a script (place it under Assets/Editor ) to do this.

using UnityEditor.SceneManagement;
using UnityEditor;
using UnityEngine;

[MenuItem("Tools/Bake All Scenes")]
public static void BakeAllScenes()
{
  List<string> scenePaths; // or fetch them from EditorBuildSettings
  
  foreach(var scene in scenePaths)
  {
    EditorSceneManager.OpenScene(scenePath, OpenSceneMode.Single);
    Lightmapping.Bake();
    EditorSceneManager.SaveOpenScenes();
  }
}
#

disclaimer: didn't check this code it may not compile, treat is more or less as pseudocode

distant yew
#

im a level designer ^^; Im more on the art side though, so do I just... put this in to notepad++? sorry lol just trying to make sure I do it right

arctic isle
#

oh ok let me check the code first then so you don't have to debug compilation errors yourself

distant yew
#

basically i dont need to do it during a full build, I just want to trigger it globally for review and let it bake out without having to commit to a full build of the game

arctic isle
#

😄

distant yew
#

so its just like part of the workflow not the final export

#

and thanks a ton

wanton knot
#

Why complicate so much when you can just open them and bake tho?

arctic isle
#

If they have to do it again it's going to be super annoying I guess

wanton knot
#

Fair enough

distant yew
#

because we have a ton of different people working on it at once, and basically once a week they want me to fork a branch, rebake at final quality.

wanton knot
#

Yup makes sense

distant yew
#

so its not unusual for people to leave lightmaps at like 1x quality for speed, and forgetting

#

but we use a global quality setting so I dont have to manually adjust each scene, just set it correctly and bake

distant yew
#

❤️

arctic isle
#

This will make a menu item for you under Tools and will bake every scene that's enabled in the build settings

#

Enjoy 🙂

#

Just fair warning, once you click it you won't be able to cancel until it's all done

distant yew
#

where do I put said script?

arctic isle
#

Assets/Editor/CustomBaker.cs

#

I updated the filename on the gist now as well