#archived-lighting
1 messages · Page 4 of 1
Also I'm not sure why and how does this happen for built in primitives that aren't imported and can't have the resolution tweaked
UVs don't contain resolution/scale information since it's all in 0-1 range
You can tweak that one by the "scale in lightmap" setting visible on the mesh renderer component
You can control the parameters for lightmap UV compilation in the lightmap settings, namely the margins and resolution
Thanks! I've tried chaging that scale and looks like the baked light maps are choosen at random, with as many objects as possible
I don't know if it's possible to manually edit the compiled lightmap UVs, but ideally you don't have to
That's good to know, unity GI looks good and is easy to use and tweak but I was confused bc blender has a mode for lightmap unwrap and I was wondering why can unity use it to be precise
You can manually unwrap lightmap UVs per mesh instead of letting Unity generate them (though those maps will still be compiled automatically)
But I'd say Blender's "lightmap unwrap" is worse than useless
Ok, now I see what's going on after playing with the paremeters, the lightmap resolution is what is always preserved, while the lightmap size is like a "target", if eveything fits in one 1024 map, everything goes there, if you need a little more space, another lightmap with the minumun necessary resolution is created.
Turns out my imported fbx mesh fell into that last "slot" with different resolution, nothing to do with different import settings
Yes, the lightmap layout process makes its own decisions so it may be a bit hard to understand but that's the gist of it
Remember to check if "generate lightmap UVs" is enabled in mesh import settings to know if Unity is working with what's there or creating them anew
having a problem with the shadows where they just do not line up on my models and make them look terrible
Seem like a face orientation problem. Make sure all outside faces are front faces
Your mesh uses sharp normals in some places which shadow casters absolutely do not vibe with, creating holes in the shadowing
Could be more problems besides that, though face orientation looks okay to me
Does anyone know why every time I bake the lighting these show up in this corner?
What is "these" in this case?
The lines on the wall
If you mean specifically the faint diagonal lines, to me it looks like there's a lightmap UV seam running across there for some reason, which bleeds over a bit due to padding and/or compression
The automated lightmap generation normally never splits continuous faces like that
But I would guess that generation isn't being used here
You are correct but I'm using no compression and a high padding
So, why is there a lightmap UV seam running across there? Doesn't seem necessary
So, that's probuilder generating its own subpar lightmap UVs
It's intended for prototyping so it doesn't go all in on that kind of quality
If the level is exported as a mesh I expect you'll be able to use unity's usual lightmap UV generation for it
So if I export the probuilder mesh within unity and use it as a mesh instead it should work?
I'll try this in a bit thank you.
You have to also make sure automatic lightmap UV generation is enabled in mesh import settings once it's an ordinary mesh
I've never used probuilder so I'm not sure if it normally allows you to tweak mesh import settings without exporting it out in some way first
Alright thanks anyways!
In my humble experience, ProBuilder is really good for fast prototyping of levels and such, but it's not good once you harden your assets, and most of the time it's for reasons you're stating @deft fiber - it doesn't allow you precise control of things.
However, this could be my lack of experience on ProBuilder. And since I build my own assets from scratch in Blender/Max, I just never bothered to learn
@deft fiber it was because an overlapping face
Hey guys, I would've googled this but I'm not quite sure how to word it
when I have a scene like this, and I want to use reflection probes, how do I handle awkward fading like this where it begins reflecting the skybox awkwardly? do i just need to litter my scene with baked reflection probes or is there a better way?
or would this actually just be resolved by building the scenes lighting
i'd do that but it takes like 30 minutes to regenerate and i'd need to do that every time I make a small change
What do you mean by awkward fading?
You can bake reflection probes separately from other lighting
If you use baked lighting it's usually best to use GPU baking and bake with low resolution before the final bake
yeah that is what I do
i guess i need to bake the lighting at least once
this is a relatively large scene so even with the 3090 and gpu baking it still takes like half an hour
these are my settings
there are a lot of static objects in the scene because the asset im using is modular
im gonna try the lightmap parameters set to very low and see if its more bearable
oh i think im seeing part of the issue
it keeps restarting
i think?
nevermind its just only showing the progress for each individual lightmap
oh i think i see the problem
i reduced the max lightmap size but all that meant was that it was trying to fit the same resolution lighting data into more, smaller lightmaps
the ETA is always so inaccurate
it still takes forever to bake all this data
10 resolution is much better for a temp bake than 40
You can also to halving the three sample values
right
Even if an object is static, you might not want it to be lightmapped if it's small or has a high polygon density; for example crates, barrels and non-emissive signs
thats probably the case
theres a tonne of those in this scene
though
what do I do about modular walls that are quite small
but do make up entire large walls
like these segments are small
I don't think the size alone is a problem, but small size usually correlates with high polygon density
ah yeah dont worry i think these are fine
these walls have LODs for 90 tris up close, and 2 at a decent distance
ideally from furthest away you could reduce the entire wall to very few tris
but thats not practical for a project like this being done by someone like me who is incredibly unskilled with blender
I think LODs also increase baking time since each LOD would have to be lightmapped separately
But I'd have to verify that
that might explain it
the 3090 ti should be fairly beefy
oh there we go
it finished
honestly the scene does not look very different
With small objects you can allow them to contribute global illumination but use light probes instead of lightmapping to cut the cost
Or not have them contribute at all
thats something ill go and do
it still hasnt fixed the issue with like
all the very shiny and wet floors are reflecting the skybox
which looks very wrong
somethign the reflection probes make incredibly obvious
Decorative geometry like wall panels and edges of sidewalks are kind of bad for the lightmap workflow, compared to simple flat surfaces since you need so little calculations and data to represent them
oh ive got screen space reflections in the project thats why you can se the somewhat-accurate-seeming reflection of that hexagon pattern
which might actually mitigate the need for reflection probes at all???
i do want to retain the option to turn it off since its fairly expensive
yeah its just more of a personal limitation
on what I'm capable of by myself
Usually you'd want to use decorative geometry that looks okay even with just light probes, and which can be LOD faded/culled without breaking the surface
im not sure i fully understand sorry
hang on i need to clear my definition of light probes
You want details to be non-critical for any lightmapping
ive been inferring based on context so i dont have a concrete understanding
Reflection probes store reflection data, light probes store ambient light
oh i think i see what you mean
what are light probes then, are they like per-object maps of the baked light data?
Ideally also you want the decorations to be non-critical to the silhouette of the structure, so you can cull them over distance without making a hole
per-point maps of baked light data, applied to nearby objects
https://docs.unity3d.com/Manual/LightProbes.html
sorry im back
this asset pack seems to do this well
structures are prefabs and have lods and everything all good
but imma keep this for other scenes I may work on
About this
Reflection probes are usually necessary for SSR to look right
Since SSR can't reflect anything not drawn on screen, in that case it falls back to reflection probe's cubemap
If there's none it'll show a solid color instead
what can one do about this btw
I don't see what's "wrong" about the image
its just that theres a very clear point where the reflection probe fades
and it start reflecting only the skybox
which is especially terrible indoors
and like
if the solution is to carefully place reflection probes everywhere
thats fine
Ah, the dark square there?
i just wanna know if thats okay
yeah lmao sorry i didnt say that when I sent it
Yes, you'll likely need to use more reflection probes than just one
But I wouldn't bother trying to place them everywhere
another problem is kinda how innacurately things line up with reflection probes but I suppose in this case the thing I need to do is bring the reflection probe to a better spot
how do I deal with the distracting fades then
just like crop the boxes?
that would be a lot easier if the editor UI for adjusting the boxes didnt stop showing up 😬
and the canvas frame too
Use a smoother blend distance, use as large as possible reflection probes
If you have a lot of them in small spaces, you'll have many seams between them
i see
so for example
in this case I have a lot of objects to the left of this very shiny object
what do I do about the objects to the right
You can hide canvas from scene view using the eye icon in hierarchy to avoid selecting it, if that's what you mean
do I just put the refelction probe in the middle?
nah the frame for the canvas disappeared
the elements are still visible
oh unles its only the canvas thats hidden right now
oh well
i have 3 canvases
i dont know for sure if thats what you're meant to do but I thought I read somewhere that it was what you were meant to do
yeah it definitely just stopped showing up
I'd start with one probe per street, or less if multiple strees have a similar lighting
Perhaps a higher importance probes for the alleys between streets
woah really?
but wont lightr sources like not align at all
is box projection not meant to be ticked or something
or am I seriously overestimating the importance of lights alligning
I mean when not using box projection
If you do use it, then the probe bounds need to match the walls of the area
But in an open outdoors place like this that seems entirely unpractical
ah okay
one more question
for now
thers supposed to be a box within the area the probe includes right
or at least when you press either of these two buttons
because im not seeing a box appear
and it would make editing the box size monumentally easier
The boxes may be hidden due to visibility toggle in hierarchy, or because of gizmo visibility settings or probably for other reasons too, hard to guess
The inspector shows what the bounds should be as values to give you an idea where they're supposed to be
oh wtf it was off in the gizmos
my bad
i was sure id toggled everything on
stuff like these totally detatched red light reflections are definitely kinda odd tho
cos box projection is definitely making that light line up with the billboard that its reflecting slightly more believably
but it also does mean i gotta make tyhe reflection probe area smaller so it doesnt appear in places the billboard wouldnt be visible from
Yes, that's the big advantage of box projection
But then you have much more seams to deal with
is it alright to be picking and choosing when to use either in certain areas
You would place the center of the probe in a place that doesn't have extremely distinct light sources, if it's meant to be used in many places
Yes
ah so just generally try to fudge it
You already have SSR for handling the direct reflections though
Consider that even triple-A games don't bother getting this part perfectly right
As long as the lighting looks right enough for the area, players won't care that they don't match the light sources
yeah it seems to be fine as long as i'm careful with calculations
the one on the left is box projection enabled
the fade distance is only 2
should it be higher
hmmmmmmm that being said its still pretty clear when the reflections begin actually lining up with the objects theyre coming from even at this distanbce
Which is why I recommend big probes without box projection and without really bright lights on the cubemap
The more vague they are the more forgiving they a re
yeah
unfortunately bright lights is kinda of the aesthetic
lmfao
so its kind of a tough situation
now I know how the cyberpunk 2077 devs felt
ignoring the time crunch and also literally every other thing they had to get done in the 3 minutes they had to produce that game
You can cheat by having the brightest lights disabled when baking the probes and then enable them back on
The player will see the lights in the scene as well as their SSR reflections and it'll look okay
oh true
man that is really frustrating though
having to manually disable things when you are baking whatever
The main thing the probes are responsible for is to occlude the sky in the streets and alleys
atm its looking like im gonna need to create blocks to build the navmesh for my game
Or mark them not reflection probe static
true
Reflection probes can be used for realistic and accurate reflections only in the most ideal situations
Which is namely box-shaped rooms that can match the box projection perfectly
another question actually, if I have a reflection probe within another, and that reflection probe is marked as more important, will it properly fade between the two at the edges of the overlapping area
So I would presume
okay so i should just save box projection and stuff like that for ideal situations
That's what I'd recommend
At least they had a hard time limit to get it done
You need to stop trying to make things perfect we'll be still mulling over this stuff in a year's time
Could work
i guess its trial and error
i guess so, im just trying to make sure im learning how to do things properly
since im only just getting started and this is my own personal thing i figure its better to take my time and learn the right way to do things
"only just getting started" being 3 and a half years in but regardless
i don't know if this is the right place to ask this as a beginner, but when i get too close to a wall, the flashlight's light makes a line, how can i fix this?
the line is always there but it doesn't show up if i don't get close to a wall
like this
Im beggin for help... I hate lighting in unity. What can I do to fix this shit. The funny thing is that when I move camera in the different direction shadows are kinda working...
the map is connected perfectly and there are no gaps between the walls
this is directional light from the outside
but this is not the only one problem I have.
those are shadows from point light
First: Use Shadow caster Geometry
Second: Shadow Bias of your Lightsource
to the first, how to use caster geometry?
what is that btw
and where
Geometry that avoid light from hitting your 90° edges there
its typical problem and can be solved easily by using additional geometry that blocks the light there
hmm. so there is no other way to fix this?
well... still not sure what can I do.
Go into Blender, import your model and build a cage outside of it that blocks the light from outside ^^
Or do it with probuilder in unity
if anybody have any other ideas please answer :((
Shadowcasters are the way to go
Bias values of 0 are extreme and likely to cause issues as explained here
https://docs.unity3d.com/Manual/ShadowPerformance.html
The default values are something like bias 0.05 and normal bias 0.4
it's even worse
well... no matter how i set this it's not working
Well yes, this is what you need shadow casters for, as mentioned
Extreme bias values can make it seem like it fixes that issue, but it doesn't and causes more issues in turn
yeah i see
I know how individual values work, but for years I have not been able to deal with this problem.
I tried lot of solutions and didn't find the right one...
What do you mean not the right one?
I mean that for example someone sugested to put some walls behind but you know doing this isn't the best option.
I'm afraid it might be
trust me it's not...
What's a better one?
idk maybe writing my own rendering engine XD
but how....
we all know unity sucks
at lighting
I don't want to play around with "fixing" sunlight as then complications will come out of it as I want to create a scene with an open environment. just as I do now.
point lights are even worse...
shadows are not casting from actual object.
none of those funny values can solve that problem
The reason this happens is because when the light renders objects again for shadow casting it shrinks its geometry, so that the shadows don't poke through the surface, which consequently means seams at edges where vertices are disconnect or have sharp/split normals
Which means you can also
- Use smooth-shading for all corners
- Have another variant of the mesh that's smooth-shaded which you use as shadows only, whereas the visual mesh casts no shadow
Extra shadow caster meshes are likely the best solution out of these three
You could automate solution #2 pretty trivially if you have the know-how
Not sure why it isn't already an option
yeah
Does this look decent if not any tips u guys can give
Looks cool but in my opinion there is too much bloom
Will change then thx
hi i have a problem with 2d light... the light go through the player
how to fix that...
i want the light to affect the player but when the player is over it, it should not go through the player
Remove the player's layer from Target Sorting Layers
lighting goes a really long way if u do color theory 🙂
but then he is not affected by light at all
not entirely sure how to do some of those but will try
last i checked, lights arn't supposed to work like this
shadows in unity:
there is NO WAY TO FIX IT
and YES i tried to play with those bias/normalbias/nearplane options, it's getting worse and worse
quality settings are the highest.
shadow res HIGHEST
well... im 101% sure there is a solution to this but noone on this server won't tell me ;))
and I don't mean additional geometry or another fckng sht
idk what i want new screenspaceshadowsshader if needed
whatever what, some experts please help
with this shadows I CAN'T RELEASE MY GAME
I tested EVERY SINGE SETTING in quality/light etc
every singe one of them are not working correctly
so where is the solution
I believe you know what the solutions are
Leave bias values as defaults and either add shadow geometry or use merged normals
Projects never really "just work out" without having to resort to workarounds in some way or another
sadly but another geometry increases performance cost
and I tried to make it
but it's working even worse or the same
any other ideas?
That doesn't sound right
You shouldn't be getting more light leaking by piling stuff in the way of the light
Shouldn't be too bad if you use a Unity cube and make it a prefab. (Remove the collider and set Cast Shadows to "Shadows Only")
Geometry is cheap
The only option I didn't remember to bring up is a shader that renders smooth shaded geometry with flat normals, so it appears as smooth for shadow casters but not the camera
But that one is probably not worth the trouble over simple shadow caster geometry
Yes, I use one prefab and copy it over and over (while adjusting its size when needed)
Does anyone have any idea why those tiny lines of light appear? They go away when I get closer to them. I use a mixed light to lighten that area. Unity 2021 and URP.
the answer is UNITY
I feel your frustration.
good
ok.
Right. Have you tried creating a test scene and isolating the problem?
yeah many times man
ok ok
the same problem with shadows on fricking default cube and plane
Right, and just to be clear. You haven't tried creating a shadowcaster yet?
maybe i tried or maybe not. i tried many things
ok
I don't recognize the issue, but if it's by distance, that suggests probably something to do with shadow distance or mip mapping, maybe mip mapping of normal maps if you're using those
Can you PLEASE open a thread?
Right. Yes, by distance. I will look into that. Yes, I am using normal maps. Thanks!
I've never seen that happen but it sounds possible that the normal maps contain invalid data outside the UV islands, and mip mapping makes them bleed over at edges
I tried without the normalmap on the floor asset (also with generate mip maps off) but it didn't make any difference. I'll see if shadow distance affects it.
Oh wow. Ok, I removed the emission map and that made the "error" go away. Hmm. Maybe my white emission UV island is too close to the floor one.
Thanks man!
Encountered a weird bug (or rendering quirk?) with using realtime reflection probes and an HDRI sky. This room is supposed to be pitch black, but a realtime probe samples the skybox across all surfaces, making the room overly bright, while a baked probe renders it correctly
I can tell its not a shadowmap problem cause I can disable it in the custom frame settings and you'll see the direcitonal light affecting the room now
none of the custom frame settings let me toggle off the skybox lighting it up like this though
disabling the volume does return it to being black so I know for sure HDRI is affecting this
Well found!
Actually, I solved it by giving my UV island-- for the geometry that emits light -- a bigger margin.
That is interesting though, as I actually still see that type of super thin light flickering sometimes in assets. Making a VR game if that makes any difference.
hey! I am having tons of trouble today buthow do I make this area light larger 🤦🤦🤦
Range is one value, but I go crazy on the intensity for point lights compared to directional lights.
(and area and spot lights)
Size X and Y
noo i came here so i wouldnt bug you more xd but my intensity is max
No, you can edit the numeric field and make it bigger. The slider is at its limit. You can also change the units.
that increases the size like I want however it doesnt brighten it in fact I would say it darkens it
huhhhh lol
right, you probably have to balance it with intensity and range
I dont know how to do that im so sorry
I keep adding zeros to the end until its about right, then start fiddling the leading digits. (Yes, I am a hacker! lol!)
Just under the slider is a numeric field with drop down for units - I add zeros to the numeric field until it looks good
A tip, when testing, really exaggerate values. then later make finer adjustments
ahh can you show me which one is the numeric field lol i am so dumb xd
i feel so bad making you show me everything a-z
Are you using HDRP?
got it thanks
that worked amazingly I cannot thank you enough I promise this is my last one
One of the drop down values next to it (EV 200?) shrinks the numbers to more like 20 to 30, which might be easier to fiddle with. Not at computer to remember the value
yeah but i thought this channel may work better
For sure, just wondering. Because in URP you can't use realtime area lights
yeah that seemed to do the trick
thanks for making sure i didnt know that
and by the way, has anyone realized that the Normal Bias option in spot lights does not work?
no difference when manipulating this slider
point lights are so f*ckd up.
this is when i leave them on default
and this is what i want
but
im using negative bias values
by my own script
and this creates a problem
Why's that?
see the difference in the shadows?
that's what i want to achieve(idk the spelling)
this is the minimum of the minimum what I want exactly
Use the bias values only as recommended
Don't try to bruteforce this light leak problem with bias values, it's not the solution
Spot light normal bias value seems to function just the same as for any other light, so it's not universally broken anyhow
um I think it doesn't work.
no changes when manipulating values
in directional light of course it's working
but in point lights it's not
u know what am I talking about or not...
haha so yeah I checked one more thing.
in directional light: working - bias and normal bias
not working - near plane offset XD
in point light: working - bias, near plance offset
not working - normal bias XD
working I mean when you change those settings the changes are visible somehow
https://www.youtube.com/watch?v=nYIbDAW950s the first 5 seconds of this video show exactly what I am looking for is if anyone knows how about I could make that almost no shadows effect? Thanks! (I use hdrp so some stuff wont work... I think)
➤FREE DOWNLOAD - https://danidev.itch.io/karlson
➤WISHLIST ON STEAM - https://store.steampowered.com/app/1228610/Karlson
➤ whack MERCH - https://represent.com/store/dani
➤Evan King - https://youtu.be/TBD2nKx7gI4
➤TUTORIAL Channel - https://www.youtube.com/channel/UCn7E5qFz-BML6o7XnjtlytA
➤JOIN our DISCORD - https://discord.gg/dani
➤Reddit - ht...
@deft fiber i saw you mentioned in the thread above that the shadowcasters should be smooth shaded. Do you know if the box mesh in Unity is smooth shaded? Or how to achieve that.
That's quite easy to achieve in HDRP as the lighting in the room of that video is very basic. It looks like it's just ambient lighting with ambient occlusion post processing.
So in HDRP, add a Volume > Global Volume gameObject. On the Volume component add in 4 overrides; Ambient occlusion, Exposure, Visual environment, and Gradient sky.
Disable your directional light. On the Visual environment, enable Sky Type and select Gradient sky from the drop-down. On the exposure settings, set the mode to 'fixed' and then play with the Exposure slider, maybe around 2.0.
That should start to look a bit like what you want, but you will need to experiment with the various options.
Ah, create a new profile first.
ahhh thanks
I think my lighting is reverse? the lower the exposure the brighter it is?
Yeah, I might have a different setup on my project, but you just need to adjust the exposure until it looks right. Or, if the exposure override makes it worse, just disable/remove it.
okay, its just weird that when it shows a moon icon its brighter and the sun is darkest
The exposure setting tries to mimic how a camera works. In low light levels the exposure (how long the shutter is open for) is increased so more light can get in and brighten the image, ideal for night-time scenes or dark rooms.
ohhh got it
would there be a way for the textures to show without blinding me lol
this is what it looks like without global volume
also if its too much of a bother to fix I could just remove hdrp and put 2 directional lights
So I've had this grudge with directional lighting for a while and can't figure for the life of me how to have both directional lighting whilst having completely dark areas without having this weird specular reflection:
How do I fix it?
It looks like in the video he has a light radiating from the player in all directions, or at least facing the players look direction
evident when he looks at the glass and its reflecting light from exactly where the player is
There are some default volume settings when you create an hdrp game and are carried over to all scenes.
The overrides allow you change those settings when you need to.
So in your situation you likely have Bloom enabled in the default settings, so add a bloom override toy volume and lower the bloom intensity.
thanks very much but it turned out that it was just me being dumb when hdrp wasnt on the project and turned the emission to 10k
That would do it too 😁
How can I smoth out these sharp lighing errors
Hey, can anyone tell me why I'm randomly getting some lights in my scene that I can't delete or change or anything?
When I press them, they do not exist in the heirachy yet they affect my scene
It's not
If you can somehow get to the cube's import settings, you could set the normals to be recalculated as smooth
However that only works with geometry that shares vertices, not if the faces are entirely separate /unwelded
Also, Unity hides its built-in assets so well you might not be able to access it
It's probably easier to just set the Blender's default cube to smooth shaded and export that
Right. Damn, I wish I learned this sooner 😅 I'll probably make a cube in blender and export that then. Is the smooth shading a performance optimization?
It can be, since split normals will require the renderer to render a new vertex for each split normal
In lighting the significance is that split normals are seen by the shadow caster as gaps in the mesh
My understanding is that it shrinks each connected surface (which is what "bias" is about), but since the vertices aren't connected, they get pulled apart
Maybe I've gone about the shadowcaster thing all wrong. I've used individual elements and placed them along walls as pictured (with "Cast Shadows" off here, so you actually see them). Not sure if this is the way though. Hard to find info on how to use shadowcasters.
Not wrong, but not as effective as they could be I think
The more they overlap, the tighter the sealing is
Also, the more sharp corners you have near each other, the likelier it is that the light will find a gap through all of them
If that setup works without issue, I probably wouldn't worry about changing it
Right, I understand. In most cases they do overlap and it seems to do the trick. I'll just make sure to not have sharp corners near each other as you say, kind of looses the point of using them in the first place. Thanks!
How do i fix this light bleeding?
With shadowcasters 🙂
Shadow caster geometry are one solution
i "solved" it with editing the lights bias etc, but then it adds artefacts in other places
one step forward, one step back
Though first it's important to diagnose what the exact cause is
my experience with Lighting is nearly negative, i constantly have problems with this type of thing and never learn it, because frankly, it's quite tragic
the whole system
Why is it so jagged, its 4096 resolution 😅
@shadow horizon There's generally two kinds of realtime shadow problems
https://docs.unity3d.com/Manual/ShadowPerformance.html The ones listed here, fixed by balancing bias values
And the second type which is where light passes through corners of sharp geometry
That type seems to be fixed by bias values, but you can't ever tune them enough for it to work without other problems
This might be solved just by rotating your light around its forward axis, if not then it's something tricky
reducing the "outer spot angle" produces very little jagged ness
at the expense of smoothing out the insensity across the light projection 🥹
Spot light quality suffers exponentially the higher you set the angle, just like a rendered image distorts with high FoVs
this is the best i can get it
Could it be because the object im trying to cast a light on... is 100 scale
would changing the scale factor of it fix that
as far as i understood "Mixed" light means it acts as a baked light for rendering lightmaps for static objects but also as a realtime light for dynamic objects
but putting it as mixed doesnt seem to affect any dynamic object if i change the intensivity
Do light layers exist in Unity 2021.3.0f1 and URP (Version 12.1.6)? https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@12.0/manual/lighting/light-layers.html#enable "Light Layers" does not show up when I press "Show Additional Properties". Thanks
Basically I want a particular light to only affect some of the geometry in the scene.
iirc that option should've been there since 2021.1. or .2.
No idea when introduced, but you have to turn them on in the project settings I think for them to appear elsewhere.
I see. Thanks
is there still a light limit as in how many lights u can have on in a scene?
In URP there is a light limit per Object
What is the optimal lightmap size for android game?
Is 3 lightmaps of size 2048x2048 good for a scene in android game?
I want to have multiple objects with their own assigned light sources, and only have them be affected by their assigned light sources. How would I go about this?
Nevermind I think I need to use layers
Can anyone explain why I'm getting these SceneLights?
I can't disable them or anything
I can delete them by removing the 'light' component but then my scene view goes all white. If I then reload the scene view panel, it regenerates these lights again!
Is it possible they're from the unloaded scenes?
They are not
They seem to be present in every scene
And they actually are affecting the lighting lol
I get specular off my material from it
Here I've created a completely empty scene and unloaded all the other scenes
I just can't seem to get rid of them at all
They also seem to be untouchable and act like they're checked out lol
We are using Unity 2021.3.12f1
It's related to some part of HDRP, probably the volume framework and how it needs to use lights to allow the sky to cast realtime ambient light
I think there's only meant to be one set of three, so there being two sets of three might be an editor glitch
Try to catch a moment when Remy is active in the HDRP channel, they usually have answers to all these mysteries right away ^^
love how light probes dont work with progressive cpu
Can't find any issue with it
Might be helpful to share which editor version and render pipeline you're using
I seem to be having some trouble with my fill lighting in my scene. These white "cracks" seem to appear on the ground of my scene here, built out of cubes with some of them overlapping. Is there a reason to why this happens and is there a fix? When I turn off the Fill Light the cracks do not appear. The cracks change location/direction upon moving the camera
Hey, how can I make lightning like this guys here https://youtu.be/nmtBq4Z9sD4?t=246
I tried to make spotlight too but I dont see the "Spot Angle" lighted out like in the Video at 4.06
Is it just dust particel system or how can I make this happen ?
Play No-Snake Hotel: https://two-star-games.itch.io/no-snake-hotel
Watch Barjis video: https://youtu.be/8y2pXdXcZyA
Wishlist Choo-Choo Charles on Steam: https://store.steampowered.com/app/1766740/ChooChoo_Charles/
WHO WON THE CHALLENGE? https://youtu.be/g4SgRr6nA5Q
------------------------------------------------------------------------------...
like this here
Is it a bloom effect?
And How is it possible to get the Lightning around the lights on the Roof?
I know the light is a Spotlight But How does he get the light Circle on the top of the light and How can i get the rays of the light Like he does ?
URP, 2021.3.0f1 (not updated though), and yourself?
Its possible he has a light model with emissive texture for the light part, then putting the spotlight right below it
not sure what you mean by this, like how he made it wide?
This was just to Show What i mean with the Rays of the light
So he uses emissive Texture to get the Rays of the light ? Or to get this circle around the light ?
This it the circle on top around the light I mean. Does he use another light Object to get this?
No its not bloom alone, there is clearly bloom pp effect enabled but in addition to that you need to get some sort of volumetric lighting system or just fake it in some way like having this type of cone shape and making/getting a shader that draws the mesh in a way it looks like that
He has the lamp model with emissive texture to make it look like its turned on
it doesnt create the light rays itself
three elements to it, the spot light to cast the lighting, the lightbulb model with emissive, and volumetric lighting
from what I've gained so far working with unity, it definitely doesnt like overlapping elements, especially if you use it with lightmapping
Thank you very much!! That was what i was looking for. Also thx to @silver grove for Helping.
What do you think he uses for this Circle around the Model of the light? Another light object, if so, wich One would it be ? PointLight? Or is it schader thing again?
you can do that by making a white emissive texture and assigning it to a round shaped model like that
Id say point light, maybe combined with light cookies
URP also, 2021.3.11f1
You should get the bugfix updates unless you have a good reason not to
I don't recall this being a common issue on any version, however
Progressive CPU is usually the most reliable way to bake
I'll try updating and see what happens
cheers
I think unity just doesnt handle planes very well, making my meshes not as tiles seems to fix many lighting issues
Planes are fine, but having a lot of separate geometry or lightmap UV seams is really difficult for baked lightmapping
just normal looking point light shadow right?
nah fck u btch LOOK CLOSER. and there is NO WAY to fix it
quality settings are the best resolution and every fckn sht
Did you adjust the Bias settings of the light?
im quite sure i have read a way to get rid of this a while ago. let me look
What size does your building have there?
in unity units?
ok
Ok what i found what can help is increase the cascade count of shadows or the shadow resolution if you didnt try this
looks okay as well
Thread
Does anyone know where exactly in the cgincs the lighting from the lightmap is mixed into the gbuffer in deferred with baked lighting? It seems the baked lighting is premixed into the gbuffer's albedo by the time the deferred shader can do anything
(I'm trying to do texel lighting with the lightmaps)
This happens to my scene when i load it. Is there a way to light every face of the 3D objects?
I can't find anything working besides the directional light.
Does anyone know how to tweak or comment out mydist parameter in UnityShadowLibrary.cginc built-in shader?????
i found something that can be a good solution for weird point light shadows
but im not exactly sure what to do and where
this is the possible result
Generate lighting for each scene
not entirely sure where to put this but when I make my own procedural skybox to customise the colour over time it goes orange even though the atmosphere tint is white, anyone know why this happens?
@crisp rapids have you tried turning down exposure?
left shadow: point light
right shadow: directional light
Directional is just fine I don't want anything more from that. But it's not the best.
Point light is close enough to be fine but it's not really unity's job but mine. I made script for that. Of course I won't let it be as it is because it's not the proper solution. But if someone can help me get similar result without writing any new code and hacking nasa's systems I'll be really grateful.
well... this is without the script
that just makes it less bright, doesnt change the colour
either that or, you mess with the atmosphere thickness
the exposure thing is for when you have it as dark as possible, itll have this red glow to it which is fixed by turning off exposure
ok
its weird how this is happening since the default skybox works fine but this one doesnt?
wait i only seem to have half the settings im meant to have
fixed it, i seemed to have 2 shaders with the same name, the second one overwriting the default one, deleting that one fixed it
whats the light limit
What do you find when you google "unity light limit"?
Hey, I'm using 2019.3.11f1 and everytime I go to click 'generate lighting' it gets stuck on 'Create Geometry 0/11 1 Task' and will not budge, I've left it for an hour at this point and tried a lot of configs on the lighting tab. So stuck
2019.4.31f1* version number
nothing in the console, just nothing happens
Clearing the baked lightmap cache entirely before baking again solves most of these nondescript problems
tried that multiple times
@amber arrow Just to make sure, you are trying to use baked lightmapping, not just generating lighting to save environmental lighting?
um...not quite sure what the difference is, it is for a VRChat world.
I'm a total novice
I guess baked for GI and dynamic for shadows
Baked lightmapping means using a raycasting process to produce lightmaps that represent bounce lighting
Generating lighting can include that, but doesn't necessarily have to, in case all that's necessary is to generate ambient and reflection probes from the environmental lighting
I assume baked bounce lighting is what you want though
yes
What I'd do in that situation is try to make a super simple test scene for light baking to see if it works there
Static geometry with too high polycount can cause the baker to hang up
If 2019 has the option for progressive GPU lightmapper, try that instead of CPU or vice versa
that was using the GPU lightmapper, have a 2070super. Ended up grabbing Bakery as many people have recommended it and baking fine, just need to figure out dynamic shadows with it.
Usually if CPU baking works but GPU baking fails, usually means the editor has failed to access the GPU properly
Every time that's happened for me it's worked to restart the editor and make sure the GPU drivers are up to date
Dynamic shadows together with baked lighting are used via "shadowmask" and mixed lights
Don't know what the Bakery equivalent is
anyone know whats causing this botched lightmapping?
the right side especially, its not as close as the left side yet reflects indirect light like its close
I expect you would need to increase min and max bounces
damn not enough bounces can cause that?
The light rays bounce from the far wall to the side walls, but will have to bounce again to reach the far wall again, so the limit may be terminating them prematurely
makes sense, Ill give that a try thanks
anyone know how to fix this problem? In game (after I clear cache) the lighting looks completely fine but as soon as I press play I guess something disables??? not exactly sure what's wrong here
Does anyone know why it seems as if parts of my model are lit from the outside instead of the inside?
its especially weird considering the mesh normals seem to be oriented the right way (its one sided and shows no face on the outside)
yeah so... outside faces dont block lights @lament barn
you can try double sided shadows
although you will run into shadow seems
I don't need them to block lights, im only lighting from the inside
the problem is that the room is not being lit from the inside
oh right
are the walls and floors static?
also depends what the lighting setup is
the walls and floors are all part of one big mesh
ah yep... okay so that may be a problem
I've tried combined meshes and that completely fucks up the lighting
probably something similar there?
might want to try making the pieces modular as walls and floors
probably will get better results
I did just fix the problem by recalculating the inside normals on every room actually
oh awesome
however im still curious as to why that would fix the issue at all, considering they were already oriented correctly
otherwise you couldn't even see the room
I actually started by doing that but I got terrible lighting results using that method
every seam would visibly show up
yeah... not too modular to the point where you have multiple pieces for one side of a wall
even if I scaled them to snap to the absolute grid in Unity
can I see the after?
baking :p
fug aight
looks 'aight
wow
its fucking beautiful
Im gonna try making rooms out of one giant mesh now lol
Ive been putting it off because Im not sure if the effort is worth the risk of it going awol
I mean I wouldn't do it for anything non-low poly tbh
texturing can become a mess doing it that way
luckily in low poly i can just use flat colouring
so I can get away with this amazing uv map lol
Try generating lighting from lighting window (no need for "baked lightmapping"), check if it persists
Then restart editor, check if it persists
Then check if it persists in build
aight its baking rn, I'll let you know if it works
@deft fiber it just looks like this now
So, shadows no longer turn black?
what did you do?
thank you 🙏
I hit the generate lighting button before and for some reason it just eliminated the shadows
so I just clicked chose the lighting data asset that looked the best to me in "Baked Lightmaps" in the lighting window
and that seemed to fix the problem
@rapid crow Helps to be specific about what kind of lighting (baked, precomputed, realtime, whatnot) you intend to use, so I don't have to guess
oh sorry, yeah I'll definitely do that next time
I'm extremely new to lighting
@lament barn my room already looks 100%+ less buggy as a full mesh, thanks for the inspiration lol

That image! What is it? Halloween? ... oh, hang on....
So another "help light is bleeding through" issue
The meshes are generated with pro builder
The hallway mesh and the room mesh are two seperate objects
The light is confirmed to be 100% inside the hallway and I've confirmed that it's the closest light source to capsul that's causing the issue. Two-sided shadows have been enabled for the meshes.
Also this issue only appears in Play mode, when in Editor mode the lighting behaves as expected
Any idea what could be the cause?
As I found out yesterday (you can scroll up) making the rooms as entire meshes would make it much easier for the lighting in unity to be accurate
I too had massive issues with choppy lighting or leaking lights when using probuilder
that being said, full meshes can have leak issues as well, just make sure there are no split edges
Unfortunately that's not actually practical as doing so will get you wrecked by the 6 max light sources per object limit
is 6 max light sources baked or realtime as well?
Only realtime
if you're able to find a resolution to getting accurate lighting results with probuilder, I have a vested interest
otherwise I just found it much easier to use mesh rooms and design around the light limit
Sure, though in this case I have assume it's something silly, since the lighting DOES actually work correctly in edit mode
this is scene and camera view. Looks a bit different. Why are there no shadows on the cam view?
is the light coming from where the camera is?
yes
it may be a case of perspective, does it show if you move the camera to the right, away from the light?
the light is under the cam if you know what i mean it always moves with the cam
then its probably doing it correctly
your camera will not see the shadow its casting
why?
because perspective
What do you mean can you explain it?
if your eyes shot out rays of light, you will never see shadows in your entire life
ah i see
Does anybody have ANY idea of why this looks like this?
i`ve been follingaround
with every single possible setting i can think of
and nothing works
to fix this
idk what to do anymore
anyobjet i add to the scene has hard shadows like this
i turned off every single light on the scene
yet this still remains
and idk why
it looks like i mixed two separate objets, but this is basically the inside of a cube, it shoudln`t look like this, all the shadows are messed up
Screen space ambient occlusion
alright
Depends on your render pipeline
urp
It's defined in the renderer asset
ok
ok
found it
and trying to change things within this, doesn`t solve this
i am
stumped
I assume you ruled out it being from the baked lightmap, but if you didn't it could also be baked ambient occlusion
It looks like baked GI and "auto generate" are on, but there's reported to be no lightmaps so I'm not certain what's going on
Perhaps you're attempting to bake lighting on non-static meshes
Could also be that you have several renderer assets and you aren't changing the right one
I do have several
I guess i need to look into every asset to figure out the correct one
URP assets define quality settings for rendering, each of them refers to a renderer asset to choose rendering path and to implement renderer features such as SSAO
Thank you
I has no idea
Anyone have any idea why my baked Lightmap UV charts look like this? I would assume one color per chart (UV Island/shell)
looks beautiful though
Hey, any recomendations to make it look good?
this engine is very strange sometimes
does anyone know the reasoning behind why bloom PPEs affect every object in the scene?
That's how it fundamentally works
It processes the rendered image in post
Bloom in particular has a "threshold" value which ignores pixels below certain brightness value
and bloom is achieved through HDR right? so wouldn't giving an object a material with a color mode prop set to default make it ignore the bloom?
or am I misunderstanding something
Hdr just allows brighter color values. Bloom affects everything except pixels below the threshold brightness
gotcha. How can I manipulate the brightness for individual objects? via materials?
essentially I want to exclude some objects from the bloom effect
Yes
what property would that be?
I realize I'm asking a lot of questions so I apologize, but I'm just trying to clarify some stuff
I DO notice that a color's value impacts the bloom intensity, which makes sense, but what if I want a high value color without the bloom?
I would change the threshold on the override?
That you cant do. Only way that I know is to render those objects without bloom with different camera than all the other objects
PP effects are always added to all pixels on the camera
thanks for your help. That was extremely useful
In simplified terms a surface's brightness is light it recieves * albedo color + emission color
Normally the albedo color cannot go higher than 1 or 100%, so with a very bright coloured object whether it surpasses your bloom thershold or not is dependent on how much light it recieved
A sufficiently high bloom threshold in most scenarios will let you display fully bright albedo colors without blooming, and where you want blooming use a very intense emission color
This gets tricky to fully control if the player can stick objects really close to lights to make them really bright, or if you're working with adaptive exposure
I'm having issues with the lighting in a house I'm using. I'm basically trying to make the house darker, I was recommended deleting lightmaps which I've done but now it gives me an off-color kinda look. I was told I needed to bake light probes with new settings and bake the reflection probes. But I can't really see where I'm supposed to change the light probes.
It looks like this:
But i want it to look like this:
i just dont understand lighting i guess right now, and looking for someone who might know something about whats going on
with the lightmaps theres too much excess light and its not dark enough at all, light in random spots too
i was told to remove the lightmaps
you'll need to modify the lighting parameters to get it the way you want them to look like
and if there's lights in random spots, go through this:
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/#post-8466893
there is no way you're going to achieve the second image without global illumination
either that or ray tracing
i see okay
ytea im very new to all this and like
lighting seems so tricky dude..
yeah
its worth spending days on, so get your gameplay loop first before being concerned with lighting
and art stuff in general
worth getting gameplay down before lighting
?
maes sense yea
good advice
ill read that forum, might as well ask this rq if u know can u just simply darken lightmaps or does it not work that way
do you use directional lighting?
yeah
yes
ohh
dark shadows
should i disable it entirely?
If you make it a gradient, you can modify equator and ground colour
if you turn that black you will see how dark you can make things
welll
if you need day night cycle then not really
nah just needs to stay night
makes it easier for you then
yeah so instead of using colour lighting from skybox, change that to gradient
sorry actually, directional lighting isnt the problem
its the skybox lighting that is
which is affected by directional lighting
in the actual lighting settings
did you bake the lightmaps?
no lighting thing is going to change a lot if theres no light mapping
ye theyre baked
you'll need to mess with the intensity parameters and such
here can i tell u exactly what the creator said to me? it seems we're on opposite time zones thats why its hard for me to talk to him about it
sure
so for pre-context here I had sent him the 2nd image that u saw (the actual good looking one)
and i really just dont see what he means i cant rly find options hes talking about
i can remove the lightmaps like he said and it gets closer
but not quite u know what i mean?
when i do that it removes the lightmaps
but u said theres no way u can do it w/o lightmaps
oh this is stoer asset?
ye
me and a buddy were like fuggit and we tryna learn stuff and we found this one
it had a lot of learning potential ig u can call it
just like completely start over with it?
shouldnt be too bad, id just have to re-apply a couple scripts but
just make another one so you can exzperiment with the lighting
purely to fuck with
yes
hmm ig i havent thought of that rly
yeah i never thought of that
not a bad idea
i still wouldnt rly know what to do exactly but
i WOULD be more comfortable messing with stuff
ye
cuz rn im kinda like afraid ima destroy some thing major
and its all fucked
that is a good idea though dude
have fun bro
dont be afraid to start over
good thing scripts can be just copy and pasted over
but if you have a project with lots of worldbuilding and such already
yeah exactly
dont import stuff you dont know
I think its good practice to just import stuff into dummy projects first just to see if they actually work first
yeah
that sounds like a good idea
also ig i can ask this but im p sure i know the answer lol
u just obv know more than me but
ok so
this asset has a URP & HDRP versions
so when creating the project, i can still just create it as a 3D (core) project right?
or do i need to do any bs special shit
like just, bam right
3d Core is bult in
ye
HDRP has better graphics yeah
yeah
while i dont need it to be triple A
style of graphics lol
i dont want it looking bad
is there a big diff between the 2?
is it WORTH using HDRP version if ur not going for like an insanely beautiful game?
imo not really
not too familiar with HDRP tbh
but pretty sure you can dial it back to URP levels
just need to mess with it
its all free
yea
wait so
could the house have been affected because i wasnt using the hdrp one?
cuz i imported the HDRP house, but i only used 3d core
or is that kinda irrelevant ?
that is likely
oh
if an asset is not designed for a render pipeline, anything can go bad
yeah
and it will go bad
anything that can go wrong will go wrong lol
shaders especially
yeah maybe
@silver grove @primal rover Remember that discord threads are good if it seems that a topic drags out
Whenever I set my structures to static and try to build the lighting, it throws these errors in the console and leaves these visual artifacts everywhere.
Does anyone know how I can fix this?
Figured it out, I had to make sure that Generate Lightmap UVs was checked on my models
i have lights in my scene liek area lights spotlight etc but they arent emitting any light
does anyone know why its happening
i am working in a 2d project btw ive seen that it might have somethnig to do with it
I've created this simple map with probuilder. I built out the red side as a single probuilder object, then duplicated and mirrored it (so I have two probuilder objects that compose the level). However, I'm having this issue where the baked light seems to be sharing between the two probuilder meshes. Clearing all baked lighting data and regenerating doesn't do anything. The two objects have two different mesh names when I inspect them in the editor, so why is this happening and how can I fix it?
In this pic the issue is that the blue room has the same baked indirect red lighting on the walls as the red room
and here's after i cleared bake data and baked again. this time the blue indirect light is on the red room walls
it seems to randomly switch between the two
They have overlapping lightmap UVs
You'll probably have to enable lightmap UV generation for them, or separate them into different probuilder objects somehow so they don't get the exact same ones
Probuilder generates meshes by its own rules so I'm not entirely sure what affects it
If all fails you should be able to export them into non-probuilder meshes so Unity can do the lightmap business uninterfered
well
in case of LOD group
how can i make the second LOD objects get lightmapped by baking?
whenever i am baking lighting, i see that the gameobjects of the second LOD group i.e LOD 1, is getting UV overlapped
but when i am baking that game object individually without LOD , then it is getting normally baked without any UV overlapping warning
a big depression
well....kind of solved
i just probuilderized those objects
and on the exported mesh i checked 'generate lightmap UVs'
then those noisy/dark artifacts went away
and got a healthy baked lightmap
Is there any way of passing my own shadowmap into the Unitys _ShadowMapTexture and enabling SHADOW_SCREEN keyword so it will render the shadows? trying to enable keyword but it simply wont take it, and cant find any information of overriding unity's shadows
is there any method of making skinned mesh renderers receive light maps? I have a cardboard box rigged for modularity, no movement would be happening in the scene. However, stuck using a skinnedmeshrenderer instead of a normal mesh renderer due to this. Sorting out the bake lights for my scene but the boxes kinda stand out not being able to receive the bake lights.
Anyone know whats going on here? the mesh render of the mannequin is messing up the lighting very badly
Specify what "messing up lighting" means
You can investigate it by testing if the lighting looks messed up without the blobby fog, in different lighting (preferably new test scene) or by assigning different materials to the mannequin (or assigning its material to a default cube)
Sure I can do a control test, but there is no fog involved, just tried assigning a different material, no difference
this is what is behind it
nothing
that is not correct, aka messed up
@silver grove is the problem w ith the mesh or with the shadows of the surroundings?
How bad do point lights bog down a scene? Say I have a city background and i want to put point lights in the windows to make them glow a little.. would that like really slow things down? Id say there are about 100 windows. Is there a better way?
In forward rendering which is the most common each mesh within a light's range will be rendered again for each light
So, pretty expensive with a lot of lights, big ranges and/or big meshes
For cities you usually can get by with just an emissive texture for windows, or something called "fake interior" shader
Baked lights or deferred rendering path don't have that specific limitation, but they have their own
Thank you so much, for your response! I figured it would be pricy. I had a feeling from back when I used maya that emissive textures were a thing and i think thatll be perfect! You rock!
Howdy folks. I am using the Light 2D experimental for Point lights, and have noticed they add when overlapping. This can lead to wash-out when a large number of illuminated sprites are close together. Do any toggles or strategies exist for mitigating this?
I believe you can use HDR emulation and light blend styles as defined in the renderer asset to change how much brightness builds up and how lights blend together
I don't think the 2D renderer has been called "experimental" since a couple of years ago
I wonder if perhaps that is related to my using 220.f.36f1. Been hesitant to upgrade given how quickly old packages are deprecated, and I'm still learning the ropes.
"3. For Unity v2021+: Right click in your project window, Create > Rendering > URP Asset (with 2D renderer). For Unity v2020: Right click in your project window, Create > Rendering > Universal Render Pipeline > 2D Renderer (Experimental)." So yeah, I'm just on a much older build I suppose.
The only light blend styles defined are multiply, additive, subtractive... nothing I can fine tune really?
The URP Asset itself has fields for maximum lights on a pixel, but they don't seem to be considered.
Didn't someone say they are like a cube - 6 faces of light - so 6 times more expensive than say a spotlight?
That doesnt seem right. First of all, the math behind spot light is bit more complicated. The faces doesnt really matter, I think this was referring to shadow maps which is problem only if the light casts shadows. Even then the "6 times more expensive" isnt exactly correct, its true each side is rendered to their own shadowmap texture (/part of texture atlas, using single pass tho) but what matters more is the amount of objects that gets affected by the light/shadow so light range can have major impact on the performance. In general spot light is cheaper than point light but 6 faces = 6 times faster isnt true (https://forum.unity.com/threads/what-is-the-most-expensive-light-type-in-unity-3d.56490/)
I am all updated to Unity 2022 and although the naming is different, and the experimental is gone, nothing much else has changed regarding point lights overlapping and washing out the scene. It is interesting reading posts over the years detailing the same issue I'm having with point lights, yet no real viable solutions. It apparently is a much larger issue in 3D due to the "realistic" falloff range of light that makes it very difficult to do flashlights properly w/o tonemapping. Generally there folks expect static scenes so bake the lightmaps and move on. One recommendation I tried had me adding a post-process tone mapping shader. It dimmed the overall scene but didn't actually help the problem. And I'm not really setup for writing my own shader. Just surprised to see this is a common issue and the recommended solution is don't use lights if they could possible overlap. If I could simply limit the number of light sources acting on a pixel simultaneously it'd be fine, but those settings don't seem to affect this.
any solution for lightprobes breaking the static batching?
bump!
Hey guys!
Im having shadow issues, how do I stop shadows that occur when the light source is coming from underneath the geometry? The terrain is casting a shadow onto the pillar
Some extra details is that the shader for the terrain is a custom shader where I have custom code that enables shadow casting / recieving on instanced indirect meshes.
u can just keep receive shadows off on the cube...
The culled geometry surface let light pass through a mesh
yeah I figured as much but was hoping for a solution to fix for all cases, stopping the shadow cast on the cube still allows the shadow on the terrain gemetry in weird places
those shadows are not from the cube
If you turn off cast shadow on your terrain as well...it fixes the problem
its like a lose lose situation then lol, no shadows from the mountain tops, ill just look for another solution
a middle of the road solution was to check the angle of the light and bsaically clamp it between 0 and 180, essentially forcing the light to always stay above the ground. OFC its not perfect, but another solution I thought of was maybe to have two directional lightsources that alternate depending on the time
So I clearly must be doing SOMETHING wrong but when I use mixed baking with a directional light to bake a lightmap it seems to cause an issue where when there is no light at all afterwards some top faces begin to glow to an extreme level
HDRP stuff I guess. Is there an obvious reason this would be happening?
So, I have a really larged scale world that uses a day and night cycle. Is there a way to bake the lighting for only the emmissions on the materials being used in the world and not the shadows?
You need shadow casting geometry on the bottom of your terrain
I know it sounds counterintuitive because you're adding geometry that will never be seen, but think of it from the perspective of the light: it culls backfaces as any normal camera would, so you get the effect where only some of faces (the ones that are inclined towards the light) cast a shadow and you get zebra stripes
anyone know what this is?
There's this circle that resizes based on how far from the wall I am
disappears if I turn rendering culling mask to nothing, but then the sun light stops casting on surfaces
so is it something to do with light optimisation?
(this comes from directional lighting)
Good idea
You can make it a seperate object and set it to shadow only if you want, although it honestly shouldn't matter really
On your post-processing settings, play with the Exposure and Bloom settings. To me it looks like you may have 'Automatic' mode for exposure which is trying to compensate for the mostly dark scene, but then the tops of your walls are being blown out and then the Bloom exacerbates the problem.
That might be it but I've had problems before where lightmap errors result in extremely overbright pixels
I dont remember exactly what it was or how it was resolved but they were technical mistakes in the vein of having exposed backfaces
Why? And how to fix? What I meen is making the baked one look actual good
You can control the quality of the shadow by changing lightmap resolution, lightmap compression quality as well as increasing samples so there's no denoiser grain
However, do you really need to bake a sharp projected shadow onto a featureless floor?
You'll usually want to use baked lighting in situations where there's many light sources and/or a lot of bounce lighting, so there are no terribly sharp shadows
Having some natural texturing on the floor also practically hides compression artifacts and other imperfections
I probably would use mixed lights with shadowmask mode to get both sharp shadows and bounce lighting, but that's only if I really need the sharp shadows and increasing texture that much isn't preferable
well thanks for all the detailed answers. I was just doing the unity learn ligthing stuff and notice this difference and just wondered 😄
Realtime and baked lights excel at different things, basically
Soo the directional lighting rotation is choppy, I've tried rotating using slerp and currently just use Vector3.Rotate(vector3) but there's no differences, is there an issue with settings?
settings
I would guess this is related to your directional light shadow resolution, shadow distance and cascades
At low shadow resolution and a moving light source the shadow would be snapping from pixel to pixel
yeah sounds about right, I'll try upping that, forgot I was using baked GI, so that may be affecting it
cheers
It won't, since your directional light is entirely realtime
Hey, im attempting to color a mesh using a shader and c# code, but it turns out extremely weird, and i cant see any shadows or depth on the object?
Im setting the colors of each vertex using mesh.Colors[vertexIndex].
Material is shownon the 2nd picture.
mesh has a structure like so
I would assume the issue is me using baked lights and changing the baked mesh's vertices at runtime??
Okay i just solved my own problem nwm
Now im having issues with everything being great in editor, but when i build it it looks like shit and there are no shadows?
Do share
It'll always help to demonstrate the specific variety of shit
Though I'd guess it's that you haven't generated lighting for scenes (baked lightmapping doesn't have to be enabled, and shouldn't be unless you want that workflow)
Fixed that as well, 1st issue was due to me using baked lights whilst changing mesh;s structure which broke it somehow. So i changed it to realtime and it worked.
2nd issue was due to the quality level being at 5 in the editor and for whatever reason being set to 2 in the built game.
So i just made a script to force quality to 5 at load.
And now everything is as it should be
Hi all, I'm having some dumb results with lighting in my VR Chat world.. there's some pre-existing stuff I've been able to look past but I've just a made a new spawn room and I can't figure out why I'm getting these results.
As you can see the walls aren't receiving any light at all, and the door frames are wildly different from one another?? Any ideas what's going on?
https://cdn.discordapp.com/attachments/841232199415758878/1039786819409150003/image.png
https://cdn.discordapp.com/attachments/841232199415758878/1039786304721915985/image.png
@modest ledge tried rebaking the lightmaps?
Yup, a few times, I get varied results but nothing I'd consider passable.
what happens if you recreate the walls?
As in reimport the mesh?
yeah, in that case it could be a problem with the normals
did you make it?
or downloaded?
I made it, the normals are all in the correct orientation.
look at this:
https://forum.unity.com/threads/static-model-goes-black-when-lighting-is-baked.140815/
I have a super simple scene with a .blend object UVed with a texture, sitting on a terrain. The .blend object (a house) is set to static. I added a...
I'll have a looksie, thanks
That was my issue, thanks!
nice 🙂
Why is my image burning when setting the rotation of the sun to midday?
This is the default one, but I want the shadows from the top
Your material appears to have specularity, so as in reality the sun's light is reflected back to the camera
At other angles it's reflected away
@deft fiber Oh, it was that hahaha, thank you! ❤️
Hello, my Angel object is black without a skybox and in my scene i cant have a skybox because it will mess upp the lighting. The light you see on the walls are all baked. so I have no real time lighting. Is there a way I can make my object show its texture without skybox
I believe the object has to be set to static to receive baked lighting.
I allways forgets that, Thank you ❤️
@peak pilot Dynamic objects can also receive baked lighting via light probes
Also useful for non-lightmapped static objects
ok
Anyone know if there's a way to share environment lighting between scenes, or even just copy the values over in some convenient way? It's very tedious to have to go through each one just to make one change.** **
The way that comes to mind is additive scene loading
The additional scenes would inherit the envrionmental lighting from the main scene
Do you know if there is a performance hit when using light probes vs lightmaps?
Is it possible to programatically set the directional light values (direction and color) only for specific material? I am using DOTS renderer so using separate layer and separate light source for this material is not an option since DOTS renderes currently supports only single layer
I tried setting light color globally like this but it doesn't seem to be working:
public static int _MainLightColor = Shader.PropertyToID("_MainLightColor");
public static int _LightColor = Shader.PropertyToID("_LightColor");
...
Shader.SetGlobalColor(_MainLightColor, Color.green);
Shader.SetGlobalColor(_LightColor, Color.green);
Yes
Why?
Use environmental lighting
doesn't work quite right
I started by asking why so that I can avoid suggesting something that doesn't actually suit your project's specific needs
Environmental lighting is highly customizable though, so it's still likely the solution
Good luck
I guess some, as they're evaluated in realtime, though it's still baked data being sampled
I haven't heard of any performance considerations with light probes so I assume the impact is negligible in most circumstances
It rarely makes sense to compare them directly since you would almost always prefer probes for any object that doesn't specifically need baked lightmapping
Small objects for example tend to be a total waste to bake lightmaps for
Lightmaps tend to have a much bigger filesize
Not sure if anyone has seen this before, but my realtime lighting works fine in editor, but in build there is 0 lights rendering. So its pitch black. Any idea what this could be?
Hi, I am using URP 12 and Unity 2021.3.4. I have some custom shaders from an asset and I'd like to use a cookie on a spotlight, when shining on this shader(left), my cookie doesn't show. When shining on the standard lit it works fine. Any clue on how to fix this?
Refrain from crossposting
It's quite rude
Yeah, I guess if the light probes are baked data there shouldnt be much difference
using unity solely to convert 3d models, so i don't have much in the scene
there's a weird shadow cast over the entire scene around the horizon line
it moves when i move the camera and appears to cover the entire scene
this is when i have turned off the directional light
how do i get rid of this?
there are only 2 objects: the model and the light (turned off)
Are you using HDRP vs URP etc? There are project defaults you can set (varies per pipeline). E.g. what skybox is being used, are you using physical sky, HDRI, any fog, ... some of them can be done in the project settings rather than the scene, so I would be looking through those. (No, I am not an expert, but I found some of the defaults were not what I wanted with HDRP for example - there was a ground tint shining light upwards by default for example)
Can someone explain to me why changing a layer on an object removes it's shadows?
Default Layer
Other Layer
I'm using HDRP
I'm palying around with the HDRP lighting settings... Under Project Settings > Graphics > HDRP Global Settings. Are these settings the same as if I made a Volume component one an empty?
If I wanna create a scene, with one global light setting, should I just use the settings in the Project Settings tab?
Is there a way to include more than light layer 0 as the default? I'd like light layer 1 to also be checked by default... very tedious to go through all my renderers and turn it on (and prone to me forgetting)
Hey folks. Figured I'd ask again... I'm making a Unity 2022, 2D game with Point Lights using the latest URP. When too many overlap, the scene gets incredibly washed out. Does any method exist to prevent this from happening? This is a particularly bad problem when AI units are emitting glowing effects and begin to clump up
I tried using a Tone mapping shader on the scene but it only added perhaps another 10% margin before it washes out.
I think so, yes. You can then override the the settings with volumes etc. I say "I think so" however as sometimes it seems to not work as I expected, so I always create a global volume in the scene. It has been more predictable that way. But I might just have made a mistake somewhere. I believe the idea is the global settings is the default, as you indicated.
The manual says "Shadow Light Layers - When using Light Layers, Meshes only cast shadows for Lights on the same Light Layer as them." So I would check the layers for the lights and objects to see if there is some difference going on.