#archived-lighting

1 messages · Page 71 of 1

silk ledge
#

Thank you!!

#

how can I make sure the light probe is only affecting the model

#

and not the rest of the scene?

#

Oh that questions doesn't make any sense! I finally get it thank you!!

#

any idea why shadows aren't appearing in the scene? Looks very flatly lit after baking

fallen fulcrum
#

did you enabled lightning in the scene?

silk ledge
#

yeah I have lights in the scene

fallen fulcrum
#

thats not what i meant

silk ledge
#

sorry what do you mean? Pretty new to this haha

fallen fulcrum
#

there is a small bulb icon in the scene view

#

click on it

silk ledge
#

yeah its enabled

fallen fulcrum
#

does your renderers have all "cast shadow" enabled?

silk ledge
#

oh let me check

#

is that in project settings?

fallen fulcrum
#

no its in the individual renderers but it should be enabled by default

silk ledge
#

I mean in realtime shadows are casting just not baked

fallen fulcrum
#

whats your current quality setting

silk ledge
#

is that in lighting settings?

fallen fulcrum
#

no in project settings

silk ledge
fallen fulcrum
#

is that the selected quality?

silk ledge
#

Yes

fallen fulcrum
#

hmm i'm out of ideas

silk ledge
#

also I'm wrong in real time sitll no shadows cast

#

could the light be too bright?

fallen fulcrum
#

it could

#

but i'm not sure thats the issue

#

does it look like this when you play?

silk ledge
#

let me export and check

#

yeah it does

fallen fulcrum
#

well check if the light is too bright, and i'm out of ideas 🤷

silk ledge
#

all good hha thanks!

#

Tried a lot still can't get shadows weridly enough :/

silk ledge
#

thanks for the help!

silk ledge
#

why dos some assets look worse when baked?

#

any idea why I can't go into the model import settings and generate the uvs on some assets?

silk ledge
#

Also why does the desk in realtime lighting (1) look so much better than the desk in baked lighting (2) which looks generally grimier to me

robust karma
#

Anyone know what this is and how I can reduce it?

silk ledge
#

These are my bake settings

limber delta
# silk ledge

Alright. Your indirect samples seems to be incredibly high. I'd try lowering them, maybe 256 for a start.

Perhaps try 64 direct and 80 on lightmap resolution. The Lightmap resolution I suspect will make a lot of difference.

Try baking with GPU if possible, should be quicker.

#

Also check this video for explanations of the different settings https://www.youtube.com/watch?v=hMnetI4-dNY&list=PL_fUBw8N69mBtgz2Lw9l0qcg3bGOi5Oah&index=3

In this video, you'll gain an understanding of how lights and shadows work in the Universal Render Pipeline, as well as how to set up a scenario with a mix of real-time shadows, Light Probes, and baked GI.

Speaker:
Ciro Continisio

Ask your questions here: https://on.unity.com/2UmP9TE
Did you find this video useful? Room for improvement? Let us...

▶ Play video
silk ledge
#

also any idea why on some of my modfesl I don't have the option

#

to go to the model import settings and generate the uv?

silk ledge
#

definitely an improvement!

#

shadows on the wall in general look pretty gross though. any idea why?

limber delta
limber delta
# silk ledge definitely an improvement!

Yes, nice! I'd continue experimenting with those settings. Perhaps start low, then try to adjust one at a time and see what difference (if any) it makes. Also watch the video I posted 😉

limber delta
#

If you are refering to the shadows not being sharp enough, look into "Shadows > Max Distance". Project Settings > Graphics > Click on the PipelineAsset file > in the inspector > you'll fins the setting under Shadows. You could try lowering the max distance.

silk ledge
limber delta
silk ledge
#

on the wall and desk

#

and that's a good idea I'llt ry that

#

hmm it is an fbx file..

unborn minnow
#

I have a moving light for my day night cycle and it keeps saying global illumination preprocessing and causing a lot of lag. Will this happen in the build too or can I disable something to stop it from happening. I already turned off auto generate lighting

silk ledge
limber delta
#

Yeah, I think someone else will have to try to help you. Don't know why that is.

silk ledge
#

I wasn't able to uv unwrap the desk, that may have somethign to diwth it?

#

also these pictures illustrated it clearer

#

(1) is baked 2 is realtime

#

maybe it's the model?

silk ledge
#

but ya I'm thinking maybe the lightmap on the model is messed up sinceI didn't have the option to generate it.

#

thats all I can think of

silk ledge
#

weird that he wall was discolored too.

#

nvm actually I know what caused that

#

ya I'll post again at some poitn if I feel like rivisitng the scene. Thanks again!

grizzled warren
#

Hi all,

I'm kind of coming to the conclusion that baked lighting doesn't work in Unity-- from any angle. I can replace the lightmappers and buy third parts probe placers. Then I replace all my material shaders, and then still get hit with this..

I guess I have a pretty dumb question here: but do baked lights in Unity work? Did I just waste months trailblazing technology that no one is using?

https://issuetracker.unity3d.com/issues/light-probes-lose-their-lighting-data-after-entering-play-mode-when-baked-and-realtime-gi-are-enabled

#

I'm looking into realtime GI ray tracing solutions, but they don't seem to work well with low end hardware

chilly kettle
#

baked lighting is used everywhere and works very good

grizzled warren
#

do you know of a game using light probes in Unity? I could use inspiration

#

it's looking completely broken to me

#

My levels have all been designed around baked lights.. so I can't really even scratch it all and implement a realtime light culling solution

chilly kettle
#

depends what you think lightprobes can do ^^

grizzled warren
#

keep their data

#

which... they can't

chilly kettle
#

They save the lighting they receive when light is baked.
And give their light to movable objects that come close to the probes

grizzled warren
#

I know Kj, I'm just venting I guess. The IssueTracker says it all-- they don't work. I don't know what to do, feeling extremely defeated.

chilly kettle
#

Did you try Unity 2022.2 like they wrote there (Fix Version 2022.2)

grizzled warren
#

I see that.. I'm wondering, Unity's betas are so bad, though....

#

this is so stressful, I have to read the IssueTracker and crash logs every day

limber delta
#

You should check the video I posted above 🙂

limber delta
#

I used Bakery for a while during our last project, but it gave me a lot of issues so for our current project I haven't used any plugins for baking and everything works fine now.

chilly kettle
#

Bakery is perfect ^^ But wont solve the problem of him i think

grizzled warren
#

yeah, I'm using the Bakery

#

I think 2022.2 is my only hope, if I don't try switching approaches (deferred lights or ray tracing GI)

#

None of my assets have tested there yet, though..

#

thank you Kj, I'll give it a try I guess

chilly kettle
#

thats all i can say ^^

grizzled warren
#

2022.2 is still beta alpha

chilly kettle
#

i never had your issue. When i bake lighting the probes work well

#

in 2020 and 2021

grizzled warren
#

I don't think Unity's beta alpha is stable, is it?

#

apparently, on build, there's a small chance your light probe data will be cleared out

silk ledge
#

Hey! Any idea why when I switch color space from gamma to linear the reflections on my windows go away?

#

(1) is gamma (2) is linear. In Gamma the reflection probes dont' appear to have any affect

#

*effect

hushed flicker
#

How do i avoid Sky light passing inside my buildings? 🙂 I've tried with volumes but the volumes affect the sky color

still copper
#

Could try adjusting the shadow bias

hushed flicker
vestal compass
#

Guys this is my first time trying to bake lights in Unity and the baking worked fine but it turned all of my materials into black and white. What I mean is the color in material preview and the actual color is miles apart

#

Please Help

silk ledge
#

Oooh I’ll keep this In mind! Good to know! Thanks!

crimson stirrup
#

hey guys, does anyone know why a light would be appearing here?

#

i've removed the skybox with the settings you can see on the right, there aren't any lights in the scene...

#

there was a directional light at the top of the scene 😭

#

adhd is amazing

#

i quadruple checked it

hushed flicker
#

How do I stop HDRI sky from lighting up closed spaces? A cube without lights get som gray lights from the sky through walls

upper fable
#

Skybox is used for reflections by default

#

Use reflection probes for more accurate reflections

hushed flicker
woeful otter
#

Is there a way to bake light in prefabs?

#

Or is there a better workflow

terse breach
vestal compass
terse breach
near bison
#

Does crunch compression not work with reflection probes? I have one for a mirror which is 8mb but while enabling crunch processes it for a while, it doesn't actually change in size at all, at least according to the preview window. It says it's using BC6H format.

I've noticed I can't seem to compress my lightmaps either. Same issue. Except these take up 16mb each.

heavy peak
#

its been this way before i baked it

#

and then i baked it

#

and its the same issue

marsh shale
#

Can anyone help me out with this? I have no idea why some are entirely lit by seemingly nothing while others are completely dark

#

issue comes primarily from my baked global illumination as it looks fine without it

vestal compass
thorny tusk
#

guys please help i have a problem i have a 3d black box but somehow theres still light inside how? do i fix

near bison
# marsh shale

Show your light settings on each one. You probably have them set to probes rather than lightmaps. Probes are only as good as your probe placement, so you get a lot of weird results.

thorny tusk
#

please help me thats the only thing i need to launch my game

near bison
thorny tusk
#

how?

near bison
#

How what? How do you capture a screenshot?

#

Win Shift S

thorny tusk
near bison
#

Well first of all, you appear to have a plane, not a box.

thorny tusk
#

yea

#

ii made a box with planes

near bison
#

Okay well that's unusual but without knowing if you are using baked lighting or not, all I can tell you is you both have "cast shadows" set to off, and you don't have contribute global illumination checked, so the objects will not be included in lightmap calculations, nor lightmapped. So any lightmapped objects inside won't be shadowed by it... Unless you're in distance shadowmask mode in which case they could be. It's complcated. Do you want your planes to be lightmapped?

thorny tusk
#

im new i barely understood anything

#

but i want it a box to have no light at all

#

plus my map is lightened by the sun

near bison
#

So you're not using baked lighting I assume. Cause if you were that's a little more advanced.

thorny tusk
#

yea

near bison
#

In that case just set Cast Shadows to On.

thorny tusk
#

where do i find cast shadows?

near bison
#

It's right there in your screenshot.

thorny tusk
#

oh

#

but theres still light?

near bison
#

Okay...

thorny tusk
#

i turned them all on

near bison
#

No, keep it on.

thorny tusk
#

my bad i mean on

near bison
#

To to the window menu.

#

Rendering

#

Lighting

near bison
thorny tusk
#

ok i just opened it

#

now what

near bison
#

Click on the environment tab.

thorny tusk
#

alright

#

i did

near bison
#

Environment lighting source, set that to color... Then make the color black and you will have no ambient lighting.

#

Then the inside of the box will be completely black but you may find that's not what you want for the rest of your scene. That's basically disabling ambient light. Which is useful when using baked lighting.

thorny tusk
#

theres still light..

near bison
#

Post a screenshot of what you're seeing.

#

And the settings on your light source.

thorny tusk
near bison
#

You didn't even change the source to color like I said to.

#

And you still have cast shadows off on your plane.

thorny tusk
#

ohhh

thorny tusk
thorny tusk
near bison
#

Have what the same colors?

thorny tusk
near bison
#

Cropping your screenshots so much is detrimental to me helping you. I have no idea what color selector box that is.

#

So I don't know if it's the right one.

#

That...

#

Should be set to this:

thorny tusk
near bison
thorny tusk
near bison
#

You really need to read my instructions more carefully. "Environment lighting source, set that to color... Then make the color black and you will have no ambient lighting."

#

It's right below the realtime shadow color you changed instead.

thorny tusk
#

oh godddd

#

everything is black

near bison
#

Well, yes you now have no amblient light.

#

Here's why everything is black...

thorny tusk
#

how do i do that?

#

amblient light.

near bison
#

How do you do what?

#

You just turned it off.

#

By setting to black.

#

Listen...

thorny tusk
#

oh then how do i make light

#

in other places

near bison
#

Ambient light is a global thing that gets added to all light everywhere.

#

So... With ambient light, you can never have an area completely in shadow.

#

But that's what you want.

#

In your box.

thorny tusk
#

yea

near bison
#

Sooo....

thorny tusk
#

i got what i want in my box

#

but not the rest of my map is black

#

how do i create light?

near bison
#

You add more lights that have shadow casting enabled.

thorny tusk
#

u mean cast shadows?

near bison
#

I don't understand the question.

thorny tusk
#

here look

#

i added a light

#

but still black

near bison
#

That's an area light,

#

It's a special kind of light for casting light from rectangles I believe.

#

I don't think it can cast shadows and I think that says baked after it but your inspector is so small I can't read all the text in it.

thorny tusk
#

so what light do i use to create a light like real life

near bison
#

Heh, boy is that a loaded question. 😄

thorny tusk
#

?

#

what is a loaded question

near bison
#

The one you just asked.

thorny tusk
#

i barely speak english

near bison
#

Oh... 🙂

thorny tusk
#

idk what loaded means

#

so do i make a direction light

#

or a point light or a spot light

near bison
#

A loaded question means... Well, it's a COMPLICATED question. You opened a can of worms. Pandora's box. The ark of the covenant. 😄

thorny tusk
#

oh

#

ok s how do i light up a area

#

is that better?

near bison
#

Well give me a sec and I'll explain why your question is complicated.

#

Light in games is all smoke and mirrors... a trick. We use lots of different tricks combined to fool people into thinking the lighting is correct. But it's not.

The closest thing you can get to real life lighting is to use BAKED lighting. Baked lighting bounces light around the scene, so areas that are hidden from the light source are dark. But baked lighting is lighting that is not dynamic. It won't change with moving objects or moving light sources. Shadows too will be static. So, we have ways to combine baked lighting with real time shadows that are not totally accurate but look good. That's called shadowmasking. When you set a light to Mixed mode instead of Real Time or Baked, it is both baked AND real time, and casts real time shadows onto a baked environment. Distance Shadowmasking is a more advanced mode which is also less performant where all non-moving objects with baked lighting can also cast real time shadows onto moving objects.

#

Sooo... You have two choices. Learn how to bake light in your scenes... Or add a few strategically placed directional light sources in the scene with shadow casting enabled which is gonna increase your rendered polycount a lot, but for a simple game it might be fine.

#

The latter solution probably isn't gonna look great, and depending on your scene might not even be a workable or good solution.

thorny tusk
#

oh god

#

uhhh

near bison
thorny tusk
#

oh alright thank you

thorny tusk
#

il fighure it out myself

near bison
#

Watch those.

thorny tusk
#

thanks for vids

near bison
#

Let’s learn how to create reflections by using Reflection Probes and Screen Space Reflection (SSR).

♥ Support Brackeys on Patreon: http://patreon.com/brackeys/

····················································································

♥ Donate: http://brackeys.com/donate/
♥ Subscribe: http://bit.ly/1kMekJV

● Website: http://brackey...

▶ Play video
orchid solar
#

How do I make realtime spotlight more smooth? In the photo, you can see layers from the spotlight, I want to smooth out the layers

hardy ridge
#

May I ask why this happens? I am using HDRP but it seems like these two wall objects are being lit very differently, even though they are two copies of the same object (literally cntrl c + cntrl v).

near bison
# hardy ridge May I ask why this happens? I am using HDRP but it seems like these two wall obj...

It doesn't look like you're using baked lighting, but if you are using light probes then the two objects may be picking up different light probes if you don't have them set to global illumination lightmapped. In that case, you could either set them to be lightmapped and bake the lighting, or you could set one to be the reference probe for the other. There's a slot for you to drop an object in the lighting settings on the object.

#

What this will do is it will make one object use the other object's transform as the point from which it samples light probes. You could also just make an empty object and then set both of them to reference it, and then you can move that empty object around to get it in a position where the lighting looks good.

hardy ridge
#

That makes sense! Thank you so much!

deft fiber
#

Might not work on all build targets though, such as webgl

eternal pasture
#

After several hours of light baking, the process stuck on 99%. I tried to change the settings and reduce the resolution but the result is the same. Is there some way to hard stop light baking and keep the current result? Because the scene looks good, but as soon as I stop baking, all changes are reset.

#

I use Unity 2020.3.18f1 - I need to use this specific version for AltspaceVR.

wintry ether
#

why before baking light is better than after bake?

mild jungle
#

when i open prefab and return to scene it becomes very dark any idea how to fix this?

acoustic niche
#

Hi, devs! Do you know why light (Directional Light) is entering my scene (interior) if everything is perfectly snapped?

#

Thanks in advance

upper fable
# acoustic niche

If the mesh is flat shaded, edges will split when rendering the shadow map which can lead into gaps in the shadows, smooth shaded meshes doesnt suffer with that. Making the shadow casting double sided can potentially fix those gaps but its not guaranteed. I think only way to guarantee no gaps is to use smooth shaded mesh for shadow casting or use 0 as a normal bias which you shouldnt do to avoid ”shadow acne”

deft fiber
acoustic niche
main wolf
upper fable
quartz zinc
#

Hello i am currently having a problem with my lighting where it is just pixelated for some reason
Can someone please help😅

upper fable
acoustic niche
acoustic niche
deft fiber
acoustic niche
#

Thank you so much, @deft fiber

ripe current
#

so just wondering, i just created a new project before, added urp and i am trying to bake light on a simple scene but with the progressive GPU lightmapper its using 100% of my CPU and none of my GPU.
Just wondering if there is a fix for this because it would decrease the baking time massively

deft fiber
ripe current
acoustic niche
#

Hi again, @deft fiber and @upper fable! The problem still appears after testing, even, with very thick meshes inserting one into another... This is freaking us out!

acoustic niche
#

On the exterior (where Directional Light comes from) also happen weird things...

#

May be wrong some option on .FBX importer?

fleet tiger
#

has anybody ever had this issue? I've baked this scene multiple time and it looked fine until now, but now whenever I bake it, some objects always have their shadows renderered properly while others are 100% covered in shadow when far from the camera. The baked shadowmasks look pretty much fine so I have no idea what the cause could be

acoustic niche
fleet tiger
#

Well, the distance is like 25m, which is seemingly the distance at which the baked shadows are supposed to replace the real time ones
For some reason this is only working on a few specific objects

#

basically :
Shadows below 25m are fine on all assets
Shadows above 25m are either completely black (not counting ambient light) or proper baked shadows on seemingly random assets

fleet tiger
#

ended up fixing it by reverting a ton of changes to the import settings on all the assets in the scene
those changes were to their lightmap uvs, but considering they looked mostly the same before and after the changes go figure what the actual problem was

acoustic niche
hybrid rivet
#

An issue regarding lighting.

#

I have to turn lighting up to 4000000 lumen for it to actually show up in my scene- I don't understand why. When I open it in prefab menu it's extremely bright but when it's actually put into the scene it's like normal.

#

How it looks in the prefab menu.

#

vs how it looks in the actual game.

#

I'd like the lighting to not be set so high for it to actually show up but idk how.

main wolf
# acoustic niche

Is it baked light? if it is then try adding bigger padding to the lightmap

acoustic niche
acoustic niche
#

It does not work, @main wolf...

chilly kettle
chilly kettle
acoustic niche
chilly kettle
#

Its happening often, that edges look like yours.
You can avoid this by adding geometry on the ousides, that blocks the light from hitting your walls from the outside

acoustic niche
chilly kettle
#

normally, you solve problems, step by step 😄

acoustic niche
#

Light is working so weird: entering edges, not respecting zones that are inside...

acoustic niche
#

Totally crazy...

chilly kettle
#

yeah, thats light bleeding from the corner into the inner

acoustic niche
#

This meshes are snapped properly, double sided... and nothing works!

chilly kettle
#

yeah, as i said, its not working this way most of the time.

acoustic niche
#

Could it be due to my Unity version (2021.3.2f1)?

chilly kettle
#

No, as i said you need additional geometry on the outside

#

did you model that house yourself?

acoustic niche
#

I can show you the entire scene on a Discord call if you want...

chilly kettle
#

You need additional geometry with the normals facing outside

#

that can avoid all the light leaking in the edges

acoustic niche
#

So... converting these planes into boxes with normals facing outside and snapping all together again, @chilly kettle?

#

Is that what you mean?

chilly kettle
#

wait, i show you on a 3d model 😄

acoustic niche
#

This interior is going to be illuminated by some windows on the scene, but the rest need to be like this: no light entering edges, roof and more

acoustic niche
chilly kettle
#

Left side is yours.
Right side is the the same, but with geometry on the outside, that will block the light.

acoustic niche
#

After doing what you recommended us, @chilly kettle, this is the result!

#

It is still presenting weird issues...

#

And I think this solution may not be what we need because we have to add some windows to the walls...

chilly kettle
#

show me your model ^^

deft fiber
hybrid rivet
deft fiber
#

You should have the sample scene to reference sane exposure and lighting values from

hybrid rivet
#

it's on 0 rn.

upper fable
hybrid rivet
#

what can I edit that'll affect how much light I'm seeing here

deft fiber
#

Please use the sample scene for comparison

hybrid rivet
# deft fiber Exposure

Would I edit the exposure in a volume or somewhere else? because when I edit the exposure in a global volume it doesn't seem to change anything.

deft fiber
#

Yes
It should have an effect

hybrid rivet
deft fiber
hybrid rivet
#

yes

deft fiber
#

So use that as a reference as a base to build from

hybrid rivet
deft fiber
hybrid rivet
#

hm...

#

Guess I need to import it again. I'm assuming it would be in package manager.

deft fiber
#

I mean this place

hybrid rivet
#

I have never seen that in my life.

#

The sample scene they usually gave us was a chunk with some ply wood.

#

Is it on the asset store?

deft fiber
#

You are using HDRP, right?

hybrid rivet
#

Yes.

deft fiber
#

You get this scene as a project template when creating a new project

hybrid rivet
#

I did not create this project. I'll have to ask my coding partner about that.

#

Thank you for the tip.

deft fiber
#

HDRP is quite complex and expects you to understand physical light values and exposure, won't really hold your hand at all
Using a template is extremely helpful because then you don't have to know how to set up

#

all this

hybrid rivet
#

Yes, I've been messing around with those for a few months now. It's very difficult to perfect without any sort of reference.

deft fiber
hybrid rivet
#

That would work too. I'll try that, thank you.

main tartan
#

Hi! Do you know why my lighting is supposed to look like that but when i load a new scene with LoadAsync it just look terrible?

fleet tiger
#

Does your 2nd scene also have a light source?

main tartan
#

yes

deft fiber
acoustic niche
# chilly kettle show me your model ^^

We have changed model and light artifacts seem to be working fine. Our new problem, I guess, is on materials: Unlit shows transparent. May be a problem with .fbx?

deft fiber
# main tartan oohhh i see thanks!

The reason it doesn't happen in the editor it I think is because the editor generates temporary lighting for each scene when opened, even when auto-generate is off
Not sure why it isn't communicated better

main tartan
worn tapir
#

Hey, do any of you know an asset store item that adds volumetric lighting (preferably with shadows) to URP and supports camera stacking and VR?
price can be up to 200$.

mental lagoon
#

Fog: BOXOPHOBIC
Light shafts & cloud shadows: Staggart Creations

mental lagoon
static granite
#

In the urp, is it possible to make it so lighting is received from one angle, but all shadows are cast straight down? I'm making a 3d platformer, and it would be a great way to make the lighting more dynamic without sacrificing depth perception.

deft fiber
brazen oak
#

I have a game which loads in multiple scenes at once. How do I use the skybox of a particular scene, instead of just using the skybox of the first scene to load?

hidden void
#

hey guys I am tryuin to crete a reflection probe, it doe not create an reflective object

#

ah ok I have to activate gizmos

static granite
deft fiber
static granite
#

Nice

upper fable
#

Using custom (handwritten) shader you can get much more control over the lighting and shadows

keen elbow
#

im having some trouble getting unity to bake lighting

#

it just gets stuck at 82% complete on baking

#

but im not seeing any changes in the scene

silk ledge
#

Before and after^
any idea why after updating from unity 2019 to 2020 , the lightbake on this model made it grey?

silk ledge
#

?

bleak merlin
#

In the game view sometimes shadows appear/dissapear out of nowhere. Any settings to fix that?

silk ledge
#

any idea why the new unity version messed up the drawer model?

little condor
deft fiber
little condor
fleet tiger
#

hey, I was working on my laptop and set up a bunch of light probes in a scene, which worked fine
however, I opened the project on my other PC, and not only are those light probes not visible or selectable, I can't see any others I'm adding, to any scene
any idea what the cause could be?

#

nevermind, restarted unity and for some reason they're there now

wicked lagoon
#

Is there a way to have good open outdoor lighting without ambient light. Because I need some areas to be darker interiors and it looks strange with a lot of light coming from nowhere.

upper fable
wintry ether
#

why while moving camera editor eats 30ms?

#

thats like 160 fps -> 30 fps

upper fable
timber lichen
#

Hello, I'm watching Brackeys tutorial regarding 2D Lighting. So, I'm wondering which of the several options I'm supposed to choose that is supposed the same as the "Pipeline Asset" option in his video?

deft fiber
pastel storm
#

Is there a way to visually debug whether a cast shadow is realtime or from a shadow map?

silk ledge
#

Hello! Any idea why my starfield skybox looks so pixelated?

#

/compressed if you click on the piecutre you'll see what i mean

silk ledge
#

i am using vr btrw

silver onyx
#

Can someone give me a hint of why i cant make area light to work ? Im using Unity 2020.3.22f1, and i chosed render mode - important + generated lighting, but it just doesnt want to show up

deft fiber
silver onyx
#

i dont get this area light, why it cant be like a point light , i think ill skip trying to use it for now, not ready for it yet

#

is there any other way except using area light to achieve this mesh like light reflections on a car i draw with red line ? using point lights gives round reflection which doesnt match the mesh shape

deft fiber
deft fiber
silver onyx
main wolf
silk ledge
fringe otter
#

I'm currently following a tutorial for planet generation and I've run into this issue with the lighting being bad along the seams presumeably due to there being multiple normal vectors at the vertices along the seam. I'm new to unity/3d modeling/rendering objects so I was wondering what the best way would be to deal with this

#

^picture for reference

main wolf
#

Since it's a planet, you can just recalculate the normals by substracting vertex position with object center

upper fable
#

Works only assuming its perfect sphere

agile tinsel
#

Hello guys, I'm trying to animate the material of a skybox material, specifically it's rotation over time.

agile tinsel
#

Can anyone please help on how to do that? I have been trying for a while now and can't figure out anything

chilly kettle
fringe otter
#

right now I'm using the recalculateNormals method to get the normals

upper fable
fringe otter
#

for context, im currently getting the sphere shape by first generating a cube, then normalizing the distance and applying some noise to get some random variation

inland solar
#

Are light probes and raytracing the only 2 ways to get lighting on dynamic objects in real-time? Just checking

woeful otter
#

Hey all. does anyone know what is the best lightmap resolution and light map size for mobile?

#

Unity docs don't really have platform specific settings

upper fable
#

For smooth shaded cube you would need 8 vertices and 24 for flat shaded

fringe otter
#

nope lol. Right now I have defined an array of vertices, and the triangles are just defined as indices for that array of points

upper fable
#

Try to understand how smooth shaded cube and smooth shading works in general to find out what you need to do

fringe otter
#

thanks for the pointers, i'll check it out

wise hawk
#

Hey guys

#

do you think it would be possible to manually combine lightmap textures to improve batching?

#

With my GPU, I can't bake above 2048 due to video memory limitations, it falls back to CPU right away and never completes (I left it running for almost 2 hours)

#

I haven't looked into the problem very deeply yet but I'm wondering if it would be possible for me to manually edit the lightmap textures so that they're all on a single sheet and then somehow change the lightmap indices and UVs for all the objects in the scene so that it uses one single lightmap. I want to do this to try to improve the batching

wise hawk
#

I recommend manually calculating your normals and tangents instead

chilly kettle
wise hawk
wise hawk
#

I didn't think much of it initially but I'm doing optimization today and I was looking at the frame debugger and every 3rd drawcall is broken. My scene is really big and there's 10 lightmaps!

#

I think I might be able to "fix" it by manually batching instead of just using automatic static batching to make sure objects in the same general visual area use the same lightmap, but it feels like a lot of work

chilly kettle
#

Maybe do the full bake with CPU 😄 When this is really a GPU problem

wise hawk
#

It never completes! It hung at 99% for almost two hours

chilly kettle
#

never seen that the GPU runs full, even with a 4098 1GB Lightmap 😄

wise hawk
#

And it was using 15.5/16gb of memory, on the CPU

chilly kettle
#

Weird

wise hawk
#

On the GPU it gives me a CUDA out of memory error almost instantly

chilly kettle
#

If you have some Dollars, give "Bakery" a try

wise hawk
#

I've been looking at that yeah

chilly kettle
#

using it for years now

wise hawk
#

I just don't really care about all the extras so I was hoping to find another solution!

chilly kettle
#

i cant help you with your problem, sry ^^

#

I can just recommend Bakery for everything 😄

wise hawk
#

Do you know if Bakery works on top of the regular Unity lightmapping system? As in, does it loads its lightmaps into the regular lightmap data?

#

'Cause if it does I should be able to come up with some black magic to combine the existing 2k lightmaps

chilly kettle
#

it has its own Bakery tab where you can change all the settings. The baked lightmaps finally fit in in the normal unity lightmap system after bake.
Just some Lightmap-Debugging Views do not work with bakery

wise hawk
#

That's promising

chilly kettle
#

There is a very detailed documentation

fringe otter
#

Are there any resources you'd recommend I check out aside from what Aleksi mentioned

keen elbow
#

How can I remove jittering with lighting?

#

like I have a model moving through the scene and the shadows are working well for the most part, but tend to jitter as the model is moving between lights

#

I need the lighting to be smooth

little condor
keen elbow
#

2021.3 with the URP

#

its tried a bit and have improved the shadow quality and shadow rendering distances

little condor
#

So this is for a directional light, or point lights?

keen elbow
#

one directional light and 5 spot lights

little condor
#

Might need to see a screenshot or something

keen elbow
#

yea, though it is a apart of a nda project so I cant show it much

#

just wondering if there was a possible small thing im missing that would get it working correctly

#

still a bit new to lighting

little condor
#

Usually, the jitteryness of shadows comes from bias, which can be tweaked on the directional light. But I'm not sure if that is what your issue is related to:

keen elbow
#

that has helped out quite a bit already

#

I think the spot lights are still causing issue, but a lot of the jitter I saw on the back of the model has been removed

little condor
#

Also, in your Assets > Settings folder, you can adjust the shadowmaps settings for each High, Medium and Low quality setting. Check if you shadow maps are using just 1 cascade count. You might want o bump that up to 2,3 or 4. This is just for directional lights though.

wise hawk
# fringe otter Are there any resources you'd recommend I check out aside from what Aleksi menti...

It's just a bunch of math, but the basic method is to consider all triangles a vertex is attached to, compute the normal of the triangle by getting the cross product of the vertex positions then average all those normals to save it into the vertex. If you want, DM me and I'll give you a more step-by-step of it. It's not that complicated but it's definitely not extremely straightforward if you don't understand vector math very well

wise hawk
#

To actually do this in my mesh generation code I calculate the normals per triangle for the whole mesh, then I check which triangles a vertex is connected to, add all those normals together then normalize it. There's additional steps if you want to do angle limiting and smoothing groups and other things... It gets pretty complicated

keen elbow
#

I do have a 3 cascades with lighting

keen elbow
#

im not sure how to fix this shadow jitter

#

its like as the model is moving along the shadows vary in intensity and shape

#

and i dont get why

#

i have lighting settings similar to other projects ive seen so far

#

and the shadows on their models isnt jittering about

#

and the lighting seems todisappear when the model gets tooclosethe the camera

fringe otter
#

i also don't really know the scale of reasonability when it comes to what kinds of computations you can afford to do

#

i'd assume making some sort of map that maps vertices to normals is probably pretty expensive

wise hawk
#

It's pretty fast. My normal recalculator thing runs within one normal frame without any problems, along with all the other mesh generation bits

#

I didn't even write it well, it's super sloppy and uses tons of lists and dictionaries with allocations everywhere!

deft fiber
fleet tiger
#

hey, is it possible in the urp to manually force a light to render its shadowmap from code and return it, like how you can force a camera to update using Camera.render ? and if yes, is it possible to exclude dynamic object from that shadowmap?

#

talking about the shadowmap that's basically a depth buffer from the PoV of the light by the way

deft fiber
fleet tiger
#

I'm working on volumetric lights and right now it uses the lights's shadowmap to have shadows in said volumetric lights
problem is, with baked lighting in mixed mode, those shadowmaps only include dynamic objects, and thus the volumetric lights go straight through static surfaces

#

I'd like to be able to precalculate those shadowmaps, store them, and then at runtime sample both these precalculated shadowmaps and the realtime ones for volumetric shadows

#

I think HDRP has some function to manually update light shadowmaps but I didn't see anything like that in URP

deft fiber
#

Only subtractive mode has the limitation of not including static geometry in mixed light shadow mapping

fleet tiger
#

Using shadowmask right now
Maybe something changed between versions?

deft fiber
fleet tiger
#

Yes, but the shadows in shadowmask mode come from shadowmaps that are relative to each static objects's surface, not the shadowmaps that are from the light's PoV

#

If you bake a scene in mixed and then check the realtime shadow maps in the frame debugger, you'll see they only include dynamic objects

deft fiber
#

So that leaves baked indirect as an option, I think

fleet tiger
#

I'll look into it, problem is then the actual shadows displayed on surfaces of dynamic objects are no longer baked
I get why it's that way, it'd be redundant if not make shadows worse to include static objects in real time shadowmaps if they already have their shadows baked, just wished I could tell lights to also render a lightmap with static objects included lol
I imagine my best option right now is to have some custom editor script that spawns camera on all of the lights, get them to render a depth texture of all the static stuff, and save that somewhere, hope it won't be too annoying to get the camera's FOV, resolution, etc to match the lights

#

at least I can do it in a lower resolution or something

wise hawk
#

I think maybe the easiest way would be to just put it in the mode where dynamic objects get shadowed and then manually re-create the behaviour by using culling layers

#

Since you can sample the shadowmap texture, when you need it "on demand" just enable the light, sample the texture once then disable it

fleet tiger
#

I'm only worrying about spot lights right now for what it's wirth

#

good idea tho

wise hawk
#

Unity shadowmapping is pretty weird to play with

#

I wish it was less blackboxed

fleet tiger
#

like many things in unity to be fair

#

well, "fair"

wise hawk
#

I just found out yesterday that although you can provide your own lightmaps, UVs, textures, directionality etc. It resets it every time you enter play mode. Including the UVs for all the objects in the entire scene :^)

fleet tiger
#

lol

wise hawk
#

After spending 2 hours learning C++ again so I could build an EXR combining program by using OpenEXR, yep, the real issue is that Unity doesn't serialize the lightmap settings anywhere

#

For only spots I think you could do it manually like you said

#

It shouldn't be too hard to re-create the lighting function since it just samples a texture for falloff. But at the same time, getting your shader to behave the same as the normal lighting might be difficult

fleet tiger
#

I don't really need it to behave the same as normal lighting as actual surfaces will still be rendered with normal lighting
I only really need those spotlight depth textures in post processing when it comes to rendering the volumetric lights

wise hawk
#

Any chance you could like

#

make two lights

fleet tiger
#

in which case I'm gonna use them very differently than what they're made for anyway

wise hawk
#

One is set to hard baked, one hard realtime

fleet tiger
#

yeah like you said earlier

#

I sent it to the other person I'm working with, we'll prolly look into it

#

oh nvm I see what you mean
Wouldn't it result in static objects receiving realtime shadows on top of the already baked ones tho

gaunt bloom
#

Is one of my settings horrible or something? Because I get these weird lightmaps always in URP. Any advice for better lightmaps?

keen elbow
#

they look very rough

deft fiber
keen elbow
#

I am a bit limited in what I can show due to the project, but this might help

#

the. floor shadow I. know. can be adjusted

#

but the body shadow is being tricky to adjust

#

and when it moves, it looks splotchy

keen elbow
#

the shadows move around unnaturally when moving

#

I cant really find anything about tthisproblem

#

they still look kinda ugly at 4k

little condor
# keen elbow I cant really find anything about tthisproblem

The shadow map size looks like it might be quite small, so try uping the resolution to get a clearer shadow. If you're using URP/HDRP, you might be able to get some additional sliders if if you click the elipse on the Shadow component. Play with those sliders to try an improve the shadow:

keen elbow
#

there arent anymore sliders

little condor
#

You don't see these on the Directional light?

keen elbow
#

no

#

my directional light shadows look completely different

little condor
#

Ah, well you have the Bias and Near plane sliders there already. Normally adjusting those can fix shadow issues.

keen elbow
#

I playedaround with them a lot yesterday

#

it helped wth the shape, but not the blotchness and weirdshadow movements

#

and the cascades still had some really ugly seams to them

#

is there a guide or something onn shadows?

#

cause, like im not really sure how I can improve this at this point and I know its not satisfactory

little condor
#

If you're using URP, go to your Project Settings and click on Quality. Are you using the Low, Medium or High quality settings?

keen elbow
#

medium

#

a medium im making

little condor
#

The medium quality shadows are quite low quality. Select your 'UniversalRP-MediumQuality' asset in the Assets/Settings folder, and then up the cascade count from 1 to 3. See if that makes any difference:

#

I just tried it out on a new URP project and that seemed to fix the blotchy shadows for Medium quality

keen elbow
#

its at 4 already

#

and it. has improved it

#

but apart of the problem is I do need the character to be right up near the camera

little condor
#

Hmm, I'm not sure then. Being close the camera should be fine because the first split in the cascade dedicates a texture to everything in the 5 meter range, so it should be sharp.

You defiantely seletected the correct quality in the settings like this?

keen elbow
#

yup

little condor
#

Do you see any difference if you swap to High quality and Low quality?

keen elbow
#

some differences yea, both looks worse, thought that is in part cause i havent touched them yet

little condor
#

One more thing to try before I run out of ideas. Have you tried reducing the size of your split 1 cascade? Instead of using 5m, use 1m. That will improve shadow quality that is close to the camera.

bitter furnace
#

light leak on a plane

bitter furnace
#

fixed it with near plane on lighting

fringe otter
wise hawk
#

That looks good! You should test it with a more wacky planet shape

fringe otter
#

was confused when my map was behaving weirdly until i realized that using vector3's as a key inside a map didn't work so well 😵‍💫

wise hawk
#

yea

#

In other news, unity fix recalculatenormals pls

fringe otter
#

looks fine, although now im noticing that turning it on higher resolution seems to be a lot slower

#

the thing is that the issue before with the seam got resolved once i turned the resolution up so maybe i just wasted all this time for nothing 😢

#

hmm actually the seam is still visible with the old code so i guess i just have to optimize my current solution

#

thanks for all the help tho dizzie love_panda

wise hawk
#

Inigo Quilez has some stuff on how to do normals more faster

#

I haven't actually read it but I saw that page when I was looking it up earlier

fringe otter
#

i'll check it out, i don't think its an issue with the normal calculation tho

#

what i ended up doing was just using recalculate normals like before, but added an extra step after all the face meshes were genereated

#

where i just looped over all the vertices and grouped the ones that were roughly the same

wise hawk
#

hahaha

#

That's one way to do it

#

I dont think their function is especially fast though

fringe otter
#

that's prolly true, but testing it with just their function vs their function + my new code has a very signficant downgrade in speed lmao

#

so before i work on the normal code i probably have to find a better way of doing what im currently doing

wise hawk
#

You shouldn't need to if you do it yourself

#

What's happening with recalculatenormals is that it creates hard edges at limit angles

#

That's basically duplicating verts right

#

It has to create two overlapping verts with different normals to create the hard edge, which is what you're welding after

fringe otter
#

i think so? I'm not actually really sure how all the normal stuff factors into the lighting

#

i just have multiple distinct normals at the points where my different faces intersect

#

which could be an issue with what you're describing above, i have no idea lol

#

i just saw that i had multiple normal vectors in some places when i tried to debug this

wise hawk
#

The colour of the lighting is defined by difference in angle between the lightsource to vertex and vertex normal

#

Like this

fringe otter
#

ok, why are the normals so different at the intersection points then?

wise hawk
#

And since it's per vertex, the only way to have hard edges on like a cube for example is to have multiple vertices with their own normals

#

So this is happening:

#

Then the faces along each edge of the cube are connected to the verts which face in the right direction

#

The reason why RecalculateNormals does this is so that if you call it on a cube, you don't end up with a weird smoothed box that lights wrong

#

Normally you would be able to specify the angle for the limit, if you look in the mesh importer there's a slider for it

#

for some reason though Mesh.RecalculateNormals has no such argument

#

It also breaks if you have overlapping faces that go in different directions, like a billboard or something. It's pretty bad in general

fringe otter
#

hmmm

wise hawk
#

yea

#

Exactly that xD

fringe otter
#

so i did notice while testing that my cube has some funny lighting lol

wise hawk
#

It's lighting it like a sphere basically

fringe otter
#

yeah thats what my normal vectors are like

wise hawk
#

I think the reason why they haven't fixed it is because recalculating normals is kind of a straightforward problem, so anyone doing really major procedural mesh stuff probably already knows how to do it

tribal wolf
#

I LOVE LIGHTING

fringe otter
# wise hawk What's happening with recalculatenormals is that it creates hard edges at limit ...

can you elaborate on this? I guess from the way I'm looking at it rn, the behavior with the lighting on the seam in my original picture is what's intended to happen. Like for example if I wanted to generate a 100-gon, i would want the edges to show up even if the normals at the edges are quite similar. If my intent is for the edges to not show up, then I need to apply my own processing to the resulting normals i get

#

or i could try to generate the normals manually if i wanted to be more efficient

#

but to me it doesn't seem to be an issue with recalculatenormals, rather just an incompatibility with what I wanted and what the intended behavior is

burnt jay
#

I still haven't found a solution to this is someone could help me i would appreciate it

static pasture
#

Cant find anything online about it
When you create custom light map uvs, How do you designate the index the uvs should use?, uvs i have will end up in a max of 3 indexs unless i can clean it into two.

any insight on this would help.

burnt jay
chilly kettle
static pasture
chilly kettle
#

what do you mean with indexing

static pasture
#

this thing

chilly kettle
#

The Lightmaps UV channel is per Object. So it should not care about the number of Lightmaps you have.
Some Objects are in Index 0 Lightmap, some objects in the index 5 lightmap.

static pasture
#

issue is the amount unity creates when the scene is not one massive object but many small ones

#

if i have control i can turn the current 8 down to 3

chilly kettle
#

Normally, Unity will pack them together in as few as possible

#

As you can see here, it packs a bunch of Objects into them

#

But yes, the blank space could be used better

static pasture
#

the auto packer leaves massive dead spaces like this in every index sadly, software im using does a much nicer job

#

bit rough since i need to finish unwrapping a few loose bits

chilly kettle
#

Then uncheck "create lightmap uv" in the import settings of the object

#

then unity use the one from blender

static pasture
#

But it comes back to the indexing problem :p, if i have 3 of them, how do i tell unity not to mix it into more

#

Also how do i let unity even know it's 3

chilly kettle
#

hmm

static pasture
#

wait, if its 3 fbxs

#

i think it's 1 per fbx

#

maybe

chilly kettle
#

do all 3 fbx have the same UV?

static pasture
#

is just one big fbx atm with alot of smaller objects within it

chilly kettle
#

see this thread

#

could be your problem

static pasture
#

o:

#

that has the keyword i was after

#

It's a "Baked Tag"

chilly kettle
#

fine ^^

static pasture
#

ty ty, will need to test it when i wake up

wise hawk
#

Like it's probably set to... i dunno, 60 degrees?

#

So any edge that's over 60deg. gets split automagically

#

In other words it's only ever useful if you're in the narrow case where you want hard edges at 60 degrees

wise hawk
#

Baked Tag and System Tag don't determine which lightmap texture is used, they're just to ensure the objects are grouped together when the lightmaps are auto-generated

#

If you want to set the lightmap texture manually, it's in the renderer

#

I've been working on this problem for the past 2 days to try to atlas all the lightmaps into one big one

#

Unfortunately, the lightmapIndex and other lightmap settings including the textures themselves are not serialized in the scene. It doesn't say where they save, I'm guessing it's inside the LightmapData.asset file but since there's no information anywhere on how to read it and it's a binary file, it's not looking like a very good solution

#

You can just set the lightmap index/UVs/textures manually every time you load the scene, but for me it didn't work. Entering play mode reloads the scene and then if I re-apply the lightmap data while in play mode it just gets all scrambled

#

also Baked Tag and System Tag don't even guarantee the objects will be atlased together. It's a recommendation

fringe otter
deft fiber
fringe otter
#

I might be missing something, is recalculate normals doing something more than just setting mesh.normals?

#

I guess I don't see the relevance between recalculate normals and the limit angles

fringe otter
wise hawk
#

Yeah basically

#

There is no option though using Mesh.RecalculateNormals

#

and that's the issue, since that might not fit the model you're using. I'm not saying it's literally 60 degrees, I actually don't know what the limit is since it's not written anywhere

#

If you go in a mesh's import settings there's an option to recalculate normals with a limit slider. If you drag it around you'll see what I mean

#

I think the correct term for this is smoothing angle

robust hearth
#

a very simple question... is it possible to have 2 directional lights and make 1 camera to use just onne of them and another camera use the other?

#

well actually is the same light, but on one camera i want that light to always have the same angle but not on the other one

chilly kettle
deft fiber
robust hearth
#

oh

#

i have the built in render pipelinne

#

gonna try thanks a lot

robust hearth
#

@deft fiber @chilly kettle , worked perfectly but just addinng the OnPreCull 👍 thanks!!!

chilly kettle
#

For most problems, you are just one google search away from the solution 😄

robust hearth
#

actually i saw the post you shown me but it was so old that i didnt trust it 😅

#

sorry about that

wispy steppe
#

Anyone know why this is happening ?? build is messed up! even fog gets messed up with reflections from far distance... Built-In Pipeline. Baked.
Please @ me if you can help me, thxx

chilly kettle
wispy steppe
chilly kettle
#

Im quite sure you have to build in the highest quality you want your game to run with.

#

Consider donating to help me keep this channel and website alive : https://paypal.me/supportTheGameGuy 💖

In this video im gonna show you how to control and change quality settings of your game (Using URP) during runtime using a dropdown menu. We will be creating a simple settings menu to swap between different quality levels using different ren...

▶ Play video
wispy steppe
chilly kettle
gaunt bloom
#

I just baked subtractive lights in my scene, where the only dynamic object is the player here. Why does the players shadow get darker in baked shadows though? Am I missing something?

chilly kettle
gaunt bloom
chilly kettle
#

Yeah. i think the directional light goes through and casts an additional shadow from your Character on the already baked shadow from the Building

gaunt bloom
#

hmmmm, I wonder whats causing that...

#

Because those buildings have shadows on

chilly kettle
#

Can you show the Settings of the light

gaunt bloom
#

Here ya go!

#

Are two sided shadows causing this? Those buildings have two sided shadows

chilly kettle
#

Culling Mask is set to Player.

#

means the light ignores the building (if its Layer is not Player)

#

If you set the Buildings Layer to "Player" for a second, it should solve the problem

gaunt bloom
#

Oh yea

#

Lemme try

#

Nope

#

No shadows at all this time

#

I put the buildings in Ignore Directional Light

#

layer

chilly kettle
#

The Layers you activate in the Culling Mask mean, that they light only gameobjects that use this layers

gaunt bloom
#

Understood, but its not working either way around

chilly kettle
#

Both cubes have Layer "Battle"

#

if i give one cube the default layer now, he wont throw shadows anymore nor receive light.

#

Means your Building and Players Layers have to be activated in the lights culling mask

gaunt bloom
#

I understand, thanks, but it doesnt work

chilly kettle
#

😵‍💫

gaunt bloom
#

Ikr XD

chilly kettle
#

i hate mixed lights

#

Can you use one baked and one realtime? 😄 haha

gaunt bloom
#

Me too UnityChanFrustrated

gaunt bloom
#

Havent tried

#

Can two directional light be in the same scene?

#

They totally can !

chilly kettle
#

Sure

gaunt bloom
chilly kettle
#

i always have problems with mixed lights.. never get them to work

chilly kettle
gaunt bloom
#

No it honestly isn't but what can we do 🤷‍♂️

chilly kettle
#

because substractive does exactly what you didnt want: "Static Gameobjects receive real-time shadows from dynamic GameObjects"

#

Maybe @deft fiber has an idea 😄

deft fiber
chilly kettle
# gaunt bloom

@deft fiber why the shadow of the player is adding to the already baked shadow using substractive mixed light

deft fiber
#

That's the expected result with subtractive lighting mode

Because shadows are baked into the lightmaps, Unity doesn’t have the information it needs to accurately combine baked and real-time shadows at runtime. Instead, Unity provides a Realtime Shadow Color for reducing the contribution from the lightmap to create the illusion of a correct blend between baked and real-time shadows. You can also tweak the color to achieve a certain artistic style.

#

So it's a good idea to try baked indirect or shadowmask, though they have their own performance considerations

chilly kettle
#

Adjusting the realtime shadow color is THE way to get a good result with subtractive?

gaunt bloom
#

Oof well lemme try

deft fiber
green ridge
#

Hey, I'm new to lighting but I was wondering if light probes wouldn't allow dynamic lighting. For example my project was a day and night cycle. From what I read light probes store data for lighting dynamic objects by baking it. Does that mean if I were to use light probes even if the game is in the night cycle it would light up dynamic objects as if it was daytime?

green ridge
#

So using light probes in my game wouldn't be an option unless it's something like an indoor space unaffected by the day / night cycle? If not Ik from my understanding that lights are pretty expensive, and having each one make realistic shadows / etc. can be taxing on performance. If I can't use light probes do you recommend any other solution?

chilly kettle
# green ridge So using light probes in my game wouldn't be an option unless it's something lik...

There are several Assets that can switch and blend between Lightmaps. I dont know wether they also blend Lightprobes or not.
But there are also tutorials who explain how to do a day/night circle and many forum posts like this:
https://forum.unity.com/threads/night-to-day-transition-with-baked-lightmaps.515564/
I think you can go with mixed lighting.

green ridge
#

Awesine thank you so much!

tired mirage
#

lighting is turning off in game randomly. if someone could that be great, @ me

deft fiber
#

There are many different types of lighting and many different ways they can "turn off"

tired mirage
wraith mica
#

Hi there! I was messing around with my lighting in Unity for one of my scenes. I wouldn't say that there are very many objects in the scene but I seemed to have caused some lighting issue. These background tasks have now popped up trying to "Bake" and Globally Illuminate the scene, these tasks seem to take forever and I was wondering if anyone could give me some advice on if I've dont something wrong or what this really means? I've done some research online but im still fairly confused

little condor
# wraith mica

Open the Window > Rendering > Lighting window and at the bottom of it, check to see if you have Autogenerate enabled:

#

Most people dock the Lighting window as a tab next to the Inspector btw.

wraith mica
little condor
#

If you have autogenerate off then Unity won't try to rebuild the lighting everytime you move an object or add a new light. So, yeah, I recommend you switch it off.

wraith mica
knotty hinge
#

Hi guys

#

my baked lighting changes when i enter play mode

#

here is how it is in scene view

#

here is how it is after i press play

chilly kettle
knotty hinge
#

i thought it was because i was using mixed lights

#

here its even worse with baked

#

look

#

how it looks in scene view

#

and what happens when i press play

chilly kettle
knotty hinge
#

what i posted above is with full baked lights

chilly kettle
#

Thats weird. Show me your Bake-Settings pls

#

And the Material of your Lights (i think this is emission?)

knotty hinge
#

yeah but emissions dont cast light (i turned it off)

#

one sec

#

i doubt it has anything to do with it

chilly kettle
#

Increasing the bounces could help, to get this effect of the lights at the walls.

#

i normaly work with 5-10 bounces

knotty hinge
#

dont think so man, its fine in editor view, i dont think increasing bounces would help with it completely disappearing, but thanks

#

I was using modular pieces, combining them seems to have fixed it

#

but i still dont know what was causing the problem 😫

chilly kettle
#

Weird

#

When you have different visuals between Editor and Game-Video, it may be some camera settings.. but its hard to tell

knotty hinge
#

yeah weird stuff,, thanks for helping 👍

vast lily
#

Please someone tell me how to fix this, I don't wanna rebuild the whole map or fix it one by one by hand.

#

Please help me! It's really urgent

timber lichen
#

bro you didnt even ask a question

timber lichen
#

thats not a question

vast lily
#

My question is: How do I fix this?

timber lichen
#

thats a general question not going into the actual problem

vast lily
#

Okay here is my question: Can you stop being a fucking nerd and help me fix my fucking lighting issue?

#

@timber lichen ?

timber lichen
#

bye.

vast lily
stark temple
vast lily
#

I asked a question which is: How do I fix this issue.

stark temple
#

You have posted some screenshots and presumably they didn't want to guess what your issue was

vast lily
#

And he is telling me that isn't a question

vast lily
stark temple
#

What is the issue you're pointing to in the screenshots

vast lily
#

I don't know if it's the lighting issue, A collider issue, And shader issue.

vast lily
#

As you can see in the screenshots

#

The lighting is not how it's supposed to be.

#

The is an angular shape, Which has a square lighting

stark temple
#

Have you looked at the docs for 2d shadow casters?

vast lily
#

Good question, I have.

#

And I did everything

#

There's only one way of fixing it, And it's by hand, one by one.

#

And then I came here for a better solution, Because I don't know how to find a better solution.

stark temple
#

You can presumably set the shape in code, which would be the only way to automate what you're looking for

vast lily
#

I don't know how to code, And I'm using visual scripting.

stark temple
vast lily
#

Okay, Thanks.

whole frost
#

heya, i was wondering if anybody knew the cause of this issue with this realtime light? i'm on URP, using deferred rendering, and also the light is marked as important

#

the issue is the weird darkness that appears on the elevator walls when activating another realtime light (the flashlight)

#

pretty much everyone i've talked to isn't really sure where the issue is coming from or what's causing it

#

figured someone here might know and be able to help

#

please ping if you have an idea of what it is, cause i may miss the message

chilly kettle
whole frost
#

nah, the only realtime lighting is just in the basic realtime lights, and everything else is baked which aren't causing any issues

#

the only global illumination is in the baked lights

#

i've found it is a specifically deferred rendering issue because the problem doesn't happen on forward rendering

chilly kettle
#

Why dont u use forward Rendering?

whole frost
#

mainly for the sake of avoiding the light number limit

deft fiber
whole frost
#

haha alright, i just wanted to ask if it was something that i was just doing wrong before i filed a bug report

#

i think for now i'll just use forward rendering and then figure this out later

deft fiber
#

Which URP / Unity version is it on?

whole frost
#

2021.3.1f1 unity

deft fiber
#

Updating to newest 2021.3. might be worth a try

vast lily
#

Is there a way to fix the shadow caster shape automatically?

#

It's gotta be something like this, But is there a way to do it automatically?

burnt jay
#

I asked this question a fewe times already so this is probably the last time i will but dose anyone know why there are these weird black lines when i bake the lighting for my scene this is the only place it appears and ive set all the sizes in lightmap so they dont overlap so i cant find whats causing this issue

chilly kettle
burnt jay
#

i made evething in my scene with probuilder

chilly kettle
#

Hm. Never used this ^^

burnt jay
#

also all light emitters are emissive material's

chilly kettle
#

Sorry i have no idea.. i would do some try an error and check if this object always bakes bad.
In a scene where nothing else is in it or with a directional light etc.

burnt jay
#

i did some test and for some reason seam stitching on that particular object was causing the black lines

#

i bake the lighting on the whole thing now to see if it works

wispy steppe
#

how to fix this in baking only? URP works fine without bake

#

(bad shadows)

chilly kettle
wispy steppe
#

but shadow messed up

#

@chilly kettle

#

No Bake

faint shell
#

boys, any idea why I can't generate lighting here ?

#

I already added a lighting settings

deft fiber
deft fiber
wise hawk
#

Posting a pic of the UV map for the model would help

burnt jay
wispy steppe
#

is this it? does this mean it's an Issue ? @deft fiber

wise hawk
#

You know

#

I'm not sure because I haven't used PB in a while, but did you turn on lightmap UV generation in probuilder?

#

Don't you have to do that manually?

burnt jay
#

yes i did

wise hawk
#

Is there a setting to increase padding?>

burnt jay
#

i think

wise hawk
#

Try that

#

It looks like the lightmapper is bleeding over the edges

burnt jay
#

heres what it looks like btw

wise hawk
#

Well that doesn't look like there's a shortage of padding

burnt jay
#

what should i set the padding to it currently at 8

wise hawk
#

I dont think that's the issue, there's already plenty of space between the triangles

#

Maybe too much even xD.

#

Does this happen with all spheres made in probuilder or just this one?

burnt jay
#

just this one and only when stich seams are on

wise hawk
#

I'm not sure, it looks like a lack of padding but you've shown clearly here that that's not the issue. Maybe the mesh being generated by probuilder is weird somehow? You could try exporting it to a model editor, manually welding the verts and re-importing it

#

to make sure it's a nice sphere with no seams in it

#

When I did use probuilder I had a lot of problems with the generated lightmap UVs

#

Like, weird layouts, overlaps, that kind of thing

#

One last gotcha

#

Check Texel Validty

#

that's probably not it, but if you see red areas around the seems then the problem is that there's a lightsource behind the object and light is sneaking through the backfaces.

burnt jay
#

how do i do that

wise hawk
#

You'll have to rebake the lights if you baked them a while ago because texel validity only stays in memory for a bit

#

Rebake your lights then go in the dropdown in scene view

#

Texel validity issues usually look like splotchy spots though, so I doubt that's your issue. But it takes 2 seconds to check

burnt jay
#

there are no red areas around the seams but when i turn stich seams off for that object it seems to fix itself but then there are seams you can see sooooo

burnt jay
burnt jay
deft fiber
main wolf
sinful matrix
#

im having a really odd issue where i cant bake lightmaps at all now. like it worked perfectly on all scenes now it just doesnt work and gets hung up on various GI cleanups and i have to force shut down the editor

#

ok it had the weirdest fix: changing none of the parameters did anything but changing lightmap size then changing it back worked for some reason

hollow marsh
#

I am trying to bake a lightmap for my scene but it gets messed up and a bunch of random spots of light appear in random places. Anyone know what I'm doing wrong?

#

these are my lightmapping settings

chilly kettle
hollow marsh
#

you can see it more clearly here

wise hawk
#

It's funny because that's what it looks like when you have too few samples but you have a ridiculous number of samples

#

I bake at 32/128, for reference

#

You can try turning on the denoiser

#

that might help

#

Under filtering

hollow marsh
#

Ight, will try that! I have a question though, can too high values in the settings make it worse or does it just make it so it takes more time?

deft fiber
hollow marsh
#

Cool, used your tips and now it looks great! Thanks @chilly kettle @wise hawk @deft fiber

wise hawk
#

so I would cut it down just for the sake of baking times

#

The only times you really want super high sample counts is when you have tons of indirect light, like for outdoor lighting with a shaded interior room with windows or something. Other than that really a tiny sample count works fine for me

junior nebula
#

How come objects can't go completely unviewable even when there isn't enough light? If I remove the light source, or even add an extremely low power one, I can still see everything

coral tide
#

Whenever I move the camera, my lights flicker.

#

It's the bloom, but i'm not sure how to fix it.

#

Any advice? 2021.3.3f1, global volume

junior nebula
hollow marsh
junior nebula
#

How come after baking lighting this happens?

#

The objects are just a base gray

magic vessel
#

So, I removed the sun because it's not supposed to be visible in the game I am making. It's pitch black but that's the only way I know how to remove the sun. However, there is supposed to be a little bit of light casted from the sky, about 4% or 5% of the normal amount that you would have it you just started your unity project. Does anybody know how I'll be able to do this?

fickle needle
#

to very small amounts

#

Maybe what you want though is this:
Disable directional light, add HDRI sky, that way you will get universal light from the sky itself, you can control how much with the HDRI post process parameters

magic vessel
#

Alright, I'll try that soon, thanks!

wispy steppe
#

for some reason when I switch to my level from the main menu its really dark, If I play the scene directly instead from main menu, It looks as it should(image on the left)..
Anyone know what's happening

#

the post process is still on because the bloom is working..but it's way too dark compared...

tall whale
#

hey i was curious, does anyone have a good yt video or know about one on proper good lighting, im struggling with it, im just making a low res ps1 horror game but the lighting sucks

fickle needle
wise hawk
wispy steppe
wispy steppe
wise hawk
#

Using postprocessing? Camera settings? Are those objects using lightprobes?

#

If it's that last one just call LightProbes.TetrahedralizeAsync when loading is done

wispy steppe
wise hawk
#

Is auto generate on?

#

And also, does this happen in a build? There's a big thread on this here:

wispy steppe
wispy steppe
wise hawk
#

I think it's your skybox

#

That isn't loading properly

#

It looks like the ambient is different between your screenshots

wispy steppe
#

this now what it looks baked wtf

wise hawk
#

Did you try it in a build?

wispy steppe
# wise hawk Did you try it in a build?

not yet....I might've narrowed to this message in console Reduced additional punctual light shadows resolution by 2 to make 17 shadow maps fit in the 4096x4096 shadow atlas. To avoid this, increase shadow atlas size, decrease big shadow

#

I had converted this from Built-In renderer but just realized this error

#

reduced lights to Low shadows, error gone.. scene still kinda dark... No idea what's happening just gonna give up.

wispy steppe
#

literally this is what supposed to look like now , I tried making it brighter with Light Environment. Still dark loading from main menu..... I made a Build and it seems to look fine .. so I guess it looks right in the build but not in scene mode, I've read through the forum post but still don't understand why that happens.. I tried copying the light settings over from main menu too@wise hawk

wispy steppe
#

NVM the build is Fdup again....

#

dark af and all shadows are fdup

little condor