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
#archived-lighting
1 messages Β· Page 72 of 1
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
@deft fiber - Have you used Bakery for Lightmap Baking?
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
I tried with bake and without bake...always getting bad results.. what can I tried using new lighting settings as well
you mean like a build?
Are you doing it for every scene that needs to be loaded into?
I only have 2 scenes. 1 menu and the gameplay
Tried different settings.. quality settings.. nothing. π¦ I just need it to look like this when I start from menu
but instead.. @deft fiber
Reflection Probes are baked?
pretty sure
"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?
no, only using probuilder I made the level myself and the UVs are done in probuilder
Is this ok? bcause when I used this it looked horrible
I actually reset Lightmap resolution to default, it used to be 12
this is the important part
lol
I would recommend uncheck "Baked Global Illumination" for now
since you don't seem to need it
When I do the settings disappear
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
I think...That worked...
Awesome! Let's hope it keeps working ^^
Finally It's bright still switching! Now I can turn down the PP finally. Thanks! a lot @deft fiber Really saved the project from abandonment
the only issue somehow not sure what thats about , but at least now it's not a super dark scene
looks like UV issue
Did you intend to use baked lightmapping or was it meant as a solution to this previous problem?
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
@wispy steppe did you intend to use baked or not?
how does the pure Lightmap look like there?
Graphics quality settings have nothing to do with light generation
I'm not sure, I'm mainly coding but first time messing with lighting at all.. I wanted the realtime shadows to work
So don't use baked lightmapping
Disable the checkbox, clear bake and generate again
I did tho if you mean this
It helped with the darkness issue what you said but it created weird artifact as shown
but only in playmode :\
switching scene
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
switch from lit to UV overlap, and check UV charts , see if there's an issue with that object
It's not baked GI tho
I only hit generate like @deft fiber said with GI checked off
And you're sure the previously baked lightmap was cleared?
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?
yeah because thats when I switched settings to Ultra and thought re-baking fixed that artifact
Do you have reflection probes in the scene? Those can cause abrupt lighting changes between objects
"Messed up" how?
just found 2 , should i remove them?
Do you intend them to be there? π€
I'm pretty sure the normal maps on the walls are wonky, but that's a separate issue
I honestly not entirely sure how to use them , i only used cubemap probes in Source engine. I'm sure here they offer different purpose
the lighting is all black and just not how it was
URP
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
(I could be replaced with a bot)
you did ?
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
Everything we've done so far works the same on built-in RP
@deft fiber - you should write some macrosπ
I only used built in for the insane amount of lights but never made a level in probuilder with it hehe I'm used to source engine with mapping wise
I'm working hard on an FAQ site (hardly working)
thought reflection probes would be similar to this https://developer.valvesoftware.com/wiki/Cubemaps
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
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
You can use one BIG Reflectionprobe for the whole scene if you dont care about reflections
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
I also made this material so maybe wrong settings
yeah the adjustable zone was just new to me
Make sure your normal map texture is of "type: normal map" in import settings
this one right ?
That looks fine enough
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
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
I'm not experienced with procedural geometry, but perhaps you could merge vertices in identical positions
That's what modeling programs tend to do when smoothing split normals, I believe
not too sure what you mean by merging vertices, could you elaborate?
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
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
yeahhhhh ive been trying to find posts but either im not searching up the correct keywords or I'm missing something obvious lol
I'm not sure what you might have done, but if you've baked a lightmap, you can clear the lightmaps using this option:
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
Are you saying that you're generating overlapping verts in your procedural mesh function?
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
Yeah i think due to how i get my points, they're not perfectly overlapping, hence why i resort to some terrible method of making a new vector3 and truncating the floats to 4 decimal places to build my hashmap.
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
@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
hey uh i need help my lighting changes when i enter through the menu
We had this Topic yesterday and @deft fiber said something about this:
#archived-lighting message
i got it!
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
you enabled the shadows in the light ?
yes
I see no shadows, the rest I think its just the range cone needs to be bigger
what did you change?
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
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.
oh simple
you can disable light probes on the mesh
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.
anchor?
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.
Why are the glowy props being covered by the maze walls? It doesn't look like it's supposed to happen
The maze is generated randomly. Sometimes there is a wall, sometimes not. But the edge of the lower part is always the same right now.
Sure, i could say the generator, that he is not allowed to place a wall there, but i hope to find another way π
I would consider the opposite; only place the decorative pillars there if the space is vacant (and make the blue light realtime only)
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
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 π
Which render pipeline is this on?
URP
Do you have any experience how many Realtime lights are okay for mobile? i think the less the better? ^^
Right now everything is baked
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
Yeah, that was the same what i was thinking abour
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
Found an interesting article on light baked prefabs
https://unity.com/how-to/advanced/optimize-lighting-mobile-games
could be a solution for the walls
That's for lightmaps, not ambient probes
But may be useful still
What parts of the mobile shader would be cheaper? I was under the impression that shader stripping went a long way in making them lighter
I think the lighting model unity uses would be made a lot more simplified to increase performance (+ maybe vertex lighting)
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
One technique that's usually used in these situations is to have the floor and level edges as swappable prefabs as well
So when generating you can place the decorative floor/edge pieces where they fit, complete with their own lightmaps
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
Yeah, that would be the masterpiece.
https://youtu.be/KbxiGH6igBk this is even a bit overkill but the techniques are interesting
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 ππ
Thanks, i will have a look on this.
I really hate how obtusely stored light probe data is
Even worse than reflection probe data
Yeah, thatβs true. Would be awesome if they open the usage a little more π
That's a clever way to do it!
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
Are the objects static and are your lights set to Mixed instead of just Realtime?
hi, thank you, it works now! thank you very much!!
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
Artifacts like this can only be handled by increasing the texels per Unit, right?
That can help, but the main cause is lightmap texture compression
Do you know how much bigger they become without compression?
A lot, usually
The inspector will tell you the size in memory for the applied compression level when inspecting a texture asset
That means, when i want to get rid of this artifacts, i have to deal with it or increase the size a lot? ^^
I think so
If you have a lot of texture variance the compression artifacts won't be so noticeable, but in a situation like this I don't know how else to deal with it
Ok, thank you π
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
should be able to just select it from the lighting tab and where the lightmaps goes.
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
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
Not possible as far as I understand
You'd have to bake them as separate scenes and load them additively, or bake lighting into prefabs
@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?
https://github.com/Ayfel/PrefabLightmapping you'll need something like this for the prefab route
I haven't used it myself but I heard it works ok
In both cases I believe the floors will need to be in their own scenes
@deft fiber Okay, I will give it a try. Thanks!
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
@wise hawk I am baking lightmap right now and Unity struggles to find my rtx 3060, he just switches to CPU baking
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
I don't get any errors, he just do a switch
Okay, thanks. It is ineed 2048
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
Β―_(γ)_/Β―
hahaha, that is unlucky π¦
It works with openimagedenoise at least
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?
The lighting could be baked, I suppose
How do I undo, or rather change, that?
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%
does anybody know if it's possible to make a camera only render lightmap static objects without changing the layer on these objects?
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
You have a gradient environmental light and I assume you have a directional light (sun) so that'll be where your light is coming from.
What are you trying to achieve?
trying to get a reflection on the ocean itself
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
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.
Is there a way to make an object not be lit by the environmental lighting?
like a certain layer
how would I set that up so that an object acts like one?
Change the Materials Shader to something unlit
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?
Looks quite realistic.
The only thing you could do is increasing the resoultion
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.
ye but I still want it to be lit by my directional light so ig I'll just write a shader
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
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
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
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
Have you tried to reduce the fog?
Or turn it off
In the lighting settings
Tried fiddling with shadow bias?
yes thank you
i turned fog off and now its normal ty
i think you have a redish environment light which will disappear on thie static objects when you bake light.