#bring my light back, unity

1 messages · Page 1 of 1 (latest)

grand chasm
#

here

#

so how can i~

trail swift
#

gimme a sec i'll get with you

grand chasm
#

okay

trail swift
#

so first things first need to understand how your scene is setup

#

can you do me a favor and show me what your scene looks like in the baked lightmap view

trail swift
#

make sure show lightmap resolution is on

#

which is on the bottom

grand chasm
trail swift
#

and send me a screenshot of your overall scene

#

in baked lightmap view

trail swift
grand chasm
#

im a real beginner

grand chasm
trail swift
#

its alright

#

in unity within the scene tab, you have a dropdown menu that shows you different modes in which you can view your scene in

grand chasm
#

this right?

trail swift
#

yes

grand chasm
#

oh

trail swift
#

there is a dropdown menu that shows you all of those options

grand chasm
#

yea\

#

i see

trail swift
#

switch to this

#

and make sure

#

that this is also on in the menu

#

it wont look exactly like mine

grand chasm
#

okay, wheres my scene

trail swift
#

if you did

#

your scene should look something like this

grand chasm
trail swift
trail swift
#

well that tells me that you haven't marked any static geometry in your scene, leading to those really ugly results

trail swift
#

its alright i'll give you an overview

#

so just for a general overview, when it comes to lightmapping it goes like this for a scene

  1. mark static level objects as static (specifically marking the contribute GI flag). In here you are specifically marking objects that don't move or are interactable in the sense that they can be moved out of place or destroyed. Generally in most scenes your level geometry will always stay the same so that is typically the one that gets marked static

  2. changing your lights that you want to include in the bake to either mixed/baked mode (for demonstration and teaching I will have you switch the lights to fully baked)

  3. then finally its as simple as generate lighting, and then from there we will likely run into some issues that I will show you how to solve and make it look better

#

got it? @grand chasm

grand chasm
#

so i just need to make all my objects that doesnt move static?

trail swift
#

yes

grand chasm
#

all that doesnt ever move

trail swift
#

yes

#

this is important as I showed a previous person yesterday, if you mark everything as static via the contribute GI flag

#

you'll run into issues like this...

#

finding the screenshot give me a second...

#

here I have a lightmapped scene, but this stack of pallets are dynamic and moveable

#

when they get moved, you get issues like this

#

this is why you only mark objects that don't move or change as static

#

when it comes to marking an object as static

#

this is how

grand chasm
#

look

#

what about

trail swift
grand chasm
#

im changing something on the scene

trail swift
grand chasm
#

like moving furniture

trail swift
trail swift
grand chasm
#

i have a christmas tree there

#

what if i want to delete it

#

and place something else there

trail swift
#

ahhh, lightmapping stuff is not permanent

#

if you still need to change objects in your scene you still can

grand chasm
#

i did contribute GI tho

trail swift
#

I'm only saying that you should mark objects static that dont move within runtime, or within the actual gameplay

#

if you need to change or move objects while you are designing the level within the editor then you still can, you'll just have to rebake lighting when you are done

#

do you understand?

grand chasm
#

i switched my light to baked

trail swift
#

so your lights are switched

grand chasm
trail swift
#

have you also marked your objects with the contribute GI static flag?

trail swift
grand chasm
trail swift
#

well with that all set, show me how your scene looks in the baked lightmap preview

grand chasm
#

wait wait wait

trail swift
grand chasm
#

how do i bake properly

trail swift
#

I'll show you in a bit

#

this is all about showing you how to bake a scene properly

grand chasm
#

oh

trail swift
#

we are just setting up your scene first

grand chasm
#

i missunderstand

grand chasm
trail swift
#

yes

grand chasm
#

oh yea

trail swift
#

there we go

grand chasm
#

yeeee

trail swift
#

so the purpose of why im wanting to see that

#

is because

#

I want you to do a flyby of the scene

#

and make sure that everything looks good

#

how?

#

make sure that the checkerboard pattern you are seeing

#

is mostly consistent size wise

#

across your whole scene

#

this is important to ensure that everything looks good

#

each little square is a lightmap pixel

#

if they don't all look consistent then we'll have problems later that we need to solve

#

so some things we need to watch out for

#

if you have a case like this

#

where surrounding geometry has alot of lightmap pixels

#

but objects like this don't

#

then there will be problems in the bake, but we can fix it

#

the next thing also to watch out for

grand chasm
#

erverything is okay

trail swift
#

might be hard to see but you can see these rings are too small

#

they are as big as one of those squares

#

which means those objects are too small to be lightmapped

#

so you should not mark it as contribute GI static

grand chasm
#

nah i dont have anything small on my scene

trail swift
#

well good

#

then the next step

#

is simply baking

grand chasm
#

should i switch back or smth

trail swift
#

yes you can switch back to shaded

grand chasm
#

what do i do to bake normally

trail swift
#

go to your lighting panel

grand chasm
#

this right

#

yeah

#

here

trail swift
#

create new lighting settings for your scene

grand chasm
#

ye

#

don

trail swift
#

which should show you all the options of the lightmapper

grand chasm
#

ye

trail swift
grand chasm
#

my project is for vr

#

tho

trail swift
#

im aware

grand chasm
trail swift
#

nah not yet, just showing you all of the options are no longer greyed out

#

but since your project is for VR

#

and I assume you want maximum performance

#

we'll set the settings with that in mind

grand chasm
#

yea

trail swift
#

we can always change these later

grand chasm
#

i need 72 or 90 fps at least

#

oculus quest 2

trail swift
#

first thing is to set this lighting mode to subtractive

grand chasm
#

done

trail swift
#

now for your lightmapping settings

#

this is where the fun begins

grand chasm
#

😭

trail swift
grand chasm
trail swift
#

you do have access to the CPU version as well, the reason why that exists is that the GPU lightmapper can fail

#

the cpu version is slower but it is reliable

#

but for speed and saving time in our life

#

go for GPU

grand chasm
#

ye

#

done

trail swift
#

and for these settings for a first time bake I generally set them to the following

trail swift
grand chasm
#

done

trail swift
#

next is to set filtering

#

set it to advanced and set it to the following

grand chasm
#

oke

trail swift
#

if you have this option I suggest setting it to this

grand chasm
#

done

trail swift
grand chasm
trail swift
#

couple of last things

#

since your on quest

grand chasm
trail swift
grand chasm
trail swift
#

change the directional mode to non directional

trail swift
#

and then for good measure, I like to enable this

grand chasm
#

oh

#

donee

trail swift
#

make sure when its enabled also

#

to go back in here and set the filtering for the ambient occlusion

grand chasm
#

done

trail swift
#

now save your scene and click generate lighting

grand chasm
#

done

trail swift
#

shouldn't take too long, though im not sure what hardware you are currently using

grand chasm
#

god help me...

grand chasm
trail swift
#

yeah thats not bad

#

shouldn't take too long then

grand chasm
#

yupiieee

trail swift
#

whats the estimated time for your bake

grand chasm
trail swift
#

should show you on the bottom right of the unity window

trail swift
grand chasm
#

yupie

#

not final but im scared

trail swift
#

send me screenshots of the scene when its complete

#

its alright, those issues can be fixed

#

just let it run

grand chasm
#

god help me pleasee

trail swift
#

?

grand chasm
#

done but

trail swift
#

its a start

grand chasm
#

wdym😭

#

whats next

trail swift
#

fixing the issues that we have at hand now

#

its not the end of the world though

#

the result is closer, but we can get even closer to your original

#

but the good news is that your results are better than they previously were

trail swift
#

so first thing to check

grand chasm
#

what do i do now

trail swift
#

I know you had a light on the right for that equipment area and now its no longer in the bake

#

which can be due to a couple of things

#

but is there a light there?

#

or are you using emissives

grand chasm
#

kds

#

asdfasf4

#

oh sorry

trail swift
#

first thing is to click that emissive material

#

and show me a screenshot of the material settings

grand chasm
trail swift
#

thats your color settings, not your material

#

and that is not the emissive in your equipment area

grand chasm
grand chasm
trail swift
#

that is what I was referring too

grand chasm
#

and theres light above bulb

#

actually

#

map looks ultra good

#

emmisions need to be fixed only

trail swift
#

so looks to me why your light might not be showing

#

is that its actually inside an object

#

in a lightmap if your lights are inside objects they will not appear in the bake

grand chasm
#

ye

#

it was

trail swift
#

so if your light for that equipment area was inside the bulb it needs to be out of it

#

yep

#

for some reason lighting overall still looks odd

#

are there shadows enabled for your lights?

grand chasm
#

emmision

grand chasm
trail swift
#

enable them

grand chasm
#

omg my parents gonna rape me now

#

on all of lights?

trail swift
#

yes

#

we are baking lightmaps so it wont affect performance

#

but it'll certainly help make it look alot better

grand chasm
#

done

trail swift
#

bake it again

#

the scene lighting

grand chasm
#

baking

#

will it solve emmision?

trail swift
#

no because we haven't fixed it quite yet

trail swift
# grand chasm

but it looks like for some of your materials your emission mode is set to baked which is what I wanted to check

#

if the emission mode is not set to bake then it won't be shown in the lightmap

#

if it is set to baked, and the emission is still not lighting up anything then that is because the intensity of said emission is too low

grand chasm
#

yep

#

its set on baked

trail swift
#

so then the emission intensity is too low

grand chasm
#

wdym

trail swift
#

the color is not bright enough to light the enviorment around it

trail swift
# grand chasm

in here you adjust the intensity with the slider on the bottom of the color panel

grand chasm
#

so what do i do to fix

#

god help me

trail swift
#

well well, nice and moody

grand chasm
#

what do i do to fix emmision thingy

#

im confused

grand chasm
#

for how much

trail swift
#

it could also be that emission object is not marked static

trail swift
grand chasm
#

so just adjust intenstiy?

trail swift
#

yes

#

if the intensity at its current value is too low and not lighting up anything, then increase it to a higher value

#

you can always reduce it later

#

but also make sure that emissive object

#

is marked static

#

that could also be potentially another reason it may not be affecting the enviorment

grand chasm
#

done

#

baking

#

i gtg

#

can we contact tomorrow?

#

its 2 am for me

trail swift
#

sure, just @ me

grand chasm
#

my eyes hurts

grand chasm
#

this looks better than i did at least

trail swift
#

might also help to look at tutorials next time 😛

grand chasm
#

@mint quest here

#

before

mint quest
#

Okay what did you do between the two steps

grand chasm
#

so i baked the light

#

and i need realtime back

mint quest
#

okay please select your light and view the inspector

#

what kind of light is it?

grand chasm
grand chasm
#

i have Baked option selected everywhere on my lights

mint quest
#

Okay great, can you turn them all to Mixed? We can try to bring back the Realtime shadows while preserving the optimization from the baked lighting.

#

Can you bring up Window > Rendering > Light Explorer?

grand chasm
#

is this okay

#

i changed to mixed..

#

also all my static object is set to contribute GI

mint quest
#

Okay fantastic

mint quest
grand chasm
#

yea

#

done

mint quest
#

Choose GPU and choose Direct Samples: 32 / Indirect Samples: 32 / Environment Samples: 32 and Lightmap Resolution: 8

grand chasm
#

want to mention that my project is for vr

mint quest
#

Yep, we're gonna make it look great 🙂

#

For now we choose low lighting settings so we can get quick bakes, we will increase the quality later

mint quest
#

Okay click Generate Lighting so we see what happens

grand chasm
mint quest
#

What is that redness

grand chasm
#

i wish i knew

#

i can restart my project

#

i didnt save it

mint quest
#

No no let's keep working

grand chasm
#

oh okay

mint quest
#

I see a lot of emissive materials here

grand chasm
#

yea

mint quest
#

Which are the lights for your scene?

#

For this particular room

grand chasm
#

im beginner sorry

#

im stupido

mint quest
#

Do you have Light objects in your scene?

grand chasm
mint quest
#

Yes

grand chasm
#

46

mint quest
#

So for this particular room you showed me with the christmas tree

grand chasm
mint quest
#

can you show me the Scene View so I can see where the Lights are

#

Yes!

#

Are you only lighting it using the emissives?

grand chasm
#

theres only 1 for it, and its a point light

grand chasm
mint quest
#

Where is that one light? Is it the ceiling lamp I can see?

mint quest
#

Okay can you select the object with the Light component?

grand chasm
mint quest
#

Select the Point Light

#

and show me the Inspector for it

grand chasm
mint quest
#

Can you increase the Intensity to maybe 2 and do Generate Lighting again?

grand chasm
#

okay

mint quest
#

It is probably going to be too bright but I just want to see whether it works at all

grand chasm
#

holy..

mint quest
#

Spot Angle should also probably be something like 90 or less

grand chasm
#

here

#

with intesnity

#

but other areas is red

#

only some parts which is above seems to be ok

mint quest
#

I am not sure what all this redness is, it doesn't look like a Lighting issue maybe a shader/material issue? It looks like you added emission to materials that shouldn't have any or something

grand chasm
#

should i restart

mint quest
#

Okay can you select something that is red

grand chasm
mint quest
#

Yes

#

Let's take a look 🕵️

grand chasm
mint quest
#

Okay these are supposed to be red I suppose

#

Can you select something that is red that shouldn't be red

#

😄

grand chasm
#

wdym

#

🥹

mint quest
#

Like an object that appears to be red above

#

but you don't want it to be

grand chasm
#

maybe i should try to delete red materials

mint quest
#

Then you'll probably make everything magenta

#

I don't think it's going to help

grand chasm
#

i didnt understand about select something that is red that shouldn't be red

mint quest
#

any part of these red areas we should take a look at

grand chasm
#

this for example?

mint quest
#

No, the rest of your level which I can see in the screenshot above

grand chasm
#

like

#

i should choose red object

#

which is in red area

mint quest
#

Yes

grand chasm
#

okay

#

lemme find

#

i found a book which is just red, but i noticed this

mint quest
#

Okay that looks fine 🙂

#

Let's work on your level area-by-area then to troubleshoot it

#

Are you happy with how this christmas tree room looks?

#

More or less? 😄

grand chasm
#

this looks good

#

thats before this

mint quest
#

Okay I think it's just a matter of tweaking some of the settings.

#

Select your Point Light like before

grand chasm
#

yup

mint quest
#

Use 1 for the intensity and reduce the spot angle to 90

grand chasm
#

done

mint quest
#

click Generate Lighting

grand chasm
#

here

#

red thing is still present

mint quest
#

Yes we will deal with that later

#

Trying to not do everything at the same time

grand chasm
#

if im using baked i dont have this red thing

#

oke

mint quest
#

Instead of Mixed ? Okay that's interesting. Probably has to do with your emissive materials

grand chasm
#

i can try to disable emission

mint quest
#

You can use Baked for the Lights if it solves your issue

grand chasm
#

also realtime works

#

mixed makes this red

mint quest
#

Okay go for baked then

grand chasm
#

okay

mint quest
#

nice

#

if that's supposed to look that way

#

What is missing here the most is shadows

grand chasm
#

can i ask a question

mint quest
#

Yes

grand chasm
#

as i understand theres no way to bring this kind of a light? thats before i baked all for my first time

mint quest
#

There is- what you saw here was the realtime light. You can get the same look with baked lights

mint quest
#

do you need that object to be lit with realtime lighting? does it move?

grand chasm
#

no

mint quest
#

Okay, if you need to get all the realtime lighting back, you need to revert all the lights back Realtime, clear your baked data and also make your emissive materials realtime as well.

#

In my experience you would get much nicer lighting if you bake it and much better performance as well. If you don't know how to work with it, however, it can be overwhelming to troubleshoot...

grand chasm
#

also, how do i clear baked data

mint quest
#

click on that little arrow next to Generate Lighting

grand chasm
#

thanks

#

lemme move my lighting

#

so it will be in position how it should be

#

so it will look good when baked

mint quest
#

that makes a lot of sense

grand chasm
#

it looks.. weird

mint quest
#

let's just focus on placing the lights, you can't really get a perfect preview like this

grand chasm
#

so i wont be able to bring old light back at all🥹

mint quest
#

Spot angle 1 is very low

#

can you do 60?

grand chasm
#

its 12 now

#

23

#

okay

#

done

#

1 minute brb

#

im here

#

@mint quest sorry for ping, are you here?😅

mint quest
#

Yep

grand chasm
#

im done

#

i moved the light

mint quest
#

This light you were showing me?

grand chasm
#

its 23

mint quest
#

Does it look any better?

grand chasm
#

yeah mayb

mint quest
#

Can you click on the checkbox next to "Draw Halo" ?

grand chasm
#

ok

#

yea

mint quest
#

It should show you where the light's effective area is

grand chasm
#

no

#

it doesnt

#

just how it was

mint quest
#

Can you click on the gizmos button at the top right of your scene view? Is it toggled on?

#

Only send screenshots from the scene view (not game) so I can see the gizmos

grand chasm
mint quest
#

okay select the Light

#

and zoom out a bit

grand chasm
#

oooh

#

i edited it

mint quest
#

You can turn off the text mesh pro gizmos if you want

#

Click on the downward arrow next to the gizmos button and deselect anything that has text mesh pro

grand chasm
#

OOOHH

#

i CAN SEE HOW AND WHERE LIGHT WILL SPREAD

mint quest
#

yupp

grand chasm
#

okkkk

#

doneee

mint quest
#

ok so maybe we can focus on just this one light and then you can take the knowledge and apply it to everything else

#

you said that all the geometry is static?

grand chasm
#

yep

mint quest
#

ok cool, can you turn that light to baked and click generate lighting?

grand chasm
#

only this light?

mint quest
#

yea

grand chasm
#

okay

mint quest
#

everything else will probably turn black, don't worry

grand chasm
#

this kinda weird

mint quest
#

brb a sec

grand chasm
#

oke

mint quest
#

Hey I'm back

grand chasm
#

Oh sorry

#

Wait

#

2 min

grand chasm
grand chasm
mint quest
#

it's the "Halo" that I asked you to check before. If you uncheck the checkbox it will go away

grand chasm
#

oh yea

#

looks. good😍

#

oh my god, this looks so christmassy😍

mint quest
#

you can increase the sample counts and lightmap resolution in the lighting window to get a nicer image once you're happy with the overall look 🙂

#

(remember we set them to 32 and 8 before for quicker bakes)

#

don't go too high though, as that will lead to very long bake times

#

maybe 64 for direct, 2048 for indirect, 256 for envirnonment

#

then 32 or 48 for the resolution

grand chasm
grand chasm
#

thanks

mint quest
#

Happy to help, hope all goes well!

grand chasm
#

oh my god...

mint quest
#

increase intensity and indirect intensity

grand chasm
mint quest
#

oh then don't touch it!

grand chasm
#

im making horor

#

yapeee

mint quest
#

amazing

#

it looks great!

grand chasm
grand chasm
#

@mint quest sorry for ping.. Ive tried my game now. Performance looks awesome! But..

Since light is baked my player is black. just black
also i cant identify what and how covering my left eye. its just white..

I cant fix this today, i gtg sleep. I hope you can help me tomorrow

mint quest
#

Hey, you need LightProbes for this 🙂

trail swift
#

Thanks for filling in @mint quest , our time zones are very different lol

#

Though suprised you suggested changing light mode to mixed

#

He mentioned his target platform was quest 2, and i know with mixed lighting there is still a realtime lighting component with it

mint quest
#

I was still trying to figure out what exactly they wanted

#

Yeah baked is definitely a better option for performance reasons

#

But they did say "I want the realtime back" so I wasn't sure what to suggest 😄

trail swift
#

Well i see hes almost there now so 😛

mint quest
#

Yup!

grand chasm
grand chasm
trail swift
#

So remeber when I mentioned to only mark static geometry and not dynamic geometry?

trail swift
#

Light probes are a way to bring the lighting back to those dynamic objects and make them properly blend with the baked lighting of the scene

#

It works by basically having an array of points all throughout your scene, and when lightmapping these points are used to sample lighting at specific points in your scene so that they look correct

#

For placement there are alot of tools on the asset store you can use to automate the placement of these light probes since it can be tedious to setup

mint quest
#

Specifically LightProbes are for indirect lighting (aka light that has already bounced at least once)

#

Which is why I had mentioned Mixed lights which have a realtime direct component

#

So now it's a bit more complicated than with just baking a static scene... You can feel free to place Light Probes all over your scene (GameObject > Light > Light Probe Group I believe)

#

Click Generate Lighting and make sure your player mesh renderer (and any attached objects) receive lighting from Light Probes

grand chasm
#

okay thanks

grand chasm
#

@mint quest ive tried but its still black..

#

sorry for ping tho~

#

is that because of Mixed setting?

#

like do i need to set mixed for this

trail swift
#

generally you should be placing probes where there are changes in lighting

#

but also for your probes, do not place them inside geometry because otherwise they will be black

#

notice how the probes are placed here

#

mostly in lighting transitions

#

but honestly that can be hard to get right, so the other thing you can do is simply place probes in a consistent array through the entire enviorment

#

like here

#

or here

grand chasm
#

okay

#

@mint quest sorry for ping but.. do I need to switch to Mixed setting for lights?

mint quest
#

Hey, if you need the realtime direct lighting yes, if you're ok with just the indirect from the probes then no

grand chasm
mint quest
#

I would try to post in a relevant channel about that, it's been some time since I've worked with VR. To my knowledge, if you have the right setup with the XR package it should work

#

(you can also connect your headset and build directly to it to test)

grand chasm
#

okay, thanks

grand chasm
#

@trail swift seems like things like "flashlights" doesnt work with baked light or probes causes it.. Do you know something about it?

#

also sorry for pinging you if youre busy..

trail swift
grand chasm
mint quest
#

Yes

grand chasm
#

okay, thanks a lot!

mint quest
#

(Direct light only, but it's all you need I think)

trail swift
#

you might have to rebake if the flashlight was baked prior