#archived-lighting
1 messages Β· Page 25 of 1
THANK YOU all good now
might be a long shot but does anyone know why this is happening with my emission material after i baked my lighting its supposed to be just solid blue color
Do you mean combine all vertices that are close enough to each other?
Most likely weird lightmap UVs, the lightmap debug view may give clues about that
Still, I'd just disable a mesh like that from being lightmapped (while still contributing GI), as it's emissive and has an unwieldy shape too
no but it needs to be lightmapped becuz the emission.
It needs to contibute to GI, it doesn't need to be lightmapped
have you got a form to do that? cuz im no quite sure on how to edit the lightmap to not include certain objects but contribute GI? idk
Anything that's "contribute GI static" will emit and bounce light during baking
But additionally there's a separate option whether it receives baked lightmapping from lightmaps or probes
You should have objects receive GI from probes if they don't explicitly need lightmap texturing
(And you should also have light probes if you're baking lighting)
The term is "welding vertices" and though I haven't had to do it I assume it doesn't happen automatically
https://discussions.unity.com/t/welding-vertices-at-runtime/191731
https://forum.unity.com/threads/welding-vertices-at-runtime.1107617/
Vertices that are forcibly merged must share vertex data, such as normals, so maybe that also averages them with no extra effort
i think it worked?
does anyone know how to fix this issue
What issue?
I suppose you're using vertex lighting rather than pixel lighting, which is a graphics settings
That's because vertex lighting is a fallback setting for unimportant lights, by priority
Hello, how can i increase the quality of my baked lightmap? (I am doing for mobile)
Also size of lightmap is very big too
Purely baked lighting is extremely inefficient at capturing sharp shadows
Each doubling of the lightmap (which increases size by 4x) merely halves the visible pixelation
So should i increase the size of it? Is this only solution?
Probably not worth the cost
It could be mitigated if light diameter could be increased, but I think Bakery might be required for that
A kind of hacky solution would be to slice the ground mesh into parts depending on what kind of shadows fall upon it, and set the Lightmap Scale of each part separately
Extremely low for sections without shadows, and high for each one with
Light diameter makes shadows blurrier at no extra cost, which kind of makes them less accurate but also the pixels way less visible
Thank you so much, i will try it now.
Which one?
Slicing ground mesh and setting lightmap scales
Let me know how it goes
The thing to watch out is to avoid making too maky slices/tiles, as every part will need padding pixels on the lightmap
@deft fiber also i am generating lightmap uv for entire map like this. Should i generate lightmap uv for each object?
Which one is will be better choice?
The slices need to be separate mesh renderers (meaning objects) if you want to set the lightmap scale for each within unity, or they can be the same mesh with your custom lightmap UV map using UV seams
https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html
"How to provide your own lightmap UVs"
when baking lighting i get this warning : "Terrain excluded from bake because terrain hole texture is dirty"
how do i fix this?
also is there a way to preview lightmap on terrains? cuz i cant see them in the light map debug view
I have a small test project on Unity 2022.3.16 HDRP. I am using the light prefabs from the template project for prototyping and I cannot get the light sources to work. For whatever reason, the emission intensity must be set extremely high (1e+07 levels of high) in order for the lights to be visible.
I went ahead and also copied the graphics and lighting settings from the template project to see if it fixes it, with no luck unfortunately.
The answers I found while searching for this was to...well...set the intensity to extremely high values, which is what I did but I believe there must be a better, actual, solution to this.
When working with HDRP you need the Exposure volume override set up with automatic or fixed exposure
All light intensities are relative to the exposure they're being viewed at
Thank you both, I played around with the exposure settings as well as the light units and figured it all out. π
Bump
this is my game, I play as a robotic fish, dont worry about context, I added lights which the fish can hold so it sees better, but I dont want to see the lights behind walls, can someone help me?
Built in render pipeline :D
Im working on changing from the forward rendering path to deferred. Id like to use a cel shading model for all the lighting and materials in my game but realized the G-buffers dont hold the information I need. From a bit of research I know that I can fill the gbuffers with "any" information I need, but im completely lost on where to start. Any pointers or resources would be helpful. Sorry if any terminology is off as im figuring out deferred rendering.
*I also know you can supply your own shader as a substitute for the deferred shader that ships with built in, if thats the key
my game doesn't use baked lights at all or anything, however If i play the game in the editor everything is normal and now suddenly when I build the game everything is extra dark and I have no clue why. Any help?
Hi, I have two meshes that both use the same material, but one is a lot darker than the other... (One is a primitive 3d object (a cuboid) and the other is a code-generated mesh), the UVs are being mapped correctly when I switch the material to something that has detail, it's just always darker for some reason.
Anyone has had anything similar happen? Thanks for the help in advance.
The mesh (the dark thingy) is generated at runtime?
yes
And you have realtime lights or what lights do you use?
no
I think I just have basic environment lighting
But almost everything in the game are generated realtime and they're lit just fine,
Hmm. Sound weird to me.
Do you apply a wrong material or something?
No, 100% sure it's the right one
Really hart to tell for me from the distance ^^
Does this piece receive any light? What happens if you place a point light very close?
Are the normals inverted somehow?
The shading on the mesh looks a little like weird normals.
How do I check the normals
I wasn't even worrying about normals when I was building the mesh (through code)
I never created mesh trough code.
I guess you need a shader or script that visuals normals
I haven't even initialized the normals, they're empty... I'm guessing that's a problem, right?
Could be, yes.
Ok, thank you... I'll try to read up on programatically creating normal maps...
Can I make pickups have like a smooth halo of light without actually adding a ligth source for them? I think that's way to demanding for coin like pickup of which there will be many
Like some kind of equivalent shader of the sort?
Or mask around them
is there any way to make my viewmodel lighting look better while having baked lighting?? or is the way to go realtime
Light probe groups and reflection probes
Many games use billboarded sprites with additive blending for "fake" glow and it works really well
In Unity "sprites" mean a different thing, so you'd use something like particles for it (it also uses "billboards" to mean a different thing, unfortunately)
Particle System with just one particle and no shape or velocity can work as a "billboard sprite" which is what I use often, but you might also want to make your own billboard system in some cases
If you have more realistic graphical style, another option is the lens flare component which lets you simulate refraction from different camera lenses
And of course check out post processing bloom, which can do the glow immediately and convincingly if your material is emissive already
If you're generating geometry, you also need to generate vertex normals
Normal maps are an effect on top of vertex normals, and can't function without them
hey guys i have baked lighting and urp but my spot light doesnt do anything any ideas?
Doesn't bloom need baking in URP?
Bloom is a post processing effect, it's not possible to bake it
Noone can help you without any info from you ^^
hey, how could i improve the lighting/ graphics of this?
i feel like it doesnt look good atm
add a skybox ^^
Volumetric clouds
do you know any good URP asset?
i tried making my own recently but they ended up lagging the game and dont look that good
Hey all, new here. Hopefully this is the right place to ask this question. I'm trying to add a Light Probe Group to my Scene, but the probes don't appear in the editor. All my gizmo settings are correct, they just don't show up. Does anyone know how to fix this?
in the lighting tab at the end is a area for light probes. There you can define how lightprobes are shown
I've tried every setting here, still isn't visible
your gizmos are deactivaed
everything up there is a button π
Hello, I'm making a 2d game and in a level I want to see nothing that everything looks black, all black and when the character puts a torch you can see around the torch, you can see what is the map, what I mean is that everything looks black and the light of the torch let you see the map, but I've been trying things and I can not do it, anyone knows how it could be done?
I am currently working on a XR game in the urp render pipeline and whenever i try to place a light it doesn't emit anything, does anybody have a solution for this?
I'm very new to light baking. Trying to make a simple scene but the walls keep these black areas. Anyone know how to fix this?
why does turning off the directional light also turn off my spot lights? this scene is full real-time URP AFAIK
They are possibly not set as static or have a bad UV. Did you check βgenerate lightmap UVβ in the import settings of the wall?
They're not imported, I made them using a tool called RealtimeCSG
I can only assume that has something to do with it
They all have mesh renderers, which have light settings. Could maybe be those? I don't know enough about lighting to make sense of the settings.
why is it that when I set my lightmap size to 4096 it changes from progressive GPU to CPU
Most common reason for falling back to CPU is GPU VRAM limitations, which this sounds related to
In my opinion it's just as likely to be a random bug or hitch though
is it possible to change that or is that hardware limitation
If the reason really is that 4K lightmaps can't fit in your GPU VRAM, then it's likely to be a hardware limitation
Each major version of Unity has significantly improved the Progressive Lightmapper's ability to utilize VRAM though, especially when it's scarce
Why are you increasing the lightmap size? There's rarely a benefit to doing so
I have all these weird light seams
I'd rule out lightmap UV overlaps first
https://docs.unity3d.com/Manual/ProgressiveLightmapper-UVOverlap.html
And try to ensure they're packed with proper margins / padding if it seems the problem is light leak from adjacent UV islands
"Receive global illumination: light probes" means the meshes do not get lightmaps at all, instead just the light from the nearest probe, if any (assuming you're not baking with APVs)
If a mesh is generated, the generator needs to take care of its lightmap UVs unless it's also saved so Unity can process the mesh like any imported asset
I can't find where the margin method setting is
oh its the import settings I Think?
Yes
I've been super jumbled the last hour or so because Unity was reverting settings for some reason. I actually had those all set to Lightmap when making this issue, even though it says Light Probe in the screenshot. So just ignore that lol. Even with Lightmap enabled, these random black spots keep appearing. They only appear at the very end of the render though. Here's what I mean:
In the last couple seconds of the render it just appears
Your Lighting Settings Asset reference looks to be just blank
That doesn't seem right, the settings should be getting saved to an asset
It's always been blank, what should be there? Again I'm very new to lighting so I'm still figuring stuff out.
ive tried messing around with my lighting settings but i have no idea why my player still has this weird aura around them. it just popped up out of no where
my shadows are all trash quality too
i ran into the issue where i had low quality shadows before, but it was bc my urp lighting asset wasnt calibrated properly. But i havent changed it since then so i have no idea whats going on
right click in ur assests > lighting settings > drag it into that blank area and change the values to fit your needs
Don't see that option
my friend has a main menu where after he presses the button and goes to his main scene, the lighting in his scene is messed up
i think its bc its under the floor that its acting weird
Not under the floor
Vertex lighting?
yeah i see that now. ive had this issue before and i think its bc of the way it interacts with the materials
Not sure what this means
anyone?
Honestly I've had exactly the same issue, when starting the game everything looks good but when I start from a different scene and use a button then lighting is messed up, so I am curious what's the solution 
You can set lights to pixel or vertex lights. If you use pixel lights they'll always look soft. If you use vertex lights they'll calculate per vertex so you'll get stepping. They do give a kinda cool old school look though. Check your quality settings.
Also try looking at your wireframe and comparing with the light.
If it is vertex lit you'll just want to subdivide the mesh you're lighting a bit more.
Thank you! I'm trying to get the Ultrakill look, but instead of looking retro-ish like Ultrakill it just looks uh... bad
But thank you for the help
No problem!! Good luck!
and i keep getting this jittering affect on my meshes
and the shadows are super bugged if the light is too close to walls?
looks a little like z-fighting, where 2 faces overlap each other or like shadow acne, where you have to play with the shadow bias of your point light.
You'll want to show all your realtime lighting settings to us, including any defined in the light components
The "new" button next to the field creates and assigns a new lighting settings asset
You're not supposed to be able to change the settings or bake unless you have an asset reference there
Why do I need lightprobes for realtime lights that have multiple bounces?
Realtime lights normally can't bounce so lightprobes are not necessary for them
What's the context
ik this is prolly really easy to fix but when baking lights it bugs and tells me this on the broken objects ive tried deleting the UV's ive tired clearing the lighting data and rebaking... ive tried new baking settings idk
UV Overlap view
do what the error says, its pretty explicit
@deft fiber
This was the topic back then and he told me to use light probes.
(See the text of: "user unity.discord".)
Sure
Lightmaps are non-realtime, baked or precomputed representations of light falling onto static surfaces
Dynamic objects can't have lightmaps because lightmaps stop being valid when the object moves
Instead light probes are used that store the baked light at points in space and transfer it to any dynamic objects nearby
Realtime lights can't have bounce lighting without ray tracing, as a rule of thumb
"Realtime precomputed global illumination" also known as Enlighten is a bit of a confusing exception to that
It precomputes static lightmaps that represent how light could bounce, then illuminates them by distance of realtime lights (or maybe only "mixed" type lights, I don't recall the exact process)
I assume Enlighten also has to use light probes for the same reasons baked lighting has to
you mean this? i tried messing around with these settings yesterday but they still look trash
These as well as the setttings you have in your active URP settings asset
Which is the most important
Also see the console if you have warnings about shadow atlas size
i dont get any errors
and i didnt touch the urp settings at all before this started happening
It started happening at a specific point?
yeah when i built my game for the second time yesterday it just started happening
Tbf I have never seen shadows this bad and I wouldn't know how to make that happen on purpose, so I'm sure something's severly glitched out
My first fix would be to make a whole new URP asset and set that as the active one from the Quality tab of Project Settings
i've tried replacing my urp asset with a fresh one and that doesnt fix it either so i dont think its that
i was just abt to explain that lmao
Then I'd try deleting the Library folder of the project
yeah i've had to do that in a seperate project before, but it wasnt bc of lighting issues. I'll try that tho
is it supposed to be 3/5 gbs? π¬
Yea that doesn't sound too unusual
The bad part is Unity will have to regenerate most of it when you start the editor
But that should wipe out any weirdness that's slipped in there
regenerating for 20 mins already and its been stuck on a few models for half this time, should i be worried?
20 mins is not unusual for a big project, but it can get worse if your meshes are not well optimized
my project is only 5 gbs total, 2 gbs now after deleting this folder
The Thing I dislike on Unity's raytracing is, its mostly only compatible with Nvidia GPUs that supports Raytracing and only on Windows.
I want my games run on every hardware, even with none-Raytracing hardware and also with AMD and Intel GPU's.
- It also should still support Linux.
And if this is not possible with the Ray tracing of Unity, I will not touch it.
But how can we have now good looking Realtime lighting?
That is a Item that can spawn randomly on my map.
Thats why I used realtime lightings for it.
I cheated a little bit around by using a blue transparent sphere to imitate a glow light but its actually a sphere object with a transparent glowing shader.
The light doesen't bounce because it's realtime what makes it looks cheap.
Is there a way to make the light still bounce, even if it takes more performance?
I dont want to use raytracing because Raytracing always needs Raytracing GPU's, does only run on windows and needs the HDRP render pipeline.
enlighten
if your map is not procedual, you have access to enlighten to aid in improving the quality of your realtime lighting
enlighten will calculate realtime GI for lights in your scene
and its fast enough to run on a lot of hardware
even hardware that doesn't support raytracing
I use URP.
Do I really need HDRP for this?
no
I don't know if URP reimplemented enlightne back in (I think they did?) but the original built in unity pipeline still has it
looks like they did in URP so your in luck
Is it the same steps for URP like on HDRP?
Because I only can find tutorials for HDRP.
it should be similar, atlhough I'd probably look for tutorials in built in rather than HDRP
Tbf I can hardly see any light at all in these images, you should expect much better realtime lighting before you even start worrying about bounce lighting or precomputing or anything
its a lot better than before but it still looks awful
and it still has this weird effect
This one is probably a problem with the mesh
Looks like overlapping geometry
Sure soft shadows are enabled on this particular light? I'd toggle them off and on again
but it never did this before?
yeah theyre on
A lot of things can happen
Maybe you tweaked bias settings while testing and the problem became apparent
i dont remember touching the bias settings at all, but i've been playing around with them and it looks awful and keeps being buggy no matter what
even with the default settings
i still guess its z-fighting π
like i said, it never did this before
so why would it start now if that truly is the case?
Magic perhaps
now its not doing it anymore after i created a new point light?????
but the shadows are still bugged if the light is too close to the wall????
i am so confused rn
Try not to put it too close
In this image are you using a spot light?
i know it'll be bugged if its inside a mesh but this is far enough i believe
yeah
default settings with soft shadows on
it clearly has enough room to work with
With what spot angle? Higher than 90Β° will start distorting the shadow mapping
ahhh so sorry, i meant point light
The setting is "shadow near plane"
in the light component?
that looks like HDRP, enable contact shadows
im using urp
ah, idk then
can you send me the fbx?
Im curious now and want to check this! π
for the green gameobj in the photos?
yeah
Yes
yeah ive tried messing around with that and its still bugged no matter what value its at
If it's at the minimum 0.1 that means shadows casting will start at 0.1 units
thats what i've set it too but it still seems like it has a lot of space left
i may be mistaken tho?
and the shadow at the corner is weird too
Impossible to tell from the picture if that's more or less than 0.1 units
what info is needed to tell?
You could measure it practically
See if a default cube with 0.1 scale fits between the light and the wall
yeah there isnt enough space
but why does the shadow at the corner look so bugged?
in this photo ^
i've sent it btw
IDK what you mean. The game plays in darkness and the only lightsource is the players flashlight and some glowing crystals.
Also, the lights everywhere gets 100% black and I cant solve it because its baked.
I think you mean what's sometimes called "peter panning"
It's a side effect of shadow bias
Shadows must be offset away from the object that's casting them so the shadow doesn't get drawn 'on top' of the lit surface causing ugly artifacts
You can alleviate it some by tweaking shadow bias settings but you should always avoid extreme values or you get other issues
It can never be fully eliminated, but it won't usually be noticeable when you have more detailed meshes and textures
(HDRP implements "contact shadows" as v0lt mentioned which helps it a lot, witch specific limitations)
ah ok thanks for all the help, i think i'll just deal with how it is now since it isnt as bad anymore and i've wasted 10 hrs of my life fretting over this. again thanks for all the help!!!
The lights won't look so bad when or if you move from using smooth greybox assets to something more grungy
That said your project's lights and shadows do look kinda weirdly bad and there's a bunch of mysterious issues
In your position I'd make a new URP project from the template, import a part of your scene as .unitypackage with the geometry and lights and compare the quality
In case the template settings are better
Dose anyone know how to get text to be effected by 2d lighting. Ive been trying to find a way for a while now but can only find stuff about setting up 2d lighting when i look for it. um using the 2durp project with 2d lighting set up and the text is on a canvas set to world space.
Probably not, unless some version of unity has implemented 2D lit text materials
Texts require their own shader to work, and so does 2D lighting
There isn't any simple way to mash them up together
Simplest way is to make the texts in sprites, but they won't be editable
I can't really see light in the way I'd expect, is what I mean, so I'm not sure if what you're seeing is even the light working properly
Realtime bounce lighting an incredible technical challenge to do in game engines, it's not just Unity
Your best option for it is Enlighten realtime GI as mentioned, I'd follow this tutorial
i thought it stopped doing this but apprently the shadows are being casted AROUND the gameobj somehow??????? it isnt as bad as before but its still extremely prevalent. @deft fiber save meeeee π
in that case im probably just gonna make a some sprites for the letters then and just write some code to make it with sprites at run time unless you can thing of a better way
yeah... i might just delete this one and start from scratch...
From this angle this looks like super messed up light bias settings, probably too high
these
1 and 1 don't sound terribly high
thats what its at...
and it doesnt look bad when i look at it from the scene view anymore
it let me see it in the scene view before when this issue was a lot worse
heres some more angles bc i dont even know what the hell is even causing this effect
https://forum.unity.com/threads/2d-text-not-reacting-to-urp-light-sources.1291967/ post #13 seems to have a workaround
One of the TMP resources includes an URP Lit shader graph of the text, which you can swap to Sprite Lit type
Still possible that newer unity versions include an official version
Looks like Bias to me still
It always has issues with meshes with sharp normals
Another thing that may be throwing off your observations is that your light is much further forward from your camera, meaning that all objects in front of your camera will have a shadow behind them that's much bigger than the object itself, simply due to perspective
Normal bias specifically with meshes that have sharp normals
Yes but why would this start now out of nowhere?? I'm still so confused on that
And deleting my libraries folder seemed to help but it's still happening
I'm not seeing anything mysterious happening this time
I cant fine the TMP_SDF-URP Lit shader it mentions
i might be crazy but is the shadow not in front of the mesh?
Seems according to the thread there's some extra steps to make the option appear
It may also not be available at all if you're on some old version of unity
Why would it be in front of it?
i guess i am artistically challenged and have no idea how shadows work
also, setting the bias to 0 for both seems to do the trick
like in the real world ^^
the thing says in post #4 i need to get tmp v3.2.0-pre.3 i have the show preview packages enabled but that version is not showing up. Post #5 says it dosent show up in unity version 2021 which is what im using. It says the only way they found to get it is to down grade the project. Is there a way to get it withought the downgrade.
Which TMP can you get?
/or have
its says 3.2.0 is a pre veiw but it dosent show up
I tried adding some sort of settings reference into the lighting, but it didn't fix the artifacting issue. Does saving these into an asset tend to fix this kind of artifacting?
Having to downgrade doesn't make much sense to me
According to docs versions beyond 3.0.7 are available in Unity 2022.3. and beyond
I seem to recall that "preview packages" aren't really a thing anymore, but not totally sure
should i install the 2022.3.18f1 lts and change the project version then
If you do so, do so with version control or a backup, as a big upgrade can break things
Thanks.
And whats with software raytracing?
If you have a engine that supports for every GPU (even none RT GPU's) software raytracing and even for plattforms like Linux and WIndows.
Is this also complicated or is in this case most of the work already be done by the engine?
Raytracing is slow even on an RT GPU, even when only used for only partial light rendering
I don't think of it as a practical solution, at least not as the only option for the user
I managed it to work on a GT950M with 60+ FPS.
It totally works in performance.
The only question is, will this also have complicated effort?
- Because you said it effects every engine.
Raytracing simplifies bounce lighting a lot, technologically anyway
I don't think setting it up is very difficult, rather just different from all other types of lighting
In Unity you have to be using HDRP
As far as I know (Correct me if I'm wrong), Unity's raytracing is only working with GPU's that also supports raytracing and other none-windows plattforms like Linux are not supported.
Maybe, I'm not that familiar with it
You'll probably want to support non-RT lighting solutions anyway as an option
I mean I found another Engine that uses "software raytracing", that can support RT and None-RT GPU's and works even for Linux.
I just would like to know if there is anything like that also for Unity?
No idea
I can say though that 3D games have been lighting dark areas without bounce lighting or ray tracing just fine for about thirty years now
Just have to use the tools to their strengths
ok, still thanks.
updated to a newer version but the version those forums said to download isn't there
nvm i found a way to do it
What seems to be the way? I couldn't find the version selection either, seems it's changed in the recent years
i still cant find the shader mentioned in the other post even though i reimported
Does the package seem to have any importable samples under Samples tab?
where is the samples tab
In the package manager on the entry of the package
If you don't see it, there probably aren't any
i dont see it but i found a tmp/sprite shader it just makes the text look weird when i set that as the shader
in the fourms it shows a SDF URP Lit shader but i dont even see a folder labeled SDF
idk wht i did but all the text is blocky now
thats because you deleted the font the text was using
Looks like it's using a non-text shader
TMP text relies on the shader to get the position of each letter, and to also mask the alpha correctly
no i was just checking all the tmp shaders to see if one of them would work i still cant find the one in the fourm
switching back to the other shaders still dosent fix the blockyness and im still trying to find a way to make it affected by light
Note that you're looking for Shader Graph shader assets* so you can edit them
i found the shader i reimported tmp cause i aperntly didnt do it right the first time and it also fixed the blockyness
It FINALLY WORKED whoo
they really need to add that small change to the shader as a new shader for tmp so other ppl dont have this issue
looks like you reached the realtime light limit per mesh.
I've got a total of like 10 active lights in there... I feel like that really shouldn't be too many
Are you using URP?
If yes, the default light limit per mesh is 4
You increase it to 8, switch to deferred rendering or bake lights.
What does deferred rendering do?
But first you should check, if the light limit is the problem you have.
You should crank it up to 8 and have a look if it works with 8 light sources.
Ty
So you found the shader graphs to modify?
Hi, asked question earlier in #π»βcode-beginner
My scene suddenly went extremely dark (looks like no ambient light), seemingly without changing anything. I'm using URP.
Realtime GI is enabled.
It seems the lighting messes up whenever I change scenes
I have managed for it to work in scene edit mode with recalculate environment lighting enabled but it still looks the same in play mode.
Not really sure what settings and values to show, will be happy to show whats needed.
You can show the lighting tab
Sounds like you just have to press "generate Lighting" and sace scene.
and you have set a color in the ambient light?
No, everything is default.
I've been messing around with it and loading directly into the scene works fine, its only when i change between scenes
SceneManager.LoadScene(buildModeScene, LoadSceneMode.Single);``` using single mode
You load this scene into another scene?
Not really sure what you mean by that. The intention is go from a scene which is just a menu to the actual game scene.
discarding the old scene
Your game starts in scene A.
Then you open scene B?
I just know the workflow that you start in scene A and additionally load scene B into scene A.
I would try to go to lighting and uncheck auto generate.
If this doesnt help, go to lighting > environment and change environment lighting from skybox to color, and choose a color.
Thankyou very much.
I've found my issue and its really stupid lol.
in the scene i was loading into, the lightning settings asset wasnt assigned, I was using another scene to test thats why I didnt pick up on it
alright π
Are you using both or either baked and realtime global illumination?
There's three different ways to "generate lighting" and you generally don't want to mix them up
Hello guys, I'm having an issue with baking light on objects and I am unsure on how to fix this or what the actual problem might be.
So, to set this all up, I have two plugins for baking: Magic Light Probes and Bakery.
Along with them, I have a custom shader for the objects which is not too complex.
Now, the problem, while baking, I have encountered this problem where the object is not baked correctly, where it has these weird artifacts, but only on specific spots in the scene (First picture). When moved to other locations, the object would bake correctly and I could not figure out why.
I tough it might be a problem with the custom shader and I set up the object with the Standard shader and the same problem occurred. Then, I placed the same object just above it and suddenly, the object bellow baked normally, but the object above it had the same problem. (Second picture)
Now, my theory is that, the object is not baking correctly because it has a lot of empty space above it, and whenever I place something above it, it works. Right now, I have no idea how to approach this problem or what exactly is causing this.
Also, I have used the default light and the default baking and had the same problem.
And, I am using the Standard Pipeline
I have changed from Gamma to Linear.
The colors appear all greyed out and shiny??
Why is that? I am using baked lightmap
for reference this is how it looked in gamma
additional information.
I am using URP, and build target is android
Looks like your reflection probe has become way too bright
You can bake just the probes again, but it may help alleviate more issues to fully rebake lighting as well
I am not using any reflection probes^^
I tried to rebake, but it just bakes back to this same issue
You should
If there's none it defaults to the automatically included reflection probe from the scene's sky
why does it not do that in Gamma space?
It's not meant to do this at all
My guess is that the reflection probe texture was somehow excluded from the conversion process
As every texture will have to go through colorspace conversion when you switch color spaces
interesting..
I will try it out in a while, got busy with something else. Thanks a bunch for the help!
While it's not strictly necessary to use reflection probes, they help a lot and the light baking process is really intended to work with them
Gives you more control over reflections generally
I don't know if this is a lightingi ssue.. but i am having quite a lot of trouble with my terrain paint which changes if the camera gets too far away. It's not occlusion culling.. get's worse when ambient occlusion is active.
Any ideas?
I'm using URP balanced renderer asset
Suggests to me it's a Terrain LOD thing
Terrain is made of chunks that swap to a lower poly variant over distance to make it performant
SSAO very easily reveals a mesh's true shape as it ignores normals
I see.. i can also tell that if i set the "Pixel error" up, the problem lessens and eventually goes away.
Whats that LOD setting i can try?
Couldn't tell, I don't really use Terrain
Yea. I'm just wondering what setting to tweak, to see if the problem goes away π
I know that Terrain has several different LOD settings for its own functions
Oh okay! will try
yea it does get more detailed as the camera gets closer. Can i change that somehow? or the tolerance, so it won't do it in-sight?
Hey!
Why am I getting these artifacts ? I tried to play around with the pixel error setting on the terrain and it helped, but as soon as I moved the camera they reappeared
https://gyazo.com/d0d0fe82d07380415f6461ea51b31d31
even if I disable all lightning in the scene they still appear
They look like shadows, so how do they appear without any lighting?
nvm it is shadow related, I only turned off the directional light but I have still had spot lights enabled that close too theese dark spots, if I move the spot light the shadows vanish, but they reapear again after a while
so something is wrong with my shadow settings : s
SOLVED
I dont know why but all of my lights had shadow update mode set to " on enable" instead of "Every Frame"
How to remove the fact that the picture looks as if the brightness is set to 100%? Everything looks fine on camera preview in "scene" window(1 pic), but it's not like that in the game(2 pic)
The tiny preview is likely shown without post processing
Which you can test by toggling the post processing checkbox on your camera
If that's the cause, then you'll probably want to configure your post processing override so it's proper
Or keep it disabled
It's nice to have though
Increase lightmap resolution or the ground's scale in lightmap (though these have diminishing returns) or use a mixed light with "shadowmask" or "distance shadowmask"
hello guys I'm a modder and I'm new to Unity, my problem is I just want to make the texture illuminate not the transparent object how is that possible?
Can you rephrase that?
What part of it should illuminate what part
something like this
There's quite a few things going on there
The plastic bit there is refracting the light and directing it forward, something that isn't really possible in realtime graphics normally (or easily anyway)
The easiest thing would be to make it just emissive with a yellow color
But if you're on HDRP you may also get some fancy results by enabling screen space reflections and making the material refractive, with another part to it that's emissive
like this, I just want the blue thing to light up the not the red thing
Are they using different materials or separated in some other way?
same material
it has texture on it
If the texture has separate areas for the spots you want brighter and less brighter, you should be able to modify it accordingly pretty easily
can I send the FBX file to you? I honestly don't know further
I really dislike baking, because it's slow on my computer, but I don't have an RTX card, can I get away with no GI, just direct lighting, SSAO, and SS reflections? or is another alternative?
I tried using UE5 with lumen, but it was too slow on my computer
nevermind found it accidentally thank you for the response anyway
Nevermind, I just found SSGI, or ray marching, and I think that looks good enough.
i have a lighting bug if im looking in 1 direction the floor wont pick up my flashlight
but if i aim the other direction it works fine
anyone know the issue?
the object is using the standard shader
how would i fix that
First make sure the normal map texture is set as type: normal map in import settings
hello to everyone, i have one stupid question, wich one is more heavier between emissive material for illuminate a room and a normal light?
Emissive materials do not illuminate, so that basically makes them "free"
so you can't use only emissive materials
With baked lighting you can (and I guess with ray tracing as well)
With baking it doesn't matter what type of lighting you use as the calculations are not done in realtime
(except with Mixed lights)
these questions are because I have to create a metaverse for VR and I wanted to try to optimize as much as possible
and this metaverse is ispired to cyberpunk, so a lot of emissive materials
Metaverse, now that's a name I haven't heard in a long time
The best thing you can do is to study Unity's lighting methods as much as you can
There's a lot of stuff specific to render pipelines, and each method tends to be its own balancing act between performance, dynamicness and quality
And try to also find VR-specific resources because that imposes a lot of unique limitations
ok really thx for answer me
Is there someone that I can talk to and show what I don't understand in lighting? Quick screen share
solved it
Hey guys, I baked a scene but got these pixel patches on the object, I have increased the resolution and quality of the lightmap but the problem remains the same, how can I fix it?
Did you check "Generate lightmap UVs" in the import setting?
If yes, check in the debug view, if you have "invalid texel artifacts"
anyone know anything to battle light leaks like this? In some areas I've had to just put walls together when modelling the map. Tried setting the shadows to double sided, even a cube inside
is this baked?
yep
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/
Chapter 18 could help
Fixed it, It was about surface rendering. I changed it to "both" and everything was okay
ty
What does he mean by "DCC tool"?
Blender, 3DS Max etc.
Hi, I'm having an issue where when I bake lights in a blank scene with just 6 cubes it does nothing and leaves the scene stuck with just the ambient colors effect. Any help appreciated
Are the lights set to baked and the cubes set to static?
forgot about static lol ty
it is
Then I'd swap it out for a completely default material (copy from a default cube if you want to be sure) to verify whether it's the specific material's problem, or something else
Hello guys, can someone help me explain me why invalid texels occurs?? In baking lights and how can I fix them
Hey!
Thats Chapter 15
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/#post-8467202
Hey @chilly kettle what are back facing surfaces
The backside of a face/polygon.
The side which is not receiving the ray directly...I guess that's the back side
got it thanks
I just put it on toon shader & it fixed
Try moving it much closer to a wall
From this angle it looks like the max Range is cutting it off
I am just baffled on why in the engine my game looks like this
But when i build it looks like this
Lights are all mixed/baked
The most common reason for this kind of discrepancy between project and build is that they have different quality level selected
The quality tab of project settings lets you select the currently active quality level, and set the default per build platform
That rules that problem out
Build for windows desktop?
yes
I'm thinking
it could be the global volume
im gonna make a thingy to toggle the effects on and off in game
because in the build it doesnt seem like theres anything
The glaring issue is that the build is missing post processing, which can make the lighting look different too
but when i built the game with no PP, there wasnt any of this darkness problem
but when I built it without the pp enabled, it was exactly the same as in the engine. And it was brighter not darker as seen in the 2nd screenshot
To my eye it looks like maybe having the wrong tonemapping, or something similar
Though the brightness is all messed up the lighting itself doesn't look to be changed
I use exposure, bloom, chromatic aberration, film grain,
vignette, SSAO, depth of field, lens distortion, panini projection, color audjustments and 3 others that give the slightly glitchy/old camera look
Not an issue I recognize at any rate
So what I'd do in that situation is make a purely default test scene with simple cubes and, simple lighting and default post processing and try to make test builds with that
It should help you rule out issues with both lighting and post processing by process of elimination
You mention using some system for toggleable effects
Depending how you do it, it may in some circumstances mislead the build to not compile all the shaders required for post processing, leading to only a partial effect
Ah
That's my stab in the dark anyway, I'm more familiar with lighting than post processing and I'm not spotting a lighting issue per se
I was thinking just a menu on screen to toggle each of those on or off so I could see whats messing up
I'd go with the default test scene to see if you can find something that makes it tick
If you're using URP or HDRP it sometimes helps to create a brand new Render Pipeline Asset because undetectable problems can slip into them
Could also make a post about it in #π₯βpost-processing since that's likely to be more relevant, especially if the test scene provides no useful results
okay
Yes I may have to now
i found a clue
With just bloom, exposure and color adjustments on in the engine
vs the game build
Im gonna try what you said on a new volume
I'd test with a wholly new Profile asset, as well as Render Pipeline Asset just to be sure
I have a question and hope anyone can help me with it because I have a atlas lightmap (.tga file) (several textures of a map lightning) and I want to use it on a 3D map but I don't know how to do it (I did add the lightmap for anyone who knows about it to see it)
How come you have it as a loose .tga file?
I did export it as a .tga via Neosis but I could also change it to png if it makes any difference
Neosis? You'll have to explain your workflow a bit
Otherwise I'd tell you to just bake a lightmap in Unity using its systems
I can try
I have a 3D world that I did export from a nif into a fbx (Autodesk -FBX) via Neosis
Every map I wanna use have single textures (dds files change into png files) but also lightmaps with the .tga
Now I have the 3D map with all the textures in Unity and added them but the lightmap is suppose to be on the textures of the map to make it look like the map has lightning or however you wanna call it when you put a light texture on another
Idk if it is a good explanation
I just don't know how to add this lightmap to the whole map
Using a custom premade lightmap is not super simple if it needs to interact with other types of lighting
If it shares the same UVs as the base texture, you can set the lightmap as the emission map
If it uses different UVs, you could use a custom lit shader to pick a different set of UVs for it and also use it as emission
But that'll be entirely separate from Unity's own lightmapping systems
Mainly it means you won't have any light probes which are necessary for baked lighting to affect dynamic objects
Ye till now I did just try add it as a normal lightmap or occlusion map but the results were far from what I wanted it to be
For now I don't plan on using the unity lightmapping systems because I want to have the same results as the map had on the previous engine
my 2 cents:
Dont make your life complicated. Make a cut, use the unity tools that it provides you and you will have a good result anyway.
Its not worth puzzling around and trying to do some weird workarounds for a small difference. Maybe you are the only one in the world who will see the difference ^^
Ye was also an idea, I did just not know how to do it yet so I didn't really try it
Give it a start and ask here if you need support π There are many good tutorials out there for lighting.
I see
I will give it a try but I will also take a look into the lightning systems of Unity, maybe it will improve the map in one way or another π
Anyway thanks for the help @deft fiber and @chilly kettle I will come back when I did test around a bit
Are you using URP? If yes, there is a great tutorial for lighting i can give oyu
I don't think I use it but I gonna check it out later
gotta say not sure how to cut out the lightmap its kind of difficult.. xd
You still trying to get your old lightmap to work? π
Ye I did take a look into the cutting but its difficult
Not sure how I am suppose to cut that out XD
(its the lightmap as png)
im still sure, that you will get a very good and faster result if you just bake it in unity
I know but these lightmaps are made for these maps so it would kind of change the whole to map to use different lightning
Light simulations are more or less deterministic even regardless of engine
So if you use the same lights when baking and similar settings, you'll get very similar lighting
how do I render an object so the player cannot see the mesh but the mesh still blocks light?
note the shadows
Have one mesh renderer as "shadows only" always there and toggle the visibility of mesh renderers set as "no shadows"
how do I set the mesh renderer to shadows only?
The component's properties
I might be blind but I do not see any way to set it to shadows only in properties
https://docs.unity3d.com/Manual/class-MeshRenderer.html
Lighting > Cast Shadows
I set the mesh invisible by turning Renderer.enabled = false, which turns shadows off regardless of how shadows are. How should I turn visibilty off as Renderer.isVisible is readonly
You could either
A) Have a third mesh just for shadows that you keep always visible, and two wall halves without shadows that you toggle the visibility of
B) Toggle the mesh shadows only rather than disabling its renderer
gonna be honest I looked through the docs and I just didnt see shadows only - thanks
why does having a directional light make the skybox bright? Even if i set the directional light to intensity: 0 the skybox remains bright and it looks so bad.
i feel its unnatural cause directional light intensity value makes the terrain brighter or darker but the sky remains bright no matter what i do
By default the dynamic sky shader unity uses is always a bit lit, and gets brighter along with the sun
You can override the sky from the Lighting window's Environment tab
you need to make a shader that can use the lightmap. basically you need to multiply the textures with the baked lightmap.
old unity version initially use this kind of pipeline where you need to bake the lightmap outside the engine
which setting? i tested all settings there and sky remained bright even with 0.0 intensity directional light
You can either:
Set enviornment lighting source to a black color, and also the background of the camera component to a solid black color
Or get a pure black texture and create a sky material with it and assign that as your skybox
but then you dont have skybox at all if u set both light and camera colors to black
maybe i just need to use other skybox material
unsure
I assumed you wanted a black skybox when you asked why it remained bright without a directional light
But yes, in that case you need some custom sky material, or skybox texture
Unity's procedural sky is a bit customizable if you make a custom material with it
is there any way to pause lightmap baking?
It's a tragedy that sometimes electricity shuts down and the ups could only hold that 100% cpu calculating the lightmap bake just for 20-25 minutes and then...black out!
a waste of a whole night lightmap baking operation
unity should make a way to hold the resume of light baking process
idk if is there already any option or not...anyone knows about it?
why does my lightning in my main game look like this whenever i load it from another scene?
Make sure the scene you intend to be active is set as active
What is βthisβ?
If you load a scene (with lighting) into another scene, you often have to update the lighting via code.
Unloading the previous scene and loading the next one also works
i have this issue with my lighting, messing with the normals and moving the spot light also doesnt work
Thatβs the bias of your light source
Does anyone know how builtin deferred render pipeline culls the reflection probe?
From my test, the frustum culling of reflection probes is very, very coarse. It seems more like a test between the OBB or even AABB of the camera frustum and the AABB of the probe.
Iβm encountering an issue where a lot of probes are aside from the frustum planes but still drawn each frame as they are not culled, i.e. a lot of false positive when Unity performs the frustum culling
In a frame where the camera is looking down at the ground and at most 3 probes are intersecting with the frustum planes, Unity actually issued 260 DCs to draw the probes, which means 130 probes are renderedβ¦ Thatβs such a waste
are you using probes blending?
probably that's the reason unity skipping culling for them
so I got this somewhat big map into unity with plenty of windows, and I'm wondering what would be the best way to make those windows reflect the static objects around them without frying a player's system
they don't need to be realtime reflections or anything, static images are fine. I tried adding a reflection probe to the windows' mesh, but for some reason moving the probe around made one of the adjacent buildings become pitch black
Late reply but if your still having this issue bake your lighting through the lighting tab
default values work fine
At least frustum culling should work right? It doesnβt matter whether blending is on or not. Especially in the deferred context
With my test, it does seem the frustum culling is performing an AABB test. Because even a probe that is way outside the OBB still cannot be culled
This is especially worse with long far plane distance. But in certain setups, even a short far plane could still suffer from poor frustum culling
hi i need some help
i am trying to make volumetric clouds reflect with ray tracing mixed with ssr.
with ssr the volumetric clouds reflect just fine
but with ray tracing or mixed with ssr, the clouds do not reflect
any pro's out there that know why this is happening?
You have recursive reflections where one reflective surface is facing another. Read the Interreflections section on this page, there is a setting for increasing the limit for recursive reflections. https://docs.unity3d.com/Manual/AdvancedRefProbe.html
I can't manage to get a room any darker than this despite turning off all of the global illumination, is there a way to get it like pitch black?
check your scene environment lighting intensity
you might have a set ambient color/skybox/gradient lighting
So I've been playing with baked lighting with additive scenes, everything seems to work okay, but if I move the new scene somewhere out of origin the light probes seem to stay at origin. wagwan?
wait, should i just bake the offset into my scene? that seems like the obvious solution
although i predict floating point errors
my motive here is to make smaller baked scenes and combine to cut the baking time for areas
Hello Guys. Can you help me pls? I am new in unity month ago i do my first project.
Gallery with my pictures. I have 2022.3.16f1 Unity. I create gallery interior,
change to URP. Set lights and bake them. I do thos like UGuruz in his youtube video.
After that. I post project to itch.io. When i open project in mobile, i can see extreme lights in scene, too much. When you open the same project in pc web broser, you see everything with correct lights.
Can you pls help me with this problem? You can check my gallery: https://memakemyart.itch.io/x
After i add more lights atc. Have more things to do. Can somebody of you help me with this? Ty soo much. It is because mobiles after you open project in them, dont cant read post proces information? So i must create project without post proces to see in mobile the same lights like in unity?
first picture is open in mobile, secont in pc web broser
Its possible that your game is shown in different quality settings on Mobile and PC.
Its also possible that Mobile cant show PostProcessing correctly.
But for me, also your PC version doesnt look correct.
my setting sin unity is on ultra.
hey , it doesnt have to look that way at me , i've done nothing wrong
what do you mean by that?
ps. I change in Lighting-Scene-Lighting Mode settings to Subtractive. Now the scene is not bright like before.
anyone here experienced in unity urp light bakes?
Hey guys, Im trying to figure out how to make indoors darken than the outside
HDRP
this screenshot is with the sun disabled
Update, I realised that it is related to the Visual Enviroment component, but I cant disable it but it completly changes everything else :/
reflection probes
you can change the light intensity throught probes thus darkening reflected objects
is 32 gb RAM (3200mhz) enough to bake a large scene same as gta 5 using progressive cpu lightmapper? obviously the lightmap resolution is set to 16 and only non directional lightmap in substractive mode.
for now, i only have 8 gb ram and whenever im trying to bake a large scene, it gives some error msg like job failed, not enough memory, path tracer isnt initialized blah blah blah....I found out it's because of low ram.
or is there any other factor like cpu cache or something? using core i5 9th gen.
Im now in a confusion about what should I buy, 2 sticks of RAM(16+16)? or a 4gb gtx 1560 GPU?
how come only one side of the bumper has the red light? i put lights on both sides....
how to fix stutering point lights?
How do you apply the light there?
Give more Infos
i place the point light in the scene and it flickers, i have no idea why
oh maybe its cause its in side the mesh
i inserted an empty game object into the car. in that object i put 4 spot lights 2 for the headlights and 2 for the brake lights
the headlights have the glowing on the bumper from the lights so
its weird
Maybe you reached the light limit per mesh?
yeah. google for something like unity light limit per mesh ^^
great just need to reposition them
thanks
cool. π
how to light materials with toon shader?
Thread
I made a ceiling lamp in Blender 3D, should I give it a spotlight now and flicker it with animation or should I make the spotlight in Unity 3D and animate the flicker that way?
In Unity
No texel invalidities?
hmm. dont know if bakery supports the scene view debug now.. back in the days when i used bakery, it doesnt
you can check for invalid texel artifacty in the debug view
ch 15 didn't help
but for some reason
I just randomly rebaked
and yeah
its somewhat gone
why tf is unity like this
fuck
its back again
do you have importance sampling enabled?
those potentially look like artifacts related to either denoising, or using settings like importance sampling
importance sampling in basic english basically meaning that, to make the lightmapping go faster, rays are more "smartly allocated" in certain spots than others
This has to do with denoising for sure. When there's long strips like this sometimes the denoiser get confused π You can increase your sample count, change denoiser to OpenImageDenoise, use filtering and/or move your lights (or add more lights) to cast more direct and indirect rays onto this geometry to make sure that the density of rays hitting it is enough to create a consistent lightmap.
Hi guys,i am trying to create a baked lightmap but when i try to create it it is all black
i Selected as static all the object i want to be baked and the light is set in "baked" mode
Do you have an idea of why it doesn't work?
do you have lightmap UV's generated on those objects?
hi guys! i have a bug in the seams of the UV, this not happen in blender, the shadow is not smooth
Lighting experts, if I'm making a large city with lots of neon lights and windows, is it recommended to place lights on the prefab and then bake after I place all the buildings -OR- place all the buildings first then manually place lights wherever necessary?
Im trying to use cookie lights. any ways to have the effect from spotlight but with directional? because spotlight is quite small but directional is almost blurred out?
Did you generate Lightmap UV? Is there a hard edge?
You can do both, but i guess you will save a lot of time of you place the lights in the prefabs π
anyone know why my stars change colour to a yellow colour near the horizon? idk whats causing it and it doesnt seem to be the moon light, its just meant to me white/ blue starts but they seem yellow near the horizon
I was told that generating so many light maps over the whole city would take lots of processing power. Is this not true?
I guess you will bake it?
Yeah definitely
Sure it will take a while, but that should not be the problem ^^
It depends on the size of the scene etc.
So even if the scene is gigantic, as long as I bake, there shouldn't be an issue?
It will take a time to bake yeah.
But baking everything is not always the best way to go.
I guess there must be several tutorials for lighting terrains etc.
Sure, I will look through and see if I can find something. sorry if you don't mind I have one last question. (Haven't dealt much w lighting before). Do you think its worth placing lights on buildings if they already have emissive materials on them. Isn't that somewhat sufficient for a light source as far as the buildings go?
Donβt know how prominent you place the building and how he player will see it.
Often you can fake Light with emission and bloom.
You can also use lightprobes to make use of baked lighting without baking every single object.
Alright then i'll hold off on using prefab lighting for now, and I can always add the lighting to the prefabs later and -it should- update everywhere. Thank you very much for taking the time to answer all my questions :)
Your welcome.
Itβs always better to start small, learn how it works and adjust it later if needed ππ»
You are absolutely correct, couldn't agree more :)
Normal map is of the wrong type or incorrect otherwise, it would seem
Got a question. I have a scene that is using area lights, which are baked. However, even after setting up a Light Probe Group, my dynamic objects are not getting any data from the lightmaps (it seems), since they dynamic objects remain dark. Any ideas on what I'm doing wrong? I've spent about a day trying to resolve the issue.
Additional info, I'm using URP.
Dynamic objects should be affected by light probe groups, not lightmaps
Try to confirm that all shapes of light can affect both your lightmaps and light probes as well
I misspoke, still new to lighting.
I don't know what you mean by that second sentence.
Specify what I should specify
"Try to confirm that all shapes of light can affect both your lightmaps and light probes as well"
That is the sentence indeed, what's unclear about it
Point, spot, area and directional
Types, would be the word.
What do you specifically want me to test with them? I might just be able to give you answers about several based on the stuff I've already tried.
All of them should be able to affect both lightmaps and light probes at the same time
In this case it might be important to visually confirm that each of the lights can be seen on the lightmap, and on the probe group, visually
Well, baked area lights do not work, I would assume, considering that is what I'm using now and the light probes aren't working for my dynamic objects.
This with a fair accuracy confirms if the issue is with the light or the light probe group, and the lightmap should confirm where the issue is not
Have you tried such a test?
What am I testing? The type of light?
If I put a directional light, no shadows, it'll illuminate the scene of course (which is an indoor scene, so I don't need a directional light).
Point and Spot lights (realtime mode) are obviously going to illuminate the dynamic objects.
Point lights (baked mode) have the same effect as Area lights, i.e. none at all on dynamic objects, regardless of the light probe group.
@deft fiber
Put all kinds of lights in a test location with probes and lightmapped static geometry and bake
This confirms that 1. the issue is not specific to 'area lights'
2. if lightmapping works correctly with them all
3. if light probes work correctly with them all
Only static geo? Cause I can tell you that is going to work if that is all that is in that location.
If that all works, then that means there is no issue
Area lights are able to illuminate light probes which in turn pass their light information to dynamic objects, if all goes as we'd expect
A potential issue here is that the light probes may be too close to geometry
Light may be unable to reach them
Also, you'll want some in the inbetween space, not just the corners
I went around to each of the floor and ceiling nodes, none of their centers are in any of the geometry.
There are nodes in between, I don't know what you mean by there not being any in the "inbetween" space.
The point of testing for things that may seem obvious is to know what we're troubleshooting
Problem could be the area light or the light probes, but unless we know for sure 50% of our options are 100% wrong
Yes but what you're asking is essentially if all lights bake, yes?
I am looking at this photo and the probes are practically touching the floor and corners, and there's no probes between the floor and ceiling
Ahhhh, I see. That is an oversight.
If all lights bake to both lightmaps and light probes, specifically
I bet that is actually the issue.
I'm going to feel super dumb cause I was looking at it and a few others were looking at it and none of us picked that up.
Pics from any angle tend to help!
Otherwise I can only suggest the painstaking process of elimination like I tried to, if it's not a common issue
Hm, it seems like it made the cube (a dynamic object) brighter however it does seem to be as lit as I would think it should be.
Regardless of that, it doesn't seem like my character was brightened at all.
@deft fiber
oh my god.
One sec.
Okay, sorta phew. I noticed an issue and thought that was the prob. It wasn't.
Better pic now.
Hope everyone is doing well. Wondering how do i stop my directional light from bleeding through objects? Cast shadows is on for cieling floor and walls. The first image is directional light at -90 x and second is at 37 x. As you can see the light bleeds through still. I want it to be completly dark. Any help is much appreciated!
why are you using a directional light in an indoor space?
Itβs in the scene already
The way the project is setup we activate and deactive mini scenes in the main scene
Oh shit
I sense some upcoming problems after that but we'll see
lemme try it quick
another potential solution to try without shadow casting is to use layers
have your interior space be on a different layer, and set the culling mask of the directional light to not affect that specific layer
its cool no worries but I'll save the layer thing for later since personally I don't think its the best solution but I'll describe it more at the end (or if this current path fails)
looks like the shadow casting issue there is because your interior mesh does not have any exterior polygons basically
i assume its different fro mthese layers
solution to that is set the interior meshes to two sided shadow casting
on the mesh renderer
not sure what settings your seeing
I can tell your using URP but provide some screenshots for context
sure yeah try that
nah didnt work
any other hunches on what it might be?
here is directional light settings
a couple but think in this case the layer thing will do the trick anyhow
but its just simple as setting the interior mesh objects on a different layer
cool
just like this
will do
and then in the culling mask for the directional light you just uncheck the mask that you set the scene to
and the directional light should avoid lighting the scene
did you set the floor layer?
yes
double check
given that your doing a maze generator your not generating any additional meshes with the layer no?
i.e. extra floor mesh or whatnot?
no, i am removing one i guess
just the walls
but those seem to be blockign light
got it
i think shaders just didnt build
i replaced the object with the cieling adn it worked
thank you for your help!!
huh thats odd, well your welcome lol
kind of shooting blind there since I'm not familiar with URP, I know for a fact what I proposed would work fine in BIRP
Guys, can I report problems here
Let's see if they can help me with a lighting problem :l
its what this place is for
I am having problems with a point of lighting. As you can notice in the gif, when you focus the camera on certain parts, it is that the lighting expands to the terrain.
but generally if it is illuminating but it doesn't illuminate the Terran, I am using URP
whats your render pipeline
URP/BIRP/HDRP?
I'm assuming URP
the issue looks like its related to potentially per pixel lights
you might have too many realtime lights per object and unity is having trouble picking priority
I see, so how to check the priorities?
it depends, what is your render pipeline?
i say you URP
oh you did my bad
np
locate your URP asset settings file
and on it in the inspector there should be a lighting tab
the limit will be found here
default is 4, max is 8
thats the simple solution for getting around that issue
if you want more realtime per pixel lights per object without increasing the limit, you can actually simply split up the meshes in your scene
so for example say you have a large plane mesh for a floor and you have 5 lights in the scene, but unity is having the priority issue. You can split the floor mesh into smaller submeshes. As long as the mesh/object is interescting 4 lights at most
split the meshes? I don't understand, give me a sample, an example
heres a visual example, 8 lights on a single plane
now I'm in BIRP so things are slightly different but conceptually the same
notice how 4 of the lights have wierd artifacting
in BRIP when there are more than 4 per pixel lights it resorts to shading the lights per vertex
in URP's case I believe it just doesn't render them
you can fix the issue in 3 ways
first obvious one I pointed out was to increase the per pixel light limit
which is simple and easy to do, but there can only be so many realtime lights per object
the other solution is to split up the mesh to get around it like I described here
the limit is still 4
but instead of it being one big plane, its 4
and at most the planes in here will recieve 3 lights at most with this light setup
understand? @winged cloak
there are 2 more solutions beyond this as well that I can dive into if you want
If you tell me all the possible solutions for this, the truth is I was trying to analyze what caused this.
I still don't quite understand this solution you're telling me, but let me interpret it better
I'll try to break it down then
URP by default is a forward renderer, in forward rendering there are limits to the amount of lights per object that you can have before things get too taxing
for each light, lighting is calculated for that single light and this is done in a single shading pass
however if you have 2 lights, that means you need to do 2 shading pass for both lights
4 lights, 4 shading passes
the amount of shading passes scales with the amount of lights you have, but also the amount of meshes you have in the scene
and because of that things can get pretty taxing quickly
someone can correct me here if I'm wrong but I believe in URP it actually does support up to 4 - 8 lights in a single pass as an optimization but either way with forward rendering that is the inherent drawback of it
but anyhow back to basics, for each light you need a new shading pass for it in forward rendering
now I need to note the terminology of course
Per Object Limit
meaning on a single object, it can have only X amount of lights in URP
by default that means a single mesh can have only realtime 4 lights affecting it
per object/mesh
one of the solutions I proposed to get around that limit is to basically split up large objects into smaller objects
basically taking a mesh and breaking it apart into smaller peices
and remember that the limit is per object, so you break it into smaller peices so that the object you have covers less area, and therefore less likely to be intersected by multiple lights
just like I showed in my example here
a single large plane mesh that has a large area, and it has 8 lights affecting it
breaking the plane into smaller meshes, so that parts of the mesh cover a smaller area, and therefore get affected by fewer lights
in that example you can see when I split the plane up, at most each plane will have 3 lights affecting it at most
still don't understand @winged cloak ?
I understand, I will try to replicate the way you told me exactly. Thank you very much. If I have another question, I will ask you. I am reading everything you told me to understand it better
just to note ahead of time the solutions to such a problem are as follows (there are probably more but I don't remember them all at this moment)
- increase light limit to have more lights per object
- split up large objects into smaller objects so that it will be affected by less lights
- get around this issue entirely by utilizing baked lighting
- use deffered rendering (there is a URP version I believe where deffered rendering is supported), deffered rendering does not have a limit with the amount of per pixel lights you can have but does have more overhead
That's what I see, I'm trying to optimize resources as much as possible so I'll see, the one that best suits me, thank you very much
Got a tutorial for this: https://youtu.be/y_vw-jzuNs0?si=MtcPbCwUYF1P99g2
This video deals with the common problem of flickering or invisible lights in Unity.
If you also have the problem that your Unity lights flicker or become invisible depending on the viewing angle, this is the video for you.
Fixing the problem of flickering or invisible lights in a few seconds with a few mouse clicks
If you are interested in g...
how do i fix this issue with my lightmap? my directional light is mixed, and im baking shadowmask+GI
https://www.dropbox.com/scl/fi/xb4b1wybgrbqxlnsbckpw/Unity_X7wVo7Dde9.png?rlkey=er9a8jocc7amkvjjzspp0wf5n&dl=0
You'll always want to verify lightmap UVs as well, otherwise issues in the lightmap can show up in incorrect places concealing the cause
https://docs.unity3d.com/Manual/GIVis.html
How can I fix that the shadow is in a so much worse quality when i move further away?
adjust the shadow cascades in the quality settings
i got an issue regarding a fog disapearing when loading in addtive a scene (only in build)
idk it its linked to hdrp, if not, you can check my original message here #archived-hdrp message
Hey, I got a problem, where when turning on my directional light does something with my texture edges (one is with red texture fill to better see the error, otherone is transparent)). It somehow destroys them. When turning it off everything is normal. This only happens in game view
It's unclear what the "something" you're referring to is
I would turn off the pixelation for a moment to get a better look at what's happening exactly
i cant find whats causing my stars to apear yellow towards the horizon and ive tried unticking every box in sky and fog volume
Sry for not clarifying. My voxel project didnt look uniform in game view. For example in the right photo, my stand for the gas sign had wierd red pixels insted of just normal grey ones. I somewhat fixed it with turning of mip maps.
The pixelation is because of not having enabled anti aliasing. Because if i do, somehow my uvs get completely broken...
Whys everything purple π₯²
Deleted it and now everything is white and black, pls help
Given the context, I expect your materials are not HDRP compatible or simply haven't been converted
Well, what are you trying to do?
Hello,
I am loading scenes in additive.
This makes my fog disappear, any ideas on how to fix ?
- i am using hdrp
- i got no volumes in my scenes
- i only have one directional light (in my main scene)
its the probuilder prototype texture
im trying to add realistic graphics
using hdrp
Material, not texture
Try to contain this to just one channel
Fog isn't a lighting issue exactly
okay sorry
Does anybody have any idea on why objects in my current project touched by a light just sorta... POP into enlightment, instead of the light gradually reflecting on them as it's natural?
Tried the same in a new project but in such case it works fine
Looks most like pixel light limits per object or fallback vertex lighting, controlled by your quality settings
is there any way to make the "gradient zone" of the real time shadow distance larger?
(top is out of shadow distance, bottom is in)
clearly there is some internal setting for how much distance this gradient should cover?
but with it being so short, large areas in shadow are uprubtly lit when they leave your shadow distance
Does someone have an Idea why the light in my WebGL build doesnt work. It does not render shadows like it does in game view
could be caused by your quality settings
and did you build them with high quality?
i think so O.O Where can i check that?
Here you have several different points (beside my Screen icon) depending on which build methods you have installed. And there you can set the quality of the build
Your shadow casting is disabled, or shadow distance is very low and the pixel lights are falling back to vertex lights
These are settings controlled from the Quality levels you see above
WebGL has more stringent graphical limitations so not everything works the same way
How to fix this specifiq lighting issue? I tried enabling Stich Seams but with no luck.
Maybe something is wrong with your normals
Alright, i'll check the normals π
Normals looks fine, for the walls i did not use normals but with just creating one does not solve a thing. Here another picture showing the issue.
Left and middle light are 50% not good while the light on the right has no lighting on the wall at all
Another thing. I just started working on lighting. I did it with 1 directional light only before.
i use URP and turned global illumination on with auto generating. But this takes ages!
Should i generate it manually? What do you use?
And, i let players build their onw buildings, with lamps etc. I geuss its better to use realtime lighting then, right?
Any expert willing to help? β€οΈ
Just ping me π―
Thanks fixed it with changing Rendermode to Important. Is this a good solution?
Oh never mind now another light is not shown
Thanks to ChatGPT, it's probably caused by the Per Object Limit in Additional Light Settings.
not really, you have 2 light sourced there and it seem to be a modular building?
But if its the light limit, i have a tutorial here:
I have 8 lights around the building and yeah its modular π
Thanks!! I'll check it out
I changed the light limit to 8 and now i do see all lights. But what if i need more lights? (what definitily will happen...)
Anyways ill checkout your tut first π
You made my day, @chilly kettle ! Thank you so much!
π€ thatβs what I Wanne say
Deferred is not perfect, because it has its downsides.
If you have static light sources, baking them is the way to go.
Well i make a game where players can build their own buildings, so static wont really work, right?
I appreciate a like and sub on YT πππ»π
Here you go, big boss
Not for this kind of lamps you got there, thatβs correct
Alright π
I am trying to do a night scene inside a house in URP...is there a way to light up my character with a lttle ambience light so I can know where he is? I have thought of implementing a little light in the character...but I don't know if there's more ways to make the character visible
bake lighting and add light probes
you can use URP light layers to have a light that only affects the player
A lot of games also just have the character emit a faint light, but recently AAA games especially have dynamic light rigs that only affect the player and can do stuff like rimlight a character or adjust based on camera angles
Hello guys! I'm having a problem with my point lights. I'm having multiple point lights next to eachother and this dark square appeared. It seems like if I remove the lamp gardens it becomes normal. I've also tried using render mode to important and I've also baked the light. I don't know what to do anymore... If anybody has any idea, it will be much appreciated
- Increase light limit in quality settings, decrease light ranges and limit their use pe rmesh
- Bake them
- Try deferred rendering or forward+ rendering paths
Some options
If baking does not solve it, you have not done it correctly
Baking has drawbacks though, mainly being restricted to static meshes (and light probes for dynamic meshes)
I've increased it to 8 and now looks good. Thank you!
Are point lights that hont babe shadows, volumetrics, contact shadows and etc... performance intensive? Or can i have around 30 of them on screen at the same time for bullet trails?
@cloud drum - Here is a tutorial covering this topic.
In your case likely not
But you can best answer that by profiling it, naturally
Remember that a low light range also helps performance
In HDRP, both in forward and deferred rendering light limits are per screen tile, I believe, 8 pixel and 16 pixel tiles respectively per rendering path
Is there a way to keep the world dark with realtime global ilumination?
I want that the player can only see with his flashlight because i saw that a dark darkness is no more if you make you lights lookbeautifull and everything is bright because the light does bounce now.
did you set the environment lighting to pitch black?
Idk which setting but I guess yes and its still to bright
Can you show the Lighting settings?
What type of realtime global illumination?
Do you have a screenshot to show in what situation this "everything is bright" situation happens
i use directional realtime lights with no baking and i didnt ever see any change from this option
https://i.imgur.com/rUHDPUO.png
Is this only for when you have super high smoothness materials like metals?
i found the problem, the normal texture is not set as as normal texture in texture type
im having a bit of a lighting mystery. We have scenes that are... maybe 5000x1000 units in total size, often smaller than that. They will contain about.... 20-50 lights of which 3 might be mixed directional, 6 might be real time, the rest will be baked. There are no light probes, no skybox reflections though often there is a single reflection probe for some objects. Lightmap resolution 4 bounces 5 ambient occlusion off. Samples reduced, 2048x2048 size Baked Indirect with progressive updates off. Importance off, baked GI on, Realtime GI off. URP/HDRP for shaders.
Sometimes... when baking a scene... it just will NOT start baking. But if you disable a bunch of dynamic objects that will never receive lightmaps anyway, and don't show up in shaded mode, and absolutely do not have lightmaps enabled or static shadows enabled anywhere on them.... then it will bake.
I have raked through hunderds of prefabs making sure they weren't set to emissive or static when they shouldn't, or contribute, or cast static shadows, and everything that should be excluded is excluded. yet still... if they are enabled it will not bake.
so is there some potential issue if you have too many objects enabled in a scene? like or is there some material or mesh setting we might be missing out on? or is this a different problem? Most objects have their scale set to 1 or lower. The lighting is pretty low resolution overall. Most levels only contain 5-7 maps at 2048x2048 even with all kinds of trees and plants and small objects are beign baked. So why is it only sometimes being stubborn?
well... looks like most of the scene was duplicated at some point... so there were tons of models inside other models lol... that wasn't helping
So you fixed it yourself?
Not entirely sure why it was an issue, but its at least working again
fixed would be if I know the exact conditions that caused it "i changed some things and its working" is something though. But if I cant reproduce it... ya know? π
usually when that happens to me its the reflection probe taking a centure to figure itself out
Deleted all of my probes and it still won't finish the job
It gets stuck at that each time you generate?
Iirc "preparing bake" can get stuck if there's too dense geometry included in the bake
Well
I found out it was a door in my scene that had an issue but the rest don't...
and. it's a prefab...
unity I hate you
is this bad?
Yes
All meshes that receive lighting via lightmaps must have lightmap UVs
Note that only meshes that need to be involved in light baking should be marked as lightmap static, so avoid including small or complex meshes
And also that even if a mesh contributes to baked GI, it doesn't have to be lightmapped, but rather can use simple light probes instead to save lightmap space
What does it mean to have lightmap UVs and how do I make them?
For some reason my walls don't exist to the renderer
Not set as "reflection probe static" I assume
Reflection probe static is a type of static flag which makes things appear in reflection probes
all of my assets already got this applied?
The warning you have there is one cause of lightmap UV overlap
i want good lighting in my scene in SRP without using post processing or any other heavy thing because my game targets low end android devices.
how do i achieve that?
when i go far away in scene view my lighting is normal and when i go closer it lessens
heres some pic
from up close
from far away
Baking light and using light probes
The close up looks correct to me.
odd, cause the far away is what its supposed to look like when your close up
Isnβt is dark because your stone on the left is throwing a shadow on the ground?
yes, and i want it to be like that but when you get close it lessens, the far away shadow is how it normaly looked when close up
Ah. Is it realtime, and if yes,
How many realtime lights do you have there?
no, its dynamic, so baked and not
so my light is on mixed
How many lights do you use?
Could be the light limit if you come close like I explain in this video:
This video deals with the common problem of flickering or invisible lights in Unity.
If you also have the problem that your Unity lights flicker or become invisible depending on the viewing angle, this is the video for you.
Fixing the problem of flickering or invisible lights in a few seconds with a few mouse clicks
If you are interested in g...
4, 1 directional as the sun 3 point on a diffrent object for indoor lighting
Normally it should be the other way, if you look from further away, the shadow should be hidden. Thatβs weird ^^
yeah thats what i was thinking, very werid
Im afk for a while, if you donβt fix it I will have a look in an hour
alright
hey its been an hour, still havent been able to fix it
and i dont even have a clue on how to fix it lol
Can you make a video that shows your problem?
yep
Looks like something is wrong with your shadow cascades
yep one sec
something like this
seems a bit diffrent
What you can try is creating a new Render Pipeline Asset, and have a look how it looks with a default one
And insert it into Project Settings > Quality > Renderer
okay so its normal now but not all the shadows are there
so a object in my game is just not baking, it should but i have no idea why it is not. any ideas?
is it static?
does it hand children? (objects in it) if so are they static
no, it does not, it has no children
only other thing i can think of is does t have a renderer? if so is contribute to global illumination on?
it is one of the images i sent
odd, no idea then sorry
Is your Light source set to Baked?
yes, it is only 1 object not baking.
no idea why
which one? The ground?
yes