#archived-lighting

1 messages Β· Page 72 of 1

deft fiber
#

I don't know if there's a "fix" for it, but you could post your bloom settings just in case there's something to improve there
This seems to happen always if you have highly emissive regions smaller than displayed pixels, so they flicker between rendered and not rendererd
The best workaround is to avoid that entirely
Instead of a tiny candle flame with a really high emission intensity, use something else like a billboard particle of the light glow

#

As it's larger it's always visible for bloom
Particle systems can be used to render single particles, and there's options for minimum and maximum size which are particularly useful for faking glow like this

#

Each scene you want to switch to at runtime needs to have its lighting generated manually from lighting window (baked lightmapping does not have to be enabled)
This process saves the skybox so it can be used for ambient lighting
Editor does this automatically temporarily when you open a scene in the editor

#

This looks like it's probably texel invalidity caused by exposed backfaces
Always check scene window debug views for texel invalidity and UV overlap errors after a bake if it comes out looking weird

#

The Lighting window has settings for environmental lighting where you can control ambient light

chilly kettle
#

@deft fiber - Have you used Bakery for Lightmap Baking?

wise hawk
#

Could you shoot a test scene with the issue? I kinda wanna run some tests on it

#

or test project, since it's probably related to the loading code

wispy steppe
deft fiber
wispy steppe
#

Tried different settings.. quality settings.. nothing. 😦 I just need it to look like this when I start from menu

#

but instead.. @deft fiber

chilly kettle
#

Reflection Probes are baked?

wispy steppe
deft fiber
#

"Generate lighting" is the solution, if that doesn't work the next step is to investigate why
I've seen this same issue a hundred times by now

#

Not using any asset store solutions for lighting?

wispy steppe
wispy steppe
#

I actually reset Lightmap resolution to default, it used to be 12

deft fiber
#

this is the important part

chilly kettle
wispy steppe
#

let me rebake

deft fiber
#

I would recommend uncheck "Baked Global Illumination" for now

#

since you don't seem to need it

wispy steppe
deft fiber
#

the issue is not related to them

#

Each scene you want to switch to at runtime needs to have its lighting generated manually from lighting window (baked lightmapping does not have to be enabled)
This process saves the skybox so it can be used for ambient lighting
Editor does this automatically temporarily when you open a scene in the editor

deft fiber
#

Awesome! Let's hope it keeps working ^^

wispy steppe
wispy steppe
fickle needle
#

looks like UV issue

wispy steppe
#

Scene view(cleared bake)

#

scene view with baked

deft fiber
#

Did you intend to use baked lightmapping or was it meant as a solution to this previous problem?

wispy steppe
#

wait... I think I fixed it...

#

I think the issue was hitting Generate while the Medium preset was selected In Quality Settings

#

I generated again with Ultra

#

nvm

#

playmode looks like crap

deft fiber
#

@wispy steppe did you intend to use baked or not?

chilly kettle
#

how does the pure Lightmap look like there?

deft fiber
#

Graphics quality settings have nothing to do with light generation

wispy steppe
deft fiber
wispy steppe
#

It helped with the darkness issue what you said but it created weird artifact as shown

#

but only in playmode :\

#

switching scene

deft fiber
#

I don't know how to phrase it any clearer
Darkness issue on scene switch is fixed by generating lighting, even when Baked Global Illumination is not used

#

If you generate with Baked Global Illumination, you should only do so when you want Baked Global Illumination and know what it is

#

Baked lightmapping has a specific purpose and many potential issues
It's very important to read about them before diving in

fickle needle
#

switch from lit to UV overlap, and check UV charts , see if there's an issue with that object

wispy steppe
#

I only hit generate like @deft fiber said with GI checked off

deft fiber
#

And you're sure the previously baked lightmap was cleared?

tall whale
#

hey i made this scirpt to switch scenes on trigger but now all my lighting is screwed up in my scenes, i messed with auto generate lighting and the color and everything but its all still messed up, how do i fix this?

wispy steppe
deft fiber
wispy steppe
fickle needle
#

it could be a normal map issue

#

for that object

#

what render pipeline?

deft fiber
#

I'm pretty sure the normal maps on the walls are wonky, but that's a separate issue

wispy steppe
tall whale
#

the lighting is all black and just not how it was

wispy steppe
deft fiber
# tall whale the lighting is all black and just not how it was

Each scene you want to switch to at runtime needs to have its lighting generated manually from lighting window (baked lightmapping does not have to be enabled)
This process saves the skybox so it can be used for ambient lighting
Editor does this automatically temporarily when you open a scene in the editor

wispy steppe
deft fiber
#

(I could be replaced with a bot)

wispy steppe
#

the probes were the issue

#

thank you @deft fiber you're a genius

chilly kettle
#

lol.. nava.. you remember that i told you that 2 hours ago?

#

πŸ˜„

chilly kettle
#

30 min ago.. sry πŸ˜„

#

but good that it works now ^^

wispy steppe
#

Sorry for I missed the message on it, I've been pulling my hair over this issue , My code was working perfectly then it came to the lighting I almost scrapped this completely.. my first time using URP

deft fiber
#

Everything we've done so far works the same on built-in RP

tall whale
#

wait so how do i fix this black lighting?

chilly kettle
#

@deft fiber - you should write some macrosπŸ˜„

wispy steppe
deft fiber
wispy steppe
wispy steppe
# deft fiber They are!

Oh ok ! so I def used them wrong then, the textures did look nicer with them but oh well they need strategically being placed which I can't do after this whole ordeal I'm done with level design for a little haha

deft fiber
#

The only difference is that Source uses cubemap reflections only on shiny objects, whereas Unity allows any object with above 0 roughness to gain some reflections from them

chilly kettle
deft fiber
#

Similarly in Source if you bring an object into a cubemap's range which is noticeably brighter, it suddenly gains a sheen from that cubemap

wispy steppe
#

I also made this material so maybe wrong settings

wispy steppe
deft fiber
deft fiber
#

That looks fine enough

deft fiber
# tall whale

You have so much post processing effects that it's hard to tell what the "blackness" is
Still, if the lighting becomes black on scene change it should be the exact issue I gave instructions for

tall whale
#

no i have hardly any pp

#

ill mess with it

fringe otter
#

did some reading up on this, think i understand it better

#

however, i think we missed something simple: because of how I generate the sphere, the seams on the edges are inevitable because I'm just mashing 6 different meshes together

#

the vertices on the face of each mesh get smoothed correctly by the recalculate normals() but the ones on the edge can't just because they don't know about the other meshes

#

so i think that at least with the approach im going with, i need to have a second pass over all the vertices to try to smooth it later

deft fiber
fringe otter
#

i think ideally i would just work with all of the vertices without there being duplicates, but i think the ordering for the mesh generation gets tricky which is why i split it up into different faces

#

merging after the fact would require i find all of the vertices that are supposed to be the same (annoying because of floating point precision 😒 ) which is similar to the approach I'm taking rn of finding these points and calculating the average normal at that vertex

deft fiber
#

I don't know the specifics but it's probably a very common problem to tackle, so I assume there's existing solutions to it

fringe otter
#

yeahhhhh ive been trying to find posts but either im not searching up the correct keywords or I'm missing something obvious lol

little condor
#

I'm not sure what you might have done, but if you've baked a lightmap, you can clear the lightmaps using this option:

proud ice
#

i have a weird issue with a game Im making. When I LoadScene(), the scene that loads is super dark. But when I play the scene without loading it, its fine..

I turned off auto generate lighting and cleared the baked light data, but the issue persists.

When I try to manually generate the light data at the bottom is says 1 X 1024 X1024 non directional light maps and the 1 goes to 2 then 3 etc slowly. .. are there supposed to be this many non directional light maps?

#

disregard. figured it out

wise hawk
#

Anyways merging overlaping verts is a trivial problem. You just do distance( a, b ) < Mathf.Epsilon

#

If you don't want to work iteratively you can use spatial partitioning to setup a nearest query system

#

But probably you don't even need to do that

#

You should verify that your verts are not indeed perfectly overlapping first

#

before coming up with a fancy shmancy algorithm to evaluate positions

#

My own vert merging function really just uses a dict with Vector3s in it and it works

fringe otter
#

i currently do two passes in my main code after getting all my terrain faces populated: I go through all the points and add them to a hashmap where i convert each vertex to only have 4 decimal places (rounded vertex as key, list of normals as value), then I do a second pass through all of my vertices which then goes into the map and averages the list of normals and set the corresponding normal in the mesh to be the average

deft fiber
#

@proud ice Generating lighting fixes the blackness issue, but you don't need to generate with Baked Global Illumination enabled if you don't want it

tribal leaf
chilly kettle
worn tapir
#

Hello, so I have a problem where the lighting seems to be binary and shadows are not working at all

#

I have seen this in URP but now im using built in RP

olive python
worn tapir
#

yes

chilly kettle
#

i think he means that the faces get lit piece by piece

#

not smooth

olive python
#

I see no shadows, the rest I think its just the range cone needs to be bigger

worn tapir
#

oh

#

the problem is graphycs settings

#

pixel light count was 0

chilly kettle
#

what did you change?

worn tapir
#

its in the quality settings

#

so from what i understand is that if the number is too low lights that dont fit in become vertex lit

#

and my scene is like a few triangles for the walls so it looks weird

chilly kettle
#

Does anyone have an idea how to handle this? I have a standard Terrain, with some baked lights here and there and i generate a maze at runtime.
My problem now is, that some tiles get lit blue by my the lightprobes there.

worn tapir
#

oh simple

worn tapir
chilly kettle
#

Yes i know this. But then its only lit by the Ambient Color.
I also wanted to use the anchor override, but due to the fact, that i generate this maze at runtime, i cant give the prefab a anchor for this.
The only way i see right now, is to add a script which adds the anchor after generating the maze.

chilly kettle
#

You can add an empty gameobject from the scene here, from which the Mesh takes the lighting information.
Thats a good way to avoid Meshes to get lit defferently, when they have to look the same but choose different probes on their own.

deft fiber
chilly kettle
#

Sure, i could say the generator, that he is not allowed to place a wall there, but i hope to find another way πŸ˜„

deft fiber
#

If that's an option

#

Having them clip inside each other and still try to make it look good is possible I guess but sounds like a harder problem than it needs to be

chilly kettle
#

we may want to go for mobile after PC release.. so i want to avoid realtime lights if possible.
But you are right, the **best ** way is to place this part only at places where it can "shine" ;D

#

But for sure not the fastest πŸ˜„

deft fiber
#

Which render pipeline is this on?

chilly kettle
#

Do you have any experience how many Realtime lights are okay for mobile? i think the less the better? ^^

#

Right now everything is baked

deft fiber
#

I've never made anything for mobile, but with any hardware it's up to testing and profiling

#

Personally I'd probably deem it too problematic to have props potentially blocking the walls, but the other options are
-change the anchor points upon generation and hope that's enough
-have multiple versions of the maze floor with decorations and baked lights, and load them in (as additive scenes for example) based on which parts of the maze are being blocked

chilly kettle
#

Yeah, that was the same what i was thinking abour

upper fable
#

Very rarely mobile games uses realtime lighting at all. Simple directional light for example shouldnt be a problem tho

#

I feel it odd theres no default mobile shaders for urp. Simple Lit is option but I think thats quite heavy for older devices

chilly kettle
#

could be a solution for the walls

deft fiber
deft fiber
upper fable
chilly kettle
#

Well guys, you gave me some good ideas for this πŸ˜„ This will be a bit of coding work, but i think the benefit will come later when i can create levels automatically by a mouse click πŸ˜„

#

Or another, much easier way would be, to delete the light there πŸ˜„ haha

deft fiber
#

though I admit I don't know precisely if it's possible to give them prebaked light probes as well, to light characters passing by

chilly kettle
#

Yeah, that would be the masterpiece.

deft fiber
chilly kettle
#

But in the end, I could work with modular walls with real-time lights for the PC version and just disable them for the Mobile version.

#

When I see how some games look.. i give way to much effort in this small details πŸ˜‚πŸ˜‚

chilly kettle
deft fiber
#

I really hate how obtusely stored light probe data is
Even worse than reflection probe data

chilly kettle
#

Yeah, that’s true. Would be awesome if they open the usage a little more πŸ˜…

wary crypt
#

hi, I got a problem with the light in my friends unity scene
so basically when I bake the lighting, everything turns black despite having the lighting in there

could it be that the scale messes things up? the objects are very big, however before baking everything is lit normally

little condor
wary crypt
fleet tiger
#

does anybody know if it's possible in the URP to force a spot light to render its shadowmap, and then have access to said shadowmap from code? the best I found in regards to how shadowmap rendering works is AdditionalLightsShadowCasterPass and that's 1000+ lines of code that's written specifically to run within the context of the render pipeline

chilly kettle
#

Artifacts like this can only be handled by increasing the texels per Unit, right?

deft fiber
chilly kettle
deft fiber
chilly kettle
deft fiber
fleet tiger
#

is it possible to get the path to a scene's lighting folder from code? meaning, the folder that's automatically generated for each scene where their lighting data goes

olive iris
fleet tiger
#

I meant, I wanted to get that path from code, to add some new files in here directly from c# rather than manually

#

I ended up fiddling with SceneManager.GetCurrentScene().path to get it

amber anvil
#

Can I bake lightmap with 2 objects that are overlaping? For example, I need to bake lightmap in multiple floors but if they are both active then they will affect each other

deft fiber
amber anvil
#

@deft fiber Thanks for the answer! Do you maybe know how I can bake it in prefab? Do I need then to bake it in different scene every time?

deft fiber
#

In both cases I believe the floors will need to be in their own scenes

amber anvil
#

@deft fiber Okay, I will give it a try. Thanks!

wise hawk
#

So

#

I just got a AMD gpu

#

Whenever lightmap bake is nearly completed, I get an error about d3d11 device removed and the editor crashes

#

If I switch the denoiser to OpenImageDenoise it's fine, but whenever I set it to Radeon Pro it crashes consistently

#

Wait, I think that's wrong. I think it just works the first time after rebooting nope it's definitely the denoiser

amber anvil
#

@wise hawk I am baking lightmap right now and Unity struggles to find my rtx 3060, he just switches to CPU baking

wise hawk
#

Are you getting OpenCL memory errors?

#

Previously on a 2060 I couldn't bake lightmaps with a texture size over 2048

#

it would fall back to CPU pretty quickly

amber anvil
#

I don't get any errors, he just do a switch

wise hawk
#

Sometimes it doesn't actually print to the console

#

Try reducing max texture size

amber anvil
#

Okay, thanks. It is ineed 2048

wise hawk
#

Yeah. Apparently OpenCL on nvidia cards has a memory limit irrespective of how much video memory you have

#

I got this AMD card with 16gb of video memory just to resolve this, and it works even worse

#

Β―_(ツ)_/Β―

amber anvil
#

hahaha, that is unlucky 😦

wise hawk
#

It works with openimagedenoise at least

mossy gazelle
#

Guys, I joined someone's project so I do not know of the existing stuff they have on Lighting.

#

But I just quickly went to the Lighting > Environment tab, and changed some stuff there, but there is no impact to the game view?

Does anyone know why?

deft fiber
mossy gazelle
#

How do I undo, or rather change, that?

chilly kettle
#

you check via script if you collide with the cube.
If you do, set the intesity of your light source to 100/75/50/25/0%

fleet tiger
#

does anybody know if it's possible to make a camera only render lightmap static objects without changing the layer on these objects?

tiny condor
#

hey, I'm having trouble with my ocean showing up as fully lit and idk where the source of the light is coming from

#

changing metallicity and smoothness of the ocean material doesn't do anything, neither does changing environmental brightness afaik

little condor
tiny condor
#

but the problem is when I load it into vrchat, the ocean is just black

#

and it doesn't seem to bake

#

or at least if it does it takes a long time to

#

it gets stuck doing clustering 5/11

little condor
#

Baking from the environment settings only gives you static shadows and lights.

If you want to reflect the sky then a reflection plane or sphere would be best.

narrow ridge
#

Is there a way to make an object not be lit by the environmental lighting?

#

like a certain layer

tiny condor
chilly kettle
kind vault
#

Been messing around with light mapping and keep having trouble with corner shadows. Any idea how to make the shadows actually connect with the corner?

chilly kettle
slim sinew
#

Hi guys!
Has anyone of you experienced problems with light probes right after pulling from version control?
I have this problem when i pull from remote, some baked probes go black, and it happens only in one scene.
It is completely fine on the machine that i bake it on, but somehow comes like this on my Laptop.

narrow ridge
outer monolith
#

Hey everyone, wondering if someone can help me figure out why my baked lighting looks "greyish"? First pic is the lighting without bake and the second is after. I have one directional light set to Mixed in the scene and it's assigned in the environment tab as the sun source

fallow mantle
#

i have a problem where my model looks like this. there is no lighting except when i am really close to the surface, then i can see a little bit of lighting

#

using version 2020.18f1 and 3D URP

neon wren
#

does any1 know what happening here?
i just want the ground to stay dark and have lights shining on parts of it but the whole thing lights up
im a bit confused i cant lie

abstract siren
#

ive noticed something in Realtime raytracing when its used in games
when you turn the camera you have to wait for the light to slowly reflect off of things before it looks correct

i completely understand thats because the calculations aren't exactly fast, so you cant wait until its done before you draw the frame
i am wondering, if future raytracing technology could make "the speed of digital light" fast enough to be less noticable

#

i know most people don't care about that because the lighting is otherwise 100% realistic, but for some reason i couldnt un-see it

slim sinew
#

Or turn it off

#

In the lighting settings

slim sinew
fallow mantle
#

i turned fog off and now its normal ty

chilly kettle