#archived-lighting
1 messages ยท Page 1 of 1 (latest)
Which Render Pipeline are you using?
Built-in
Hmm, let me google ๐
Does Built-in has something like a skylight, which effects the whole scene?
Well there is environment lighting here but that doesn't seem to do much for me
Well.. you could just adjust your Lights, so they bake to the same result as your non-baked scene has.
You could add a post-processing to the whole scene or (the most time soaking way) create your own shader where you add a fake ambient light.
OR wait for @deft fiber who knows everyhing ๐
Haha thanks, yeah I will try to mess around with the lights some more
Assuming you've baked reflection probes, changing these won't affect much before you bake again
Baking lights allows light to bounce around and be occluded realistically, so the red light from the sky can't reach in between the buildings so much anymore
Does the ambient light be baked into the lightmap?
I thought its only for non static objects
Lightmap and reflection probes both, which I assume are being used here
But shouldnt his ambient be more visible then?
It's possible that the ambient lighting isn't being baked/rendered properly at all, but tbh difficult to say definitively
I just tried a bake with Subtractive mode and it seems to give me the results I want
The advice I'd want to give every time is to read the docs and just practice baking in a simple test scene until you're familiar with the process
There's so many moving parts and things that can be amiss
Thanks both for helping!
Best advice. Put 3 objects in a file and learn from that. Unlike me who builds too much and then gets pissed nothing works?? #lol.
Question for clarity. I am going into Altspace, if that matters. General guidelines for lights? Someone told me you can not use more than 3 light sources on a texture. Is this true? Are there general โdo not doโ rules?
I don't know what Altspace is but in any situation you'd have to design lighting specifically around the limitations of the rendering system and the target hardware
Ok.
Is there not a 2d point light anymore?
Spot (Note: The Point Light Type has been renamed to the Spot Light Type from URP 11 onwards.)
So how do we get hard shadows then?
Probably the same way as before? A 2D point light is just a spot with a 360ยฐ arc
I am trying to get the tile map to block the light without having to use shadow caster2d and manually block it out.
I found the lights really difficult to focus. The funny part about that is I have a 43 year career in theatrical lighting design.
Yeah just trying to get the tilemap to block the player light.
Hey, I'm back after a 1 year break, I reinstalled Unity, checked 2 or 3 things, wanted to start playing around, and this happened, the light looks that bad, the color is not even and "flat", I'm pretty sure it's a very simple setting to uncheck or something, but I can't remember
How did you get to that point and what were you trying to do are the important questions
Well I just opened a new project, created a plane, created a material, just changed the color of the material and assign it to the plane
So I pretty much did nothing haha
Everything is default
The only thing it reminds me of is messed up normals or normal map
You could try creating some more default shapes without any kind of material to them to see if they at least react to lighting normally
Oh wait I found out something
The reflection changes depending on where my pov is
Here's with a material-less object
But since it's white I'm not sure we'd see the problem there
It certainly looks much more normal
Probably something weird going on with the material you created
Literally everything default but the color
Is the normal map slot empty or white?
White
There we go
What do you mean? x)
A white normal map will distort lighting severly
You should reset it to none
Oooh great thanks! Still not looking like what I want, but it's closer haha
The closest one I got from what I wanted is to change the shader to Sprites.Default
But a year ago I remember that I could have a nice opaque and even surface without having to use that shader
Cause you see there, there's still reflection
I wonder, can Unity handle multiple light sources?
I remember reading some ||ancient|| Opengl article where author noted that 8 lightsources on a scene may cause troubles
There is a mode where Unity can handle maximum 8 light sources per Object.
But thats for the Universal Render Pipeline which is made for mobile devices.
But there are ways to use unlimited lights also
it is not normal. Why does it take so long? I just added new sub-location to the current scene and started rebaking it
2 jobs is stuck forever now
How long does the whole bake need?
1-2 minutes
it was last time
you see I am not even baking standart maps but only realtime global illumination maps that take quick seconds to bake
so wrong
OK i have deleted new location and the scene baked in 30 seconds
Now I am gonna show you my new location itself
that is not so much polygons here BTW
Hey guys, I was testing a build of my game when i ran into this issue with lights and I was wondering if anyone knew a way to fix this issue
it may be the dynamic source of light that unity can toggle on an off, it is in URP asset settings
maximum is 8 per object
It isnโt for mobile, itโs just for anything
hence "universal"
If you use URP u can switch to Deferred pipeline which does not have limit to a light count, only light shadow count.
im sorry to bother anyone but my lights were fine for the whole time and then all of a sudden, they fucked up and I have no idea what went wrong
if anyone could help me find a fix to this, it would mean the world to me
Lights need to be generated from the lighting window to preserve ambient lights on scene change
Note that Baked Global Illumination does not have to be enabled, and shouldn't be if you don't intend to use it
what exactly do you mean by generated by the lighting window?
sry this is my first week of unity
Lighting window has a button that says "Generate Lighting"
ok thank you
Is there a way I can have a minumum brightness set up for my light baker? I want it to not have lights but still be visible
Maybe this helps
You need a light that effects the whole scene slightly
I haven't seen an option for it, and it's sorta opposed to why baked light calculations are useful in the first place
The "proper" way would be to use the light there is physically, by increasing exposure in post processing in a volume within the house (or use auto-exposure if you can have that), and if necessary boost the lighting by increasing indirect bounces (and/or intensity) or adding some subtle light sources so it makes sense why you can see in a dark room
That said, you could define a minimum brightness simply by brightening the .exr lightmap texture itself in an image editor
Crude, but works
You have always a good idea ๐ ๐๐ป
Hi im currently struggling to get the perfect light in my game.
Any tips?
it looks like this right now.
i want to get it a little scarier.
Do anyone have idea why while baking lightmap Unity switches to CPU baking? I have RTX 3060
There's usually an error or a warning in console why it falls back to CPU baking that may or may not be helpful
It sometimes does that for me but restarting the editor has fixed it so far
@deft fiber Unity doesn't throw any error, also restarting even PC doesn't help
@deft fiber I see that there is new version, so I will just try to upgrade
He just switches for uknown reason
It could be important to update your GPU drivers and to verify that other programs besides Unity can use it as well
Good idea, I will check for drivers
Indeed my drivers are outdated ๐
Cookie is a very good idea, for some imperfections
Although there's a lot more to a spooky atmosphere than lighting here's some more things I would try:
-Move the flashlight off center so you can see it casting shadows
-Animate its motion when walking so it bobs, and when looking around so it always lags behind and/or overshoots a bit, never quite illuminating perfectly
-Reduce the intensity, range and/or angle
-Consider adjusting the color of both the flashlight and the ceiling lamp; warm yellow doesn't inspire fear. I would suggest a pale colorless LED for the flashlight and a sickly green- or blue-tinted slightly flickering fluorescent light for the ceiling lamp
oh yea i will implement that
with flashlight
and without
i also added an cookie texture now.
This is definitely effective, but may cause eye strain
I would prefer a very subtle flickering, such as between 100% and 90% intensity a few times a second
Just enough to kinda make it feel unreliable and restless
i dont know how to do it like that
but i changed that the materials change
so when theres no light the lamp is actually Off.
A scene taken from horror movie Lights Out
It doesnt have to be pitch black to be scary
Do people use code to animate bobbing object, I canโt tell how people make such satisfying looking Bobbing in their games
Like it goes up and a bit side to side
Making the object lag behind is petty easy luckily
Animating it manually will make it look like it snaps after you stop walking I think
There's many ways to go about it, I think most use code but if you're familiar with the animator that'll be just as practical if not more so
You can use animator transitions to smooth out the start and stop, or if you have a bobbing and an idle animation layers you can damp the weight transition
If you have some systems like camera bobbing or footsteps, it may be for the best to make them all work together
If you really need authenticity it might be useful to make a whole animated fake body for the player which you can use for all that and more
Oh yeah thatโs a good idea actually
Also didnโt know about weight transition
Thanks for the detailed answer ๐
does anybody know if it's possible to get some spotlight's projection matrix but without the offsets used for sampling the shadowmap atlas?
either that or manually calculate it, as I have access to the spotlight's fov, near and far clipping plane, etc
basically the same matrix unity uses to sample shadow atlas but to sample the full texture instead of a "quadrant"
Weights don't have any sort of transitions in the animator, but you can SmoothDamp it in code (or use any of easing function)
SmoothDamp is a built-in method, like is MoveTowards which do much the same, though the latter is linear smoothing
For anything more complex than that I'd use the DOTween library
Alright ๐
hey
got a problllem
I am using RGI and as soon as a change material on my giant Ball (in code ofc) the light it emitted doesn't change color
just look at that
changed mat from red to blue
Is it because maps are in gamefiles so it is impossible to change them runtime?
@sand juniper Do not crosspost
Baked lightmaps do not respond to material change at runtime
Only Enlighten precomputed lightmaps or realtime ray-traced lights are capable of changing emissive material light color at runtime
The other option is to use a realtime point light for the illumination instead of baked emission
is it that restarting the scene will not help too?
that was my last hope
Oh I know I could have 2 same objects but with different colored baked on them
hehehe
How do i fix these black spots?
Looks like texel invalidity
https://forum.unity.com/threads/faq-blocky-artifacts-appear-when-i-bake-a-scene-how-can-i-fix-them.951444/
I would say it looks quite nice, but at least from that picture for a little bit of criticism the horizon looks very bright
The shadows on the objects look nice and I like the blocky feel to the tree shadow bc of the trees shape
I've read some pretty neagitive comments on the built in gpu lightmapper and people often recommending Bakery plugin from the asset store. I thought i shall ask in the official channel if it really is the case? Is the built in lightmapper really broken? And do i need to purchase bakery if i intend to do any serious work related to light baking?
No itโs not broken. bakery was made a few years ago when unity has not got a GPU renderer. And you can imagine that bakery with its years and years of knowledge does a very good job. Bakery has many features that the built in one does not have. I use it since 4 years now and itโs worth the money.
But in most cases you are completely fine with built in GPU lighting in unity.
Okay! thanks alot for the advice. I think i'll choose bakery as well if it have so many good features ๐
I send you the bakery Discord via PN, there you can ask questions or get help if you want.
that's great! thank you so much ๐
Does someone know how to fix this?
What is "this"
If you're referring to the draw distance of your shadow maps, increase the Max Distance of your shadows. You can add an override to your post-processing volume if you don't have one, and make your adjustments in there.
thanks
guys I don't really understand what it is for from what I have read here. Can you explain it simply?
Ofc ๐
guys help
i played around with the skybox on my scene and now all colors are dull
huh?
rather like blender
oh
Have you perhaps tried to add a light source to your scene
And started the game
Cause it looks like global illumination
is directional ligh enough?
nah
the light works
but the colors don't change
unless the light is diffrent color ofc
nvm
i turned out the skybox i used wasnt the default one
just similliar
also generating lighting helped with the colors in game view
If you donโt add light sources to your game, you wont have light. You only have the GI light now.
What would the best way to decrease light outer radius every second?
Writing a script thatโs reducing radius every second.
How would I do that?
Google it please ๐ there are thousands of tutorials for coding beginners for unity out there. If you struggle after doing it on your own, you can ask #๐ปโcode-beginner. But try it alone first ^^
A simple ignoring the question would have sufficed.
They were answering your question with a valid response.
The response was "figure it out".
The response was, check google for some ideas on how to change the value of the light radius, and how to do something over time.
The response was generic, most people I would assume would check google first.
https://forum.unity.com/threads/light2d-methods-for-changing-the-inner-and-outer-radius.729467/
For example, first hit on google for changing the outer radius.
And you didn't find anything, I suppose
I had already referenced that and didn't have what I needed. I "figured it out" though. Like I said, generic and dismissive. What you did was provide assistance even though I already reviewed that material before. You can defend it but it would have been best left unanswered.
If you can not see the difference then I don't know what to tell you.
I can see the difference. I've been here long enough to see the commonalities between those who want handouts and are bothered when they don't get it, and those who come with some already made effort with their questions.
Anyway, glad you solved it ๐
Glad to see yet another moderator with a condescending tone. Again, I stand by my statement that he should have just ignored the question.
Okay, well that's your opinion on how people should answer questions here. It doesn't mean it's the only option.
Again, I stand by my statement that the response they gave you was valid.
Your question was just as generic so what did you expect
We're glad to help with specific issues but you have to communicate initiative and show what part you're stuck in
I would love to assume people check google first but that's not all that often the case
That is correct, I should have framed my question better, Does not change that the question could have been left unanswered and had the same effect.
@plush solar If only your question matched the energy you putting in bickering about it.
You've asked how to do something in a generic way, you got the answer. Answer that was enough to point you in the right direction. Details about accessing and managing component something a beginner should know.
Now if you were looking for a detailed answer on something you are expected to do some research and show it in your question. For details see #854851968446365696 on how to ask questions properly.
Does anyone know how to adjust the intensity of a light (through code) that uses the 2D pipeline renderer in unity? If you need more information please ask.
there's a property for it
Hey so ive got lights in my scene that worked perfectly until i baked them
some of them are just completely ignored
is there anything I missed?
Are the lights set to 'Mixed' mode instead of just being 'Realtime'?
Actually, because the light isn't showing inside the lightshade area, check the light intensity value.
all of the values are the same cause they're all duplicates
they're set to mixed
i tried setting to realtime or baked but it just completely got rid of all the lighting
is the not working light static?
maybe show us the light's inspector
its alright now
i worked on something else and came back to it and now its working lol
https://docs.unity3d.com/Manual/class-LensFlare.html this is probably the correct way, for BiRP
If you want to use a mesh, it needs to be positioned in relation to the player, with a relative rotation from the directional light
made a level thats closed in a cube, now facing a problems with lighting
when i try to gen my projects lighting i get the following error
[PathTracer] Failed to add geometry for mesh 'Combined Mesh (root scene) 3'; mesh format is invalid.
if i find all mesh renderers with that and uncheck contribute global illumination it finds some other mesh to error about
This happens with ProBuilder meshes with bugged out UVs
https://forum.unity.com/threads/progressive-gpu-error-failed-to-add-geometry-for-mesh-stud-mesh-is-missing-required-attribute-s.976230/ some info here and down in the thread some solutions to fix it
but its not pro builder
ive read that form top to bottom
nothing helped
can i send one of the meshes its angry at in here?
or somthing to go off of
If it's not ProBuilder then I guess it won't
Do the problem meshes have "generate lightmap UVs" enabled?
Import settings
i dont remember how to get to the mesh import settings
Open the mesh asset in inspector
its .assets
also, I imagine "combined mesh" in this context refers to static batched meshes
Disabling static batching for the meshes might make it easier to track down which are causing problems
from what ive seen its all the meshes
like i said when i remove one it just errors about the next
i dont think i can fix this as its not mesh files its .assets
ffs
Not sure what this means
i know that i cant change these to meshes
as thats considerd a big bad here and im not trying to at all
but yea that is anoying
it seems to bake when i use enlighten (deprecated)
but it maxed out my 48gbs of ram and made my pc die
For some reason despite their being no light, the scene is still fairly bright?
why is that?
and how do i make it so it's dark?
im trying to make an indoor level
wait nvm found out
i think it was because of the skybox/Environmental Light?
Does anyone know how I can remove the artifacts produced in the scene or where I can start?
Can you have a look on the texel validity in the scene view debug window?
sorry for the delay this is what it shows
for me it looks like texel invalidity.. maybe @deft fiber know better?
Here is a link you may find **helpful **that could solve your problem there.
Thanks! I'll take a look at it
@astral escarp @chilly kettle It does look like a very typical case of texel invalidity, so I'm a bit surprised it doesn't show up in the debug view
It's also possible that the texel invalidity is happening elsewhere, but because of a simultaneous UV overlap issue it appears here
It's always good to check both texel invalidity and UV overlap debug views when issues arise
Hi, thanks for the replies, I have solved the problem by reducing backface tolerance, I am not sure what I am doing with this and if it is correct but so far it seems to be working.
I am trying to change ambient lightening color. It won't let me in the sense that whenever I change it to another color, it immediately reset to default
Any idea what may cause that?
What's the correct way to change the render settings for my project sot that the inside of this inside-facing cube is completely dark except for a spot light. You can see that the camera is showing it as being a bluish-gray right now
It confirms that the cause is texel invalidity caused by exposed backfaces
The correct solution is not to have exposed backfaces in your level geometry at all
Also do check for UV overlap issues to rule them out
Set ambient light to a black color in environment lighting settings
Or if you want occluded interiors with exteriors lit by the sky you'll need to bake lighting with reflection probes or override ambient lighting locally with custom reflections
That works, but only when I remove the skybox. I'm just curious why that is?
Top: with skybox material
Bottom: w/o skybox material
If your environment lighting source is set to skybox, it uses skybox for lighting
What does that mean? Isn't the skybox outside of my cube and so no light should come inside?
Ambient light from the skybox is precomputed and applied to all objects equally, unless overridden by a reflection probe
Unless you're using RTX for all your lighting, the renderer cannot know which objects are occluded from ambient light
That makes sense, I'm not very familiar with lighting in computer graphics
Realtime graphics are 10% simulation, 90% hacks and shortcuts
If I want a cell-shaded look with thick banding on the lighting, is the best way to achieve that with a shader?
Like this
It can be done by using a posterizing shader on each material or on the whole rendered image, depending how you want it
This example is applied to the whole screen
anyone know why my lights do this?
I'm a lighting noob: why does my spot light only work when the mode is set to real time and not when baked?
How do I do lighting with maps imported from tiled?
U need to bake the maps
Looks like a typical case of per object pixel light limits
how to fix?
changing my camera rendering path from Forward to Deferred seems to have fixed it? i have not tested in VR yet tho.
The primary approach is to decrease light ranges so they don't overlap so many objects
There are about half a dozen other potential fixes to it which you can now search for since you know the keyword
thanks.
im not sure which channel to go to for my problem so im just gonna explain what my problem is. in the unity editor i have a terrain and trees on the terrain and all the trees are dark unless they are in the beam of the car that is also in the scene, but for some reason some trees in the distance are foggy white
and only when i run the game through a .exe
and not through the editor
what is causing this?
@raven orchid Which editor version is it?
2021.3.1f1
There was a bug with exponential fog not appearing in builds a couple of versions before that, so I doubt that's the cause but updating to newest 2021.3. might still be worth a try
Download a newer editor and open the project with it, 2021.3.6f1 in this case
Upgrading to a newer bugfix version doesn't usually break projects but it doesn't hurt to make a backup just in case
i usually just copy the project before doing anything big or maybe problematic to the project
can some one help me try to understand why my refletion probe is not reflecting certen objects?
I got some light solutions, and with this ligthing setings the houses are gray
with night lights the houses are reflected
could it be that the materials are not designed to reflect the light that I am using?
did you bake it?
yeap
hey guys, I have a baked point light that is in the center of my scene. Around the light in exactly symmetrical positions is my environment. However the light is acting like its a certain distance away from whole objects, rather than working as a light should. I am very confused. I barely touched the lighting settings of my project
What is your question?
So like notice the walls? Each wall piece is the exact same model....However when I generate my lighting, it gets baked differently
I'm just trying to figure out why thats happening
Are your lights makred as "baked" ?
In the Light ๐
Hmm. I think you have to watch some tutorials before doing stuff ๐
https://www.youtube.com/watch?v=KJ4fl-KBDR8
In this video, we are going to take a look at Lightmapping in Unity 2020.1 to help you create fast and beautiful lighting in your scene.
Learn more about Lightmapping in 2020.1 from our Docs!
https://on.unity.com/2U7VQIX
Interested in the newest Graphics Features we added in 2020.1? Click here!
https://on.unity.com/2GHYGkR
Download the Spaces...
is it possible to have a light that just casts shadows and doesnt contribute any light? on hdrp
A shadow is absence of light, so not really
i found this section on decoupling light and shadow layers, but i think its out of date: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@7.1/manual/Light-Layers.html
sounds like it would do what i want
Light layers let you choose per object which lights they are affected by
To make a Mesh cast shadows without the Light also affecting its lighting, you must decouple the shadow Light Layers from that Light's Light Layers.
is that still a thing?
Yes, but it's about objects casting shadows, not recieving them
e.g. if you want an object to not be lit by a light, but still cast a shadow upon another object that is lit by the lit
ah yes, i guess its not exactly what i want
i have a very dim light and i would like the shadow it casts to be much.. stronger.. i guess, they are currently being overpowered by other lights that dont cast shadows.. trying to figure out some way to do that
In terms of physics, a shadow is only as dark as the lighting it recieves
So, the only practical way to make a certain shadow darker is to darken every light source besides the one casting those shadows
Or make the whole scene darker by lowering exposure and brighten that one light
yeah.. the effect im trying to achieve has no basis in reality/physics, trying to recreate "light radius" from d2
Diablo 2 that is?
yeah
the "light radius" light is overpowering all my shadows, since everything outside your light radius is quite dark
i could cast shadows from my light radius light, it looks ok, just trying to figure out if i need to settle
It's possible to hack the light pipeline to "project shadows" instead of light, but it's a really complicated and you'll probably end up fighting against every other part of the light rendering system
HDRP (and URP) use physically accurate lighting models which makes the default lights mostly unsuitable for old school unrealistic lighting effects
thanks, yeah ill see if i can think of any other hacky way to do it or just settle on shadows from the light radius
You can get a sort of an old school light falloff by using shaders, but that will overwrite all lighting
And probably will be tricky to get to work with HDRP which isn't designed to be altered like that
Every part of it seems to assume that you want to use it to render photorealistic stuff using physically accurate light units
thats ok, ill just pretend the character is holding a torch and then it makes sense ๐
appreciate your help
anyone know what this dark square spot around specific spot lights in my project might be?
http://grinboo.ru/data/screenies/2022-07/Unity_07-30-22_01.36.22.237.png
http://grinboo.ru/data/screenies/2022-07/Unity_07-30-22_01.36.30.505.png
when I move the camera around it appears and reappears depending on the angle along with how close to the spot light you are, I'm not using any baked lighting as I have a day/night cycle and all the lighting is dynamic and am on the URP
the spot lights are also set to not cast shadows
http://grinboo.ru/data/screenies/2022-07/Unity_07-30-22_01.44.24.787.png
Maybe your tree
Because you have a tree so maybe the light is making a shadow of that
It sounds like per object pixel light limits, but from the image it looks like it's ignoring the directional light as well so I'm not totally sure
it shouldn't be, the spot light is set to no shadows, so I'm thinking there should be no shadows right
Maybe there's other light
yeah, I've noticed it's only 2 of my spot lights, the other spot lights around my scene aren't affected, so maybe these 2 are above the per object pixel light limit?
also if I disable the spot light the black square goes away so it's definitely one of those 2
It seems to be the culprit
You can minimize light limit problems by reducing light ranges, using meshes divided into smaller chunks, keeping lights further away from each other or by increasing light limit in quality settings if you can afford the cost
There's also deferred rendering path to allow a huge number of lights, but it has its own drawbacks
this seems to have worked, tyvm for the help to both of you! I could afford to bump up the per object limit one notch and that seems to have fixed it. I don't plan on adding any more lights to my scene for now, so just one increase seems to have fixed it for the meantime and is fine with me.
I've never heard of deferred rendering path until now, so I will have to look into it and learn what it is and what the drawbacks are in case it is needed ever in the future.
How do I make Shadowmapped lighting not eat my PC
Reduce shadow distance and resolution as well as light ranges
Shadow cascades may help or hinder depending on the scenario
As I understand cascades don't change the overall resolution of shadows, but concentrate the resolution closer to camera so you can get by with overall lower resolution
There's is a small overhead cost per cascade though
how do I bake lightmaps for a prefab? would I rather bake it in the scene and then pull it in the assets or can I do it in the prefab view window securely to all other objects in the scene?
i have a light inside a room that is just to make it brighter but the center of the light is reflecting off of smooth things when i dont want it to
is thare a way i can stop that light from making any refections i just want it to be ambient (ive tried removing its layer from the probes that did nothing)
you can see the spot in the glass
hi there, I got these weird lines on everything (using standard render pipeline) how can I fix it?
Can you show what the problem looks like on a default capsule?
I fixed it, it was somehow because of bias
Heyo, I've been having real wacky issues with my fbx objects. I think i understand that this is a normals issue but I dont know how i can fix it.
The picture is taken with just ambient lighting, no other sources of light and I get these strange seams / shadows on single objects.
The table on the left is a single face that dims right in the middle and the object on the right is two objects I combined together in blender and removed doubles. Which from what i've read for the past few hours should remove this issue.
I want to have only real time lighting and have 0 lightmaps baked, even if i do though this problem doesnt go away.
its not a lighting topic but im new to this server and ur online here, can anyone please check my code? im a beginner and i dont get the problem
it is a really simple code i just dont get whats wrong with it
I can try to help but go to #archived-code-general
tyvm!
Heya im having trouble with the lighting and ive not had this problem before.
Im having problems with spotlights and point lights when a directional light is present.
Like it refuses to work even with a high intensity light. Its not too dim or anything ive counted that out.
Its only when the directional light is disabled.
it works
also the light is in a interior enviroment
Try unchecking specular-reflection in the material (at the bottom)
I got this resolved by importing my normals from blender rather than unity recalculating ๐คฆโโ๏ธ
Is there a fog setting where it darkens the whole screen past a certain distance?
Like how actual fog would work?
The normal fog settings just changes the geometry color
based on distance, rather than straight up occlude stuff
like, you can still see the outline of things no matter how far into the fog they are
if you were trying to recreate the vision radius effect like in RTS games or Dota for example, is it even possible with URP or HDRP? I feel like I made a big mistake switching over and then trying to recreate un-realistic lighting... these are some of the properties i can think of:
- things within your vision radius are more lit (obviously)
- enemies (meshes) on a certain layer outside your vision radius are not rendered, but other objects (like foliage) are
- all materials on mesh vertices within your vision radius are more lit regardless of whether they are "facing" the light of your vision radius
I guess the visibility thing can be achieved outside of lighting with code, but the last point is really bugging me, i cant figure out any way to "light" all vertices on a mesh regardless if they are facing the source light?
A black fog color would do that, not sure what else "darkening" means
You can see the outline of objects because skybox is excluded from fog. If it were included it would be just the fog color considering it's an infinite distance away.
To get something that looks decent you usually would draw a gradient with the fog color all around the skybox horizon
It's also possible to blend to skybox color instead of fog color which looks nicer but is more complex
I guess if I place a giant sphere around the camera...
that only appears underwater
it would be the same effect with no extra effort
In that case what is the outline you speak of?
A picture might help me understand
That is the sky, I think?
I don't know what the most elegant solution might be but I think the mesh idea could fix it
I would make a plane that always sticks its upper border tothe water surface, moves along with the camera and faces its position
Positioned almost at the far clipping plane
Not all water is at the same height, so I can't trust that
oof
if I mess with this mesh draw order maybe I can get it to only draw if nothing else would've been drawn
That won't work if the sky is revealed by the far clipping plane
Well... I will try it out anyways after I am done with my current tasks
You may find potential solutions even from other games or engines as this should be a pretty universal problem with water areas
Switching to a skybox with a water-colored horizon might be a potential workaround
(please ping if you answer) I'm making a 2d game, and I want my unlit sprite color to be dark purple instead of black.
this black unlit box should blend into the backgrounds
any ideas?
make it transparent (joke)
@elder dew
if you want your background to be dark purple then you should try another approach
don't change colors by hand but use post processing to make dark colors look more like moonlight
@elder dew "Shadow color" comes from the ambient light, but that can't brighten up fully black surfaces
I agree that post processing is the way to go here
Probably either a LUT or shadows/midtones/highlights to make the darkest areas purple
anyone can explain why spot light on the right hand appears half while on the left hand side spot light completes the range
Might be that the light isnโt positioned right so the model cuts it off. Idk how you have it configured but that was the problem for me when o used similar lights
Iโm making a pov horro game and the flashlight light cuts off when you turn around. Itโs just a straight line down sidewaysthe center of the player view when you try to turn
Can anyone solve this please? Thank you!
Iโm using the unity fps core template
I've seen a similar issue when my materials normal map isn't correctly setup.
how do i correctly set it up?
It works on the wall not on the ground
Idk why
Even when I set the ground texture as wall texture it still didnโt work
On that white material, just try removing the normal to start with and see if the spot light looks better. If it is the normal map then you'll need to check that the colour channels (I can't remember which one) is using OpenGl orientation and not DirectX.
I think it's the blue channel that I needed to invert, but I'm not on the PC to check.
Ok Iโll l try that thank you
Any help to fix realtime light leak
Set to 'Every Frame' it works fine but eats my PC.
Setting it to 'On Demand' just leaks through every wall
Documentation says to request shadowmap but it doesnt work
Reduce the near-plane value. It should be around 0.1.
Also, in that second picture it looks like your light is inside the floor. If it is there will be no faces that can cast shadows, so lights should be outside of the object.
I've tried the near plane change, doesn't seem to help
And in the 2nd picture the actual light object is a child of a cube that's in the ceiling. The actual light object is not in the ceiling, does that matter?
It's quite hard to see with the picture
Strange that there are no shadows in the scene. On the objects MeshRenderer, do you have the Cast Shadows set as on?
it worked earlier for about 20 seconds then it went back to this
I messed with the near plane again, it seemed to work. Then after adjusting the light slightly it broke it again
I haven't been able to repeat it
any idea why my character isnt affected by lightprobe groups?
it works on normal meshes like a car and i tried changing the shader on the characters material to same one
is it because its a skinnedmeshrenderer?
trying to bake lights and have probes so i can turn off realtime to have a bit more fps on mobile
the cars show how it changes but no matter what i try the character stays same
actually no the change is i think from being inside a reflection probes volume.. so not sure what im doing wrong
help, my lighting goes dark when i change scenes
When asking for help, please phrase a question or noone can help you ๐
fixed, sorry
๐๐ป
Which kind of light source do you use?
directional light
here is what it looks like in the editor
fixed thanks
I'd like to find a way to produce less intense shadows for a single object, is this possible in URP? I have a noise map that I'm using in shadow-only mode, to simulate cloud shadows across the terrain, but I'd like them to be much fainter than other shadows? Any ideas? I can't seem to find a way to reduce shadow intensity for that object, nor can I find a way of incorporating a 2nd light to do it without it affecting the light of all other objects
Maybe you could make the object slightly transparent so more light passes through it making the shadow less visible
There fundamentally is no "shadow intensity" nor can any shadow be fainter than another, so no half-transparent shadows either
Maybe also have a faint light ejecting from the side of the object that the shadow falls from. That small light could illuminate the shadowed area slightly, but Iโm not sure how you have everything spaced or sized so it might affect other objects.
The only practical way to have an object be less affected by shadow is to use a (faint) version of its albedo as its emission
With a custom shader you could make this affect only shadowed parts
But it won't be possible to differentiate shadows cast by different objects
Hello, I am trying to figure out why my lightmaps are not generating on another UV map on my mesh. I have tried checking and unchecking generate lightmap UVs on the mesh import settings, recreating the mesh in another blender project and even tried baking lights on those meshes in another project. I have also tried using different shaders, which seemed like it did something at first, but it was a false positive.
The models are optimized and there's no overlapping UV's (Which i dont think matters considering it has generate lightmap UV's on).
Basically I have a tiled material (roots if you will) for a model. The tiling is changed from the default 1x1 to 5x5. Normally Lightmaps dont tile with the textures, but when I bake it the lightmap is also tiled and can be changed to normal if I set it back to 1x1? I hope that I'm not blind and just simply overlooking something, because I don't see any error or warning logs about it.
I have searched everywhere for answers, but nothing good came of it. So I decided to bring my problem here. (which no one else seemed to have this problem from what I could scour for).
My Project is running on HDRP, and i have not had this issue on the URP (So I think it's something I may need to turn on?). I am using HDRP/Lit as the "standard shader" for most of my models, including the one I have the issue with. I will provide screenshots if necessary.
Your normals have probably not been authored properly. You can change it so Unity calculates them instead
can anybody tell me how to stop this sun light entering my room, it's getting inside from nowhere
Show me the Inspector view of your ceiling and the material of it pls ๐
there is no material yet
Light Leak
Whats a reasonable number of reflection probes for an outdoor scene?
like whats a reasonable refl probe layout for like a medieval village style area?
should i basically be looking at a half dozen, dozens, hundreds?
Do you have an example Scene? ^^
Depends on the Size and how much you want the reflections to be "realistic"
looks something like this atm. Mostly open areas, I've just never really worried much about refl probes tbh
theres a fair amount of minor crap that's lod'd out in that screenshot, but thats the general scale
so i have this lightsaber that doesn't really look like a lightsaber in game, in the editor it looks fine with post processing but in game it just looks like this ugly red stick
how do i fix it?
Do the player walk around in this village? Or is it top-down from this distance?
3rd person
toon anime style, so it doesn't need to be insane - i just want some gi color bleed on metalics
You can place some, where the visuals change drastically, like at the place where the ground is sandy/brown. And for the rest maybe for every 3-5 houses one probe. Should be enough.
Just make sure everything is inside the area of a probe to get the reflections on metallic surface to avoid "black" metallic
Does anyone know what would cause the lighting to change even in scene view when I move pan? I recently swapped back to URP, and I don't remember things like this happening before. It looks especially wrong in game.
Possibly the Light Limit per Object
Where do I find that?
in ur pipeline asset
That didn't fix it.
How many realtime lights do you have?
I think just one.
Please do a video or something. Its impossible to say whats the error is without seeing ๐
Not sure if these images help or not.
Let me know if you need more.
Do you mean the light at the left corner?
Show me the Inspector of your Lightsource.
Your light is the red gizmo there?
That red thing you can ignore. I was just messing around with trying to make a lightsaber when I noticed this. The same issue is happening when I disable that light. This is the directional light.
Sadly i have no clue what this could be.
If you add a standard cube, does the weird behaviour happen on this cube also?
I'll check
the only thing i would to is debugging and checking where the error comes from ^^
The cube is working fine.
I noticed that for some reason the light seems to go away when I increase the clip plane on my directional light, but I'm not sure if I should be doing that.
means, something is wrong with your model there
Oh
If the same light is working on the cube correctly, i think its the model thats weird
Maybe I'll just delete this wall and remake it.
Try to create a new scene, add your model and a new directional light and test if its happening there too
Hang on, the cube is doing now when I scale it up.
I don't know if it's something with how I have URP set up, because in the new scene with the default cube. That is still happening.
Can you show the Lighting settings
well, i have no clue.. ๐ตโ๐ซ
Alright, well thx for trying. I'll maybe google some videos and if that doesn't work I should still be able to use the built in pipeline. Have a great day.
Maybe if @deft fiber will see this, he has an idea ^^
Hello, i'm new to unity and wanted to make a simple scene here where that cube blocks the light from reaching the wagon. i'm using unity 3D core , not URP or HDRP.
Is changing the shadows settings of the light the key to do it ?
Shadow Type Hard or Soft
@north echo @chilly kettle Looks to be indeed a directional light near plane issue
Though it's caused by large stretched polygons rather than the light
thank you !
will soft shadows makes the game use more ressources ?
Oh, I didn't see until now. To stop that, should I change the near clip plane, or should I try to use objects that start big so they don't need to be stretched so much?
yes soft shadows always more expensive
i dont even have a gpu on my laptop hope it turns out allright since the scne is all just that light and its shadow , thanks !
I don't know if there are downsides to either
You could try changing the near clip plane and hoping it doesn't break something else, since that'd just variable to change
Alright, thank you for the help!
Is it possible to stretch a point light, or do I need to just make multiple point lights?
I'm sure that I could find some way of doing this, but does anyone here know what the best way is to make fog that is affected by lighting?
Volumetric fog is built into HDRP, but you'll need to buy/install an asset for URP or LWRP
Ok thank you. Is volumetric fog what I was trying to do?
Sounds like it. Volumetric fog does things like godrays breaking through clouds and tree branches.
Ok sounds good, thank you!
I'm not quite sure where this belongs so I'll send it here, does anybody know why this is happening? This is a really sketchy cylinder that I cut a hole out of using blender and put the blender file into Unity. I'm very inexperienced with 3d modelling. The one where the textures look fine is in scene view with that scene-view-camera-light-toggle-thing on, and the weird textures is in the game. I've tried messing with import settings and laying out the tris better to no avail. Does anybody know how to avoid this?
this is the layout of the tris btw
please ping me with any responses :)
I'm not very knowledgable in this field, but how did you uv unwrap this?
@lost granite My best guess is that it has something to do with your uvs. What did you use to uv unwrap this?
smart UV unwrap after clicking on the axis in the top right of the view and selecting all the visible faces from multiple angles
the actual UVs look fine though, why would it only look distorted when a spotlight is shined on it
or any other kind of light idk I haven't tested it using anything other than the scene camera light and a spot light
I am making a VR game, and I have a camera that is viewing a room with baked lighting, which is being outputted to a render texture. In the editor the baked lighting looks as intended, however on build everything looks much darker.
This affects any camera that is looking at anything with baked lighting except for the player VR camera. I'm not sure if this is due to the render texture as its able to render realtime lighting correctly, or if the problem is due to some setting on the lightmaps.
This is the lighting when in the editor
This is the lighting in game
Hello I want to ask why my glass window reflects sky from in side it should reflect things inside the room
Place a reflection Probe inside thats fills the room
thanks I will explore this
Okay I have followed some tutorial on reflection probe and my reflections is better now, but my editor performance has been compromised its gittering while navigation
I have another question does reflection probe in realtime will heavily effects the performace for android device,I am making a collaboration platform on vr
Dont know. Just test it and check, how many FPS you lose.
Significantly
You're rendering 6 extra cameras on every frame
But who knows, maybe you can budget for it
Did someone ever had this error when selecting a reflection probe?
Error assigning 2D texture to CUBE texture property '_MainTex': Dimensions must match UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Cant bake the reflections and when i select it, i get the error.
(Only in Baked mode)
well.. i found the problem by myself.
I dont know why, but the baked reflections where stored as 2D File instead as a Cubemap and i had to manually change it back to Cubemap
any idea why my pro builder walls look like this after baking given that is has the same material as the ground plane?
a regular probuilder plane looks fine, but this cube with flipped normals looks nuts
hi! I am in need of some help. I have to remove the shadow that is on the gun-likeling object that is in the right of the screen
how do I say the engine to not render shadows on an object
weridly when I detacehd the faces it looked good again
Still looks kinda wonky any idea why?
You can use an unlit shader
probably no Lightmap UVs
how do I generate those
Let me google that for you:
https://docs.unity3d.com/Packages/com.unity.probuilder@4.2/manual/Object_LightmapUVs.html
sorry should'vbe been more specific
Probuilder has a lightmap generated
but the UV's look off, normal planes look normal
You baked the light and it looks like in your screenshot?
yeah
placed a normal plane on top of the probuilder cube to show the difference
after baking
they have the same material
Ok. Show me a screenshot of the Lightmap in the scene view. You can show it by using the sceneviews debug dropdown menu and choose "lightmap"
is that in the shaded dropdown?
yes
follow the thread pls, so we dont spam the channel
I have put some point lights in the room, but some of them acting strange they do not reflect any light back to the ceiling, why is that
Unless you're using a Forward renderer, there is a limit to the number of lights that a material, i,e, your ceiling, can use. From memory I think this currently set to 8 lights per material on URP, but I bake lights so I can't remember what all the details on how to fix this are now.
Yes its maximum 8 lights per mesh.
Ah, per mesh, not material. Per mesh makes more sense ๐
so the only solution is to remove lights?
You need them to be realtime?
No, I am fine with baked
When baking light, you can use as much as you want.
Or use deferred rendering path
But using like 20 realtime lights just to light the ceiling is not really nice when you care a little for performance.
Waiting for forward+ (wasnt it on alpha release already?)
in 2022?
I baked the lights and generated lights from lighting settings, but it seems totally different there is no reflection on ceiling anymore
Have you ever baked lights before?
Yep, its on Released - 2022.2 Beta section on roadmap. Havent had chance to test it but sounds really promising
Not really, I will do some research thanks for your help
Yeah. You have to prepare it a little. This is a great one: https://www.youtube.com/watch?v=hMnetI4-dNY
In this video, you'll gain an understanding of how lights and shadows work in the Universal Render Pipeline, as well as how to set up a scenario with a mix of real-time shadows, Light Probes, and baked GI.
Speaker:
Ciro Continisio
Ask your questions here: https://on.unity.com/2UmP9TE
Did you find this video useful? Room for improvement? Let us...
thanks again
Hello, Is there a way that I can make a black material glow? or is it just not possible. I am using bloom and the emission value of the material
Bloom comes from light, black does not reflect or emit light
An "outline glow" effect which is detached from light would be a different effect entirely
so, how would I do that?
It's not default functionality so you'll need to find a custom solution for it
Dang it
Try to increase the padding or the resolution
Yeah, that helps a little, but it bloats the size
try a padding like 8
It changes it a bit, but still random lightmap seams
can you show the lightmap
Hello, in my scene view the game is dark and looks good but when I play the game is much brighter. How can I fix that?
try if "generate lighting " in the lighting tab does help
I doesn`t help
I'm getting light leaks that fix themselves when the player gets close to them. Changing the shadow distance doesn't seem to fix anything.
The screenshot shows shadow distance at 0 and 40.
close vs far away.
This is what the walls look like in inspector.
fixed it. It was the fade distance on the shadow option for lights.
Any pointers on how to make the lighting less sharp.
as in, make the shadows blend with each other and seem more realistic?
Guys I wanted to put lightning into my parking lot in Unity and it seems like the proccess is taking a relatively long time
Here are my settings, is there anything wrong that I've done here?
These are not the baked lightmapping settings
Though the more pressing issue is that your bake performance is zero
Iโve tried resizing the map and the bake time became lower by a bit, but itโs still taking a ton of time for such a small map with only cubes
Iโve just shut down my computer, so I canโt really display a picture of my lightning render settings, but I am positive they are on default settings
Assuming they are on default, and it still takes 8 straight days to render, what should I do?
The easiest thing to try would be to switch between CPU and GPU baking to see if one of them works better
It's important to have a decently powerful CPU or GPU or baking
I recommend testing bakes in a new blank scene with just some default cubes
The PC I am currently using Unity on does not have the greatest CPU nor GPU on the planetโฆ Is there a specific type of lightning optimized for low-end unity users?
Very unusual to me that the bake process fails to utilize the hardware at all without reporting an error of some kind
It might be that just restarting everything will give it the kick it needs
You can cut bake samples and resolution by something like 50-75% to try to speed up test bakes
Baking is a heavy process in any case
.
Can you show the properties of the light that is casting the shadow. I take it these are real-time lights?
Mixed.
I bake the lighting. I am away from my computer atm.
This is HDRP btw. I just need to know how to modify the harness and softness of a shadow.
The sharp shadows indicate point lights, but you light source looks like an area light or emmisive material. Which are you using?
Point. The emissive material is for the light model.
Change the exposure with a volume.
Yeah so point light has a very small origin and gives sharp shadows. You can change the light size, but it would better to use an area light or emissive material.
Here's an image showing my current settings for my lights, which take up to 1 hour to bake... Is there a way that's a lot quicker to do this?
In this game, all the sides of walls are lighted equally, it uses a directional light
But if I were to make a room like this with a directional light, it would look something like this
Some sides are lighted differently than others
How does Crab game (the game picture) achieve the type of lighting?
Asked this a while ago #๐ปโunity-talk message but forgot to mention that I need it real-time
And ambient lighting helps, but the walls are still not the same
i think this is baked.
If you want to make it realtime, you can only use the Ambient Lighting and some Directional lights i think
This is certainly in realtime using SSAO
I would guess there's also light/shadow layers used, and probably another shadowless directional light pointing opposite to the main light, affecting only the sky walls
Seems a bit too intricate for what it is, but I can't think of any other explanation why some objects don't cast any shadows onto the walls when they should but some others do
unity environment lighting how do i set that up
You seem to have both realtime GI and baked GI enabled. If your lights are static, i.e. they aren't going to move anywhere, then untick the realtime GI checkbox. You probably don't need it for what you are doing.
Also, make sure both your scene objects, (those pillars, ceiling and floors), are set to 'Static', and make sure your object with the emissive texture is set to static too.
I am setting up light probe groups and they are working fine with realtime GI but the moment I reload the project or enter play mode it does not work anymore? is this a bug? also what are solutions for realtime GI?
I've tried to do some stuff and just couldn't get past the UV overrlapping error. As you can see, I got a bunch of UV overrlaps, but I really don't know how to get rid of them.. I've tried following the manual to fixing the overrlapping and can't seem to understand anything of it
Does anyone have a method for fixing UV overrlaps?
@chilly kettle @deft fiber Thanks for the answers, this is definitely a confusing one ๐
I also just thought of maybe 4 lights pointing in all directions, but idk will have to try everything
Thanks
You can ignore the warnings if you don't actually see any baking artefacts.
Currently, after baking, only certain objects seem to have light on them. I suspect this is likely due to the UV overlapping errors. The scene also is quite dark, so do you recommend that I increase the maximum and minimum light bounces so that the scene gets brigther?
I only use emission materials as lighting when generating
I'm not sure of your settings, but try to increase the power of the emissive material. I also usually have my ligtmap size quite low ( 128) to speed up rendering. Try that.
You must enable "generate lightmap UVs" in model import settings
I'll try enabling the "generate lightmap UVs" and adjusting the settings to brianer's suggestion and see what I can get
for now, bunch of thanks to both of you for your kindness
Would the best type of light source for a lamp like this be "Area"? Also, why doesnt it light up the area? https://gyazo.com/029745bc6f5455fa3ff696729555916d
It would best to use a Point light.
The Area light you have is 'Bake' only, so it won't show the light until you bake it.
Thanks! How does that look? https://gyazo.com/e19d8aaa73d5d372ec5eb0256a2e8db2
Looks good ๐
Yeah, I'm experiencing this too. I tested on 2021 and the GI looks really nice. I added some probe groups and dynamic objects were picking up the light changes, so I was quite excited. But as I hit play, the probe group data disappears and my dynamic objects get no lighting. On 2022, the light probes don't recognise the GI at all.
Shame, but I don't think Unity is ready for truly dynamic GI at the moment.
Hope someone here can prove me wrong!
@deft fiber @chilly kettle I have made the lighting, it doesnt look exact because of the textures but the solution is directional lights in all directions
Nice
maybe its one of the solutions
Hello. My problem is that my light goes through walls and floors. I tried everthing that I found in the Internet like use shadows, culling masks etc. can anyone help me?
Guys I am unable to find the option for generating a UV lightmap in the Inspectors element for my 3D objects that created in Unity. How do I find the generate UV lightmap option?
What's wrong with shadows and culling layers?
In the model import settings, but you can't access those for the default cube
And shouldn't have to, not sure why you're having overlap problems
I've found out that the reason is because most of the objects in my scene have 80+ texels in them, whilst my lightmap resolution is only set to 10 so that I get to bake faster
I'm using a low-end PC, and can't bump the resolution to 80, since that will take about a day to bake, so do you kjnow of any way to decrease texels in an object?
it might also not be due to my lightmap resolution, so I will show you my settings:
That seems to be the case
You can decrease objects' "scale in lightmap" in their mesh renderer component
Your lightmapping settings are kind of wack though
I recommend you create a new lighting settings asset with the default values, and reduce them proportionally while following the recommendations here https://docs.unity3d.com/Manual/progressive-lightmapper.htm
For example max bounces 19 is tremendously wasteful, the defaults are 1 and 2 for min and max
Indirect intensity likewise is not something you normally need to modify
Low quality compression doesn't make it any easier to run, just smaller to store while sacrificing its appearance
The last thing is that when building levels out of stretched default cubes you'll always have poor quality UVs and this will be a problem with baked lighting
Thank you a lot! I've reset the settings to default but kept the lightmap resolution to 10. The area light still seems a lot off, and some objects shine a lot more than others. Basically, the way I build my map, which is supposed to be a parking lot, is by using ProBuilder to make an entire huge room (out of a cube), and applied two textures on it; one that's on the floor and one on the walls. That one had 200+ texels, so I decreased the "scale in lightmap" to around 0,01, but I still get error telling me it's overlapping. Also, when baking, it rarely gets any light compared to the pillars
pillars are basically, like you said, streched default cubes, with materials (to be specific, they are planes). They also seem to get too much lightning, and there are pillars that get more light than others, despite the emision lightings being evenly spread around the entire place...
(Image above shows parking lot without any baking lighting)
Is emission lightning neccessary to getting realism in the parking lot? To me, it really seems like emision lightings can get quite complicated. Are there any other realistic alternatives to emision lighting?
Area Lights
need help guys, why dont have shadows and poor light reflections?
@deft fiber do you recommend that I do the entire map building in Blender instead, and then convert it to Unity, since Unity isnโt well optimized for map-building?
What do you guys think?
Build modular assets (a pillar, a floor tile and a ceiling tile) in Blender, export to Unity and create reusable prefabs.
If you go down this route, I also, (highly), recommend this free Blender tool to help simplify the export process:
https://www.youtube.com/watch?v=6WkT2Px5Szg&ab_channel=SilverPhoenix
If you are baking your lightmaps, are your lights set to Mixed and your gameobjects set to Static? Have you enabled Shadows on your interior lights too?
How can I get my static and non-static object to match better in the lighting?
All of my non-static object have really moody and poor lighting, but the static objects look very soft and vibrant lighting.
Heh, never mind. I'm stupid and forgot to apply my liight probes. I am still open to any lighting tips though.
I wonder if switching sun to OnEnable will suit day-night cycle on performance wise?
is someone able to explain the light probes to me?
im confused as to how to use them even after watching multiple tutorials, i feel like im doing something blatantly wrong
Have you watched this one? https://youtu.be/hMnetI4-dNY?t=2584
In this video, you'll gain an understanding of how lights and shadows work in the Universal Render Pipeline, as well as how to set up a scenario with a mix of real-time shadows, Light Probes, and baked GI.
Speaker:
Ciro Continisio
Ask your questions here: https://on.unity.com/2UmP9TE
Did you find this video useful? Room for improvement? Let us...
(starts at the light probe section)
What do you feel you're doing wrong?
im unsure, ive tried placing them in various positions and setups with everything i can find online but it just doesnt change the cube at all, ill watch that now
Light probes are for dynamic objects. They won't affect static ones.
cube is moving
I have to bake after changing them?
๐ ๐
No worries. I feel dumb all the time when it comes to 3D haha
lol yeah i think lighting is my weak point
It can be quite complicated for sure.
is increasing Max Lighmap Size increase the time to bake the scene ?
No
now i an confused, some people said yes some said no lol
Does someone know, why the lightprobes which are near to the blue light behave so weird?
They have a very intense red side, while the other ones around doesn't.
There is no red light near them. They all get lit from the top and two directional lights.
Its just the size of the lightmap. Maybe you mean the Texel Resolution? When you increase this, the time will increase too
does anyone know why my spot light isnt working>?
If your making a 2d game you got to use a 2d spot light im pretty sure
thanks!
Does anyone have any good examples of 2D Lighting for caves
do you, by any chance, know how to add a light to a Fireflies particle system?
as in adding a bit of glow to each particle
Im pretty sure theres like a sub lights thing on the particle system cant remeber though
yea but it needs a source
Make Glowing 2D particle effects in unity using Light Weight Render Pipeline.
Link to the Script : https://forum.unity.com/threads/lwrp-using-2d-lights-in-a-particle-system-emitter.718847/
Join my Discord server : https://discord.gg/VdYCpMedR3
Support me on Patreon : https://www.patreon.com/pixelbug
Download our Game Crash Cloud : https://pl...
This might be some good
thanks!
I'm trying to get a more linear light falloff from realtime lighting, something like the linear example for baked lighting from (https://docs.unity3d.com/Manual/ProgressiveLightmapper-CustomFallOff.html). I'm using HDRP, the closest guide/info I found was about URP (https://forum.unity.com/threads/implementing-linear-falloff-lights-in-urp-shaders.858061/). Do I need to do something similar for HDRP or is it something completely different?
why is my lighting so weird and how can i make it not weird (just trying to have good lighting, i dont want part of my cube to just be black, im not sure if i need shadows as im not going for a realistic feeling. I just want my scene to be well lit but also be able to run on horrible computers (for my friend who doesn't have a gaming laptop. or a pc for that matter) my scene will be a gym.
how long does it take to bake lighting , it's been like this for 10minutes now
switching to cpu solved it
but since its not a powerful one , its gonna take 2hours for few simple lights
^
"weird"?
i'm trying to create some kind of 2D toon shading half-pixel art that works with normal maps in URP. To determine lights direction i just get the distance between player gameobjects center and light. It creates some problems when light is at the center of player or player is half in light. How can i make it so it will be like URPs lit materiaI. I don't know how to describe it but it is like it is working with pixels.
how would i fix this, I've tried searching up solutions and my keywords doesnt seem to give any useful results
oh wait nvm its a quetsoin
yeah
im stupid
yeah lol
Need more info. A picture of the issue would be good, what are lighting settings and what render pipeline are you using. Each pipeline can have different fixes.
anyone?
does anyone know how to make TMP text work with 2d lights in URP?
I dont know where the circle shadow coming from. How can I fix that issue? URP.
I just find out that is from Area light baked only. I am figuring out how to make mystery circle shadow thing to disappear.
Texel invalidity caused by exposed backfaces
https://forum.unity.com/threads/faq-blocky-artifacts-appear-when-i-bake-a-scene-how-can-i-fix-them.951444/
It disappeared! It cause like that from the plane that dont have two side mesh. Thank you for helping!
@deft fiber i think we already had this problem here from someone a while ago.. i think it was something caused by "per pixel lighting"?
But i have no clue how to fix it. Cant get any realtime light on the plane, because its just 4 vertices ๐
Lights can be per pixel or per vertex as defined in quality settings
iirc by default the vertex lights are an automatic fallback for when pixel lights can't be used for some reason
Or the material might be vertex lit but that seems unlikely here
Yeah, i have it per pixel.. but it seams it falls back to per vertex
I don't recall the specifics though and haven't got the time to look into it
No problem
How do I configure ambient lighting for scene?
sun gives light, but it falls only from one direction
one side is pitch black (only emissive fragments are visible), another is enlighted...
I found it, Window > Lighting > Environment
Environment Lighting > Color
any ideas why light leaking after baking?
becomes even worse when enlighten is turned on
@formal flare @candid kiln In both these situations you should prefer connected smooth-shaded corner vertices, but the only surefire way to prevent this is to pad the walls with shadow caster geometry
Messing with shadow depth and normal biases can alleviate the problem somewhat but it won't eliminate it, and will cause other kinds of problems in turn
yeah makes sense, model is just poorly done
Well, sharp and disconnected corners are fine in most cases and with extra shadow casters they're not a problem at all
I guess the "proper" way to do it would be to add a tiny bevel with hardened normals, but it's not always artistically desired and increases vert count
It is sorta more realistic and also reduces errors with light baking though
I wonder if that's also model related thing, bounced lighting keeps showing as pure white
@candid kiln How are your lightmapping settings set up?
It's no mystery with indirect intensity of 5
1 is the default
more or less than that and bounce lighting will be intensified / reduced
This might be a bug idk
It just ignores light color and passing as daylight
is there a way to place the 2d light source so that it only targets the blacksmith?
iirc 2D lights use the same sorting methods as sprites, affecting only things on gameobjects which are adjacent or under them
No
"Target sorting layers" is used in conjuction with Z position, I would presume
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@13.1/manual/2DLightProperties.html
ty, will look into that
Hey guys, i did this portal prop for a game. Right now its with realtime lighting, but i sadly need to eliminate the realtime light for mobile later.
I am wondering if someone has an idea to get this look and also keep the possibility to switch the orange to a blue color ๐
Right now i can switch the orange Emissions and realtime light to blue completly.
I saw a guy who wrote a shader where he multiplied lightmaps he prebaked.. i am wondering if this works or if there is a better/faster way.
trying to make a 2D sprite light up with 3D lighting
would putting it on a quad in blender do the trick?
for context. trying to make a game like dont starve
I just did accidentally did something to my lighting effects by mistake and now I'm not sure how to get it back. Maybe its my Post Processing Profile? Here is the prefab of this gun that I have (what it should look like)
yet here it is rendered in the game
All I believe I did was just duplicate the scene in order to make a 2nd version of the map and maybe that ended up changing something (not sure why this would at all be the case but thats what I was doing at the time)
I guess restarting Unity solved the issue? If anyone could tell me why that happened I'd love to know
how can i delete the baked lights
Thanks
I just noticed static geometry with baked lighting data were affected by realtime Directional light. Doesn't that defeat the purpose of having baked lighting ?
Baking lights is just the more performant way compared to realtime.
If you need additional realtime lights, you can use them.
@chilly kettle I am worried about performance. I have a directional light that is set to Baked mode, and it lights my whole environment. The environment never moves. I have only 1 dynamic objects that stays in the middle of the scene and the camera turns around it. I use a realtime light for this mesh.
But the realtime light affects my whole environnment and I feel like I am paying the price of realtime lighting when I really don't want it.
I have swapped lighting layers for my environnement, so they don't receive the realtime lighting no more, but the dynamic object doesn't cast shadow in the floor anymore !
Why do I bake light if I am going to be forced to use the realtime lighting anyway ? I am kinda confused
if you bake lights for your Environment and have dynamic objects in it, you can use Lightprobes.
Lightprobes "take" the light of the baked environment and apply it on the dynamic object.
But in this case, you have no shadow from the dynamic object.
If you want to have the advantage of baked lighting AND a realtime light on the dynamic object, you have to use mixed instead of baked lighting.
@chilly kettle Makes total sense, thank you ! I had moved away from mixed lighting because I was having some issue because I need to swap lightmaps at runtime. Only the last mixed light bake would remain baked, it would switch to realtime lighting for the first bake as soon as I changed scene. Guess my only option is to figure out why !
normally lights dont switch themselves ๐
i think it MAY LOOK LIKE its realtime, but its only the realtime part of the mixed light.
Oh yeah this is what I meant, like the object that were previously treated as baked are now treated as realtime/dynamic. The lights remain Mixed
Why do you want to switch lightmap?
We have two different mode for each scene, a night mode when content is locked, and a day mode when content is unlocked. I made a tool that switches lightmaps for every mesh renderer, light probes, skybox, reflection probe etc. But there is still this one issue. It works 100% fine when I just did the 2 bakes, but if I leave the scene and come back, only the last bake I did have the mixed lights behaving correctly, it gets really expensive.
There are different types of baked lighting which can combine baked and realtime lights in different ways
https://docs.unity3d.com/Manual/lighting-mode.html
I believe in "subtractive" mode static geometry will get no realtime lighting once baked
@deft fiber thank you ! This is exactly what I was reading on. I already use subtractive. I think the problem comes from the mixed lights thinking it doesn't have baked information on meshes, so it revert to realtime lighting, even if it does have baked information but from previous bakes... I would need to figure out a way to convince the mixed lights they don't need to use realtime lighting on static object.
I'll try using the same Mixed light (but changes its parameters) in day and night instead of having 2 separate mixed light, one for each bake. I think this might be where the problem is coming from. Weird that it doesn't happen until I leave the scene and come back though
Mixed lights don't "think" or make decisions of any sort
Each lighting mode treats each type of light according to its logic once the scene has been baked
I feel you're overcomplicating it
@deft fiber I feel you are discarding my claims too quickly
I guess the true mystery is why the lights (or surfaces) stop following those rules when you switch the lightmaps
@deft fiber turns out it was as I expected, redid everything with a single Mixed Light on which I change lighting settings (Shadows, color, intensity) instead of using separate ones that I used to toggle on and off and it behaves as expected !
i have a "Main-Light" set to Mixed and Subtractive. When i bake the Scene (see settings below) it looks like this (blurry baked shadows, like expected).
But when i start the game, it seams to fall back to crisp realtime shadows, and when i stop the game, by bake seam to be gone. How could that be?
How do i make a dynamic object emit light? this might be a stupid question but ive searched for a bit now and cant seem to find a straight answer
Attach a light as a child object
Or use emissive materials and light probes
that doesnt emit from the surface though
and you have to bake emissive materials no?
im talking about a moving object
on the unity docs there is an option for realtime but i think it got removed
I never got realtime global illumination working with dynamic objects.
But you can fake what you need by having an emissive material on your game object and have a light of the same colour.
ah ok i see thank you
is there any way to prevent ambient light from affecting a certain layer? I want the layer to be able to be effected by other lights, just not ambient lighting. Using URP
i asked somewhere else and turns out its just a realtime lighting thing
Which is what my advice is meant to mitigate
Could this be a LOD problem of the trees? But.. why is my cube also losing its baked shadow on the ground ๐
is there a way to create a collider that does not allow light to pass through? (2D)
Shadow Caster 2D component stops light
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@12.1/manual/2DShadows.html
Materials emitting light at runtime isn't possible without ray tracing, you'll have to use Brianer's workaround
Enlighten can handle light emissive materials, but not move them, only change their color or intensity
thx
Is there anyway to tint my shadows blue without tinting the rest of my game blue? I'
I've tried multiple options but it always results in the entire game having a blue tint and looking bad
I've seen other games do it so Im just curious on how to replicate that effect
Ambient light color = shadow color
In your example the blue ambient light is applied to everything, though mostly the top part by sampling a cubemap / environment probes which are lit blue mostly just from above
You can counteract the blueness of lit surfaces by making the directional light more orange
@deft fiber do you have sort of an idea? I am burned out ๐
Unfortunately no, I'd just google around and test trying to isolate the issue
Im pretty new to lighting but i got this problem where some lights are brighter than others even though they all have the same settings
This is the setting all the lights use
hello
i have a moon in the sky (basicly a giant glowing sphere with lens flare) , when i turn on fog that goes away, is there is anyway to make it ignore fog?
hello can anyone help me here? so when i start my game the light starts like this but when i die and go back to starting position my light changes... help pls
I know it has something to do with this but i idk what to do
Make a light setting and attach it
and remove the
Baked global
Illumination
Try if that works
how can i do that and here do i do that ?
oh i see
and go to ur lightning
and bake it again
and try again
that game is from brackeys right?
yes
did it work?
nop
is this ?
yes
do i put off or on ?
off
im having trouble getting a point light to cast shadows in URP, if i switch it to directional light with the exact same settings, it casts shadows fine. I have additional lights cast shadows set in my URP asset
it wasnt using my urp asset ><
anyone know why bakery and xatlas are doing this to my scene? (It's not supposed to be blue). Generate lightmap UVs is checked for all items.
Looks like some of the lights are falling back to vertex lighting, and since the floor doesn't have many vertices the light will be dim
You can define light limits and fallbacks in quality settings
hello im pretty new to unity so sorry if this is a dumb question but how do i change the lighting of a room? basically i want everything to be dark except where you shine your light
Set the environtment light to black in the lighting settings
okay thanks
Thats Texel Invalidity
What does that mean
Use the scene debugger to have a look on the texel invalidity
okay, this is what I see
its on the door
possibly a wrong sided normal
np ๐
Does someone know, why the resolutions of the UVs on the objects are completly different? They all have the same "Generate Lightmap UVs" Setting.
is it because the bench has so many parts that are split?
I'm also interested in the answer to above ๐ I get the same thing between assets that has the same texel density set in Blender.
looks like the only way is to increase the lightmap resolution in the gameobject
Yeah, It's weird that this is happening. Doing that I guess is a workaround. It will still be hard to match the exact texel size.
It could be that your model Uv's have different scales? Look into texel density. You can also change the scale of your objects lightmap UV's n your game object.
It happens to me though even though the texel density is the same for my objects.
anyway to make an UV map like this, be emissive and correspond to the colour?
or do i have to create separated materials for each emissive colored light i want? ๐ฆ
or at least fake it is glowing?
idk it changes anything ๐
OK! it looks like i would need an emissive texture, which does not exist at the moment, alright?
Correct, you could use that texture as your emissivie texture and see what happens.
How you align them to the uvs of your models depends on what you are trying to achieve.
i tried, but it just looks like a colored object without any emission
Can you show us your material settings please. And are you on lwrp, urp or hdrp?
well, i tried the default one, now i am trying the URP one!
what i was looking for actually is a bloom effect!
@little condor i noticed that actually the gloom would be too much for some models i want, so i am better just interpolating textures of emission off (which are more gray) to the emissive ON which are more colourful... i think it still gets what i want
as i will try to keep the game running on the lowest hardware as possible
Urp seems to a little different to hdrp, which is what I use. On hdrp there are some sliders to set the intensity of the emission.
I wanna make a dungeon game but I'm awful at lighting, I really don't know how people get good results. This image is just some basic thing I slapped together tonight
I wanna know how I go from that, to something like this
obviously my scene is very empty and the colours are pretty dull, but even if that were fixed the lighting wouldn't be good, right now I've just got a single directional light
also please ping if you answer
Clearly need some more lights (those torches) and some post processing effects to get more contrast and saturation (maybe ACES tonemapping too). Most likely getting as good results as seen there would require some custom stylized low poly shaders, default unity shaders may not be good enough with post processing either
whenever I add point lights they just look really bad, idk, shader does sound like something that could help, though I've never looked into low poly stylised shaders before
and ACES yeah, standard lmao gotta have it
I could go the unlit (or semi unlit - there's a directional on very low light) that could work
would just need to play around with the colours so it wasn't so whitewashed
Yeah, more textures/details and colors
textures is something I basically never really do, just because I'm bad at art
I can however do gradients and or textures made via shaders (just baking the shader to a texture)
but yes I agree with all you've said so far so thanks a lot
These are no real textures.
Only Flat colors from one texture sheet.
looks like shadow acne:
https://docs.unity3d.com/Manual/ShadowPerformance.html
Thx, gonna check that ๐
I know but the lighting is better
Looks like baked (or otherwise ray traced) lighting mostly lit by a skybox
Any idea why this is happening? I'm using baked lighting and these weird lines are showing up
Reflections? ๐
Nevermind, fixed the issue
don't tell us what it was then
It was incorrect baking and object settings, mainly not generating lightmap UVs
Can anyone explain strange changes in lighting occurring on the ground and trees?
Toward the beginning, as the ship goes through the first canyon, the ground gets totally shadowed at the same pace as the ship/camera. Later, you can see some trees appearing bright and then getting way darker when the ship/camera gets closer. Not sure what's causing this.
Did you tried to change the shadow distance?
how do i get lighting working in urp?
By changing the Near Plane settings under Shadow Type, right? I tried that, but nothing changed. I adjusted the Strength and Biases, and but that also didn't change the weird way the shadow seems to follow the ship/camera. Unless there's another way?
No. Near plane has nothing to do with the shadow distance ^^
Oh haha my bad, I'm still a novice. So how can I fiddle with the shadow distance after all?
Are you using URP?
I don't think so, under Graphics in Project Settings, the Render Pipeline field is just None.
So I'm just using the Built-in Render Pipeline. I haven't learned yet what the difference is.
You should have a Render Pipeline Asset there?
if yes, you can click on this asset and change the settings for shadows etc. there
Ah, yeah, for me that's just set to None.
Then you should be able to create one (for me there are URP Settings, because i use URP)
I seee. So even though I'm using Built-in, it still let me change the Shadow Distance, so I saw what you were talking about! That helped a bit, that shadow effect still occurs but only smaller when the ship/camera is close to something. As for creating a Render Pipeline, weirdly enough I don't have that Rendering option under Create. It's just not there. Not sure how I can get it then.
I never used Built-in. Maybe this does not exist there ^^
Ahhh. Any idea how to switch my game to URP? Not sure if that's possible to do mid-creation.
Not that easy, and never done by me.
And you should know, which Render Pipeline you choose, based on the needs of your game.
There are several Tutorials on YT for this ๐
Thanks for the heads up! Odds are my shadow issue has something to do with that then. I appreciate it!
Looks like it, when something changed depending on the range from the camera, itโs mostly a settings thing. Or maybe LODs
Hey guy, can you help me figure out why it's doing this?
It only happens after play mode...
is it normal for Enlighten to take 1hr to precompute a small scene?:
No
Whats your reason to use enlighten?
does anybody know why when i make some lightning it doesent make light๐
i just add a lightning example a point light and it give me the light prefab but no light is comin out of it
turned off light?
nope I can see Directional Light its everything else
nevermind i found out thanks
the Directional Light was too high
@chilly gazelle The cause is indeed shadow distance
But render pipeline doesn't have anything to do with it