#archived-lighting
1 messages · Page 21 of 1
Thats correct
i will check the generate lightmaps uvs
hold on...
i think im onto something
hmmm...
to weird for words
it looks like it did something though
can you go to the scene view
hi, need some help with baking light. I'm trying to bake light for a large level, and for objects that are very far away from the world origin (over 2000 units away), the baked light has very weird artifacts and doesn't look right at all. If I move them closer to the world origin it will bake perfectly. Any way to make light bake properly for far away objects?
can you share comparison images?
i tested it in an empty scene, first pic the object is at around X -1000 , second pic the object is at over X -2000
the same happens in the actual level
interesting, can you show a side-by-side of the baked lightmap debug view?
I have a feeling that what's changing is the realtime light (?)
if that's mixed
welp ok that makes it clearer 😅
can you file a !bug
🪲 To make bug reporting as quickly as possible, we made a bug reporting application for you. When running Unity choose Help->Report a Bug in the menu, or you can access it directly through the executable in the directory where Unity is installed. It will also launch automatically if you experience a crash.
📝 If your bug report is to do with Documentation, either an error, typo, or omission, you can report it by scrolling to the bottom of the page where you found the issue and click ‘Report a problem on this page’!
💡If your report is to do with a new feature idea, you can check the Unity Product Roadmaps page to see if your idea has already been planned.
For more complete instructions on how to report bugs, access: https://unity3d.com/unity/qa/bug-reporting
not that I know of right now, only to bake the scenes individually and load them in tiles. it suprises me that this happens with x -2000 though, it seems like a relatively low value 
ah ok, thanks anyway 
maybe you can try to increase the pushoff value in the lightmap parameters (not the lighting settings 😄)
you'll need to make your own asset and increase the pushoff value to something higher, maybe 0.1? this maybe is floating point errors
OH THAT WORKED
don't raise it too much though because that will mess things up as well
Thank you. I’ll check this out
I have a problem with unity lighting...
(using baked lights)
its been a long time since ive had to light stuff... but still, this is what it feels like
I have a reflection probe, I have a box that includes the whole scene, everything is static, everything has lightmap UV's, the bounces is set to 5, everything should be correct... but still its like... the above image.
In my experience baked lighting is specifically the opposite of that since it uses real world accurate inverse square falloff, plus the extra smoothness you get from bounce lighting
Which is probably the same technique Unreal uses as well
Just ensure that light range is not too low, especially if using mixed lights
In URP and HDRP realtime lights also use inverse square falloff, though in BiRP they use linear falloff
the only way I seem to be able to overcome this, if I want general mood lighting, is to set the radius to like 2000 and the intensity to 10,000 which seems very wrong. unity just desaturates everything so if your not trying to make bland realism lights your just sol.
and im talking unreal 3, not unreal 4 or 5, but if they are anything like 3 the falloff value is exposed so using the inverse square law is optional.
What render pipeline are you using and what is your scene like?
You also need to be using linear color space and HDR tonemapping for lights not to blow out
You generally should never need that high of a range, and only HDRP uses that high intensities because it uses real world light intensity units
ill look into it
I work for a studio, albeit a small one without many experts in 3d yet, so there are certain questions I can't answer 😛
Hi Ive been having an issue
where I use an HDRI reflection probe
and it relfects onto this smooth texture I have for the phone screen
I dont want these reflections
my suspicion is that it is reflecing the curtains
which is the map used how can I get around this so it doesn't reflect the map as well
what is your material? in hdrp or urp? try making the material non-metallic to remove the reflection completely. you can also reduce smoothness to make the reflection more diffuse
yes it was HDRP i just changed the map on the reflection probe and it worked
so lol wasnt too bad
this site was pretty good
baked lightings are too much brighter than realtime . how to fix it
NOTE - I am using gamma colorspace and Standard Render Pipeline
this is the realtime lighted one
can anyone also pls share resources , how to properly light an interior of horror game , like which lights to setup and where .
As I said realtime lighting has no bounce/indirect light, so you'll need to consider that when designing lighting
Note that there is no "standard render pipeline"
You probably mean "built-in render pipeline"
All three render pipelines are equally "standard" at this point, and the word is not used to avoid confusion with the term "scriptable render pipeline" or SRP
I'm not aware of such resources
You may have to find resources about Unity's baked lightmapping and about lighting in general, and by practicing those learn how to get specific results
Hello, I am kinda at loss here, I don't know why the lightning has this green hue (pic1)
The crate FBX looks like in pic 2 in blender.
Can anyone help me point to what i'm doing wrong? Pic3 is directional light settings
Disable compression and set filtering to point for your palette texture
Huge thanks
Can anyone help me? When I bake my lighting, my lighting isn’t showing
Hi, i make a 3d character and the area that uv split on the head look like this. Any clue how to solve this problem ?
Usually this suggests a problem with the normal map
Perhaps it's not of "type: normal map"
But it could be also just an incorrectly produced normal map, or in wrong format (GL vs DX)
Or the mesh normals could be wrong
I'd test without a normal and with different normal maps
So I'm checking out if integrating raytraced shadows is an option for my project to achieve higher fidelity shadows for high end users (as shadow filtering is broken as fuck right now)
But I'm running in to the issue where raytraced shadows will only shadow one object, and completely ignore the rest
When I then duplicate one of the ignored objects it will start shadowing that one, but not the one it did previously
All objects have the same shadow casting settings, and the maximum screen space shadows has been adjusted to a super high count to see if that would work
Which render pipeline? What type of RT shadows are you using?
HD render pipeline, and using the raytraced shadows option set up in the way unity describes it (so enabling raytracing > enabling screen space shadows in hdrp asset > enable raytracing option on a point light shadowmap setting) HDRP wizard confirms the project is set up correctly
That's important info, but not a feature I'm specifically familiar with
Unless someone who is happens by, you could repost in #archived-hdrp after a reasonable time delay
Hi,
I've been trying to bake the light in my scene on Unity URP for several times now. Every time, no matter what I modify, I get huge black squares on my models and the light doesn't bake well.
I use my GPU to bake the lights. After some research, I understand that it doesn't always give the best results, but I'd be surprised if it did. The problem is that with the CPU it takes too long (a day).
Thanks!
(the pictures represent the baked lightmaps)
yeah . i baked lightmaps and the results are good this time becz
i switched to linear color space . doing this realtime and baked lightmaps looked same (added with some cool softshadows).
I still have no knowledge about pipelines tho ,
thxx
Noise/fireflies can have many causes
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/ multiple chapters here depict similar issues
You can decrease samples and particularly resolution for a big reduction in bake time
And disable objects for test bakes
I see on the outside of the building what also looks like UV overlap
Thank you very much for sharing this, I think I found what I was looking for. It is wierd I had read this post from unity : https://blog.unity.com/engine-platform/5-common-lightmapping-problems-and-tips-to-help-you-fix-them but it did not contain this chapter 🧐
ok thanks for the tip
The street lights "come on" as the camera gets closer to them.. Can anyone explain what's happening and how I edit this? Using HDRP and 2022.3.11
Hey, just started my first hdrp project. For some reason i get this weird bloom effect which you can see whenever i look up in the sky. What is the cause of that and how can i fix this?
i am using the HDRI Sky override on the global volume component
Volumetrics on the light (Sun) maybe?
maybe something to do with adaptive exposure on the camera?
Looks to me it's the volumetric fog distance
It is, thanks
Is there some way of getting a pixel's position in world space in the fragment Shader? I need the x and z positions to calculate the normal
Yeah you can get the fragment position, but you can get the geometry normal just as easily
is the geometry normal already calculated?
Didint fix it
These are the settings for the camera.
Those are not the exposure volume settings
Because the sky is massively darker than the lit ground and your exposure is trying to adapt to one of the two, it results in massive difference in brightness
Alright, where do i find them?
Oh, my shader is with code, not visual
"sky and fog volume" is where your current overrides are most likely
oh i am so sorry, i didnt even noitce this object was in the scene... shouldnt be there... deleted it, but didnt fix the problem
You could ask in #archived-shaders or try to find a code example
It should be one of the most basic things
Okay, thank you
You need at least a volume with exposure override since you're using HDRP
Not sure why delete it, unless you already configured another one
Yes had another one...
Okay i know of this override and added it to the global volume. None of the modes really change anything
As always with HDRP it's easier to work off the default setup
created a new scene, same problem xD i dont get it, tried different hdris... didnt do the trick either
The ground is too bright compared to the sky for automatic exposure
You should dim the lighting, boost sky exposure or tweak the automatic exposure settings / use fixed exposure instead
Reducing the light intesity and chaning the global volume override "Hdri Sky" to "Exposure" and then lowering it did it.
Thanks
When exporting my textures created within Substance Painter into Unity, they are not as bright and saturated. Is there are way to recover the original quality of those colors or at least mimic them? So far, changing the shader to Unlit has brought the colors closest to the original, however, doing so does not allow for shadows to be received or casted
what is the best approach to when the player turns on a generator, a bunch of lights at an area turns on? i could just do something like turn the game objects on, but the problem is, these are all realtime lighting so optimization and performance can be an issue, how can i do something like this where the lights are baked? im assuming id have to switch scenes right? thanks
I would guess they are the same texture, but the HDRi you have in substance painter is brighter and has warmer colors than the sky you have in Unity
Realtime lights are by far the simplest way to make lights that can turn on and off
Baked lightmaps can be swapped at runtime using various techniques, but there's not really any official workflow for it
Scene switching can be an option, especially if you're using additive scenes but it may be hard to make seamless
anyone know why my point light doesn't light up every angle?
Looks like a normal map issue
Most likely the normal map texture is not of type: normal map
Sadly already checked that, I've tried with different materials also and I'm getting the same issue
is this baked?
nope
If you remove the normal map entirely from the material, I expect it the weird shadowing would not happen
hey, i am following a tutorial on youtube and i realised my shadows are very ugly... how do i fix this? first pic is mine and second pic i how i want it
What kind of tutorial?
Shadows can break like this if the normals used for shading don't match the geometry that's used for shadow casting, since normally shading hides the shadow border
its sebastian lagues video on procedual planets
And since you're using HDRP the shadows require TAA to be filtered smoothly which you won't have by default in scene view
Anyway the problem most likely is that your mesh normals aren't being deformed or aren't being recalculated to the deformed mesh
You can disable shadow casting to make the ugly jaggies go away, but the shading will likely still be incorrect
how do i enable TAA
Scene window has that option in one of the dropdowns, and it must be set to "always refresh"
Or you can preview it using the game window
Assuming it's enabled there
hmm didnt help much
i calculate normals by grabbing each vertex and doing m_normals[i] = vertecies[i].normalized and afterwards mesh.normals = m_normals
i figured out the shadows sort of, nect problem
see that the bumps on the sphere have a more bright color?
well mine dont
seems like i dindnt calculate the normals right...
all good!
i just used mesh.RecalculateNormals() which creates seams, but i will figure that out later
what could make my shadows jump around like this? https://www.youtube.com/watch?v=f34lrjvq5bE
watch the trees
i see, im thinking that instead of turning all the lights at ones, i will create a sphere around the player and all the lights that is within the range are the ones only turned on to save performance, is that a good idea?
Only if you need to do that
Realtime light cost in forward rendering path is proportional to complexity of meshes that are rendered in the range of lights, so LODs and mesh culling also cull lights effectively
In deferred rendering path lighting is only calculated for each screen pixel so trying to cull lights probably itself more computationally expensive than the lights
Shadow casting is another story, but that's why there's the shadow distance settings
can you explain it simpler terms? I can't really understand it my apologiess
What part does not seem understandable
the rendering paths
i still have no idea about lighting so thats why
Hey i need help adding indoor lighting into my game. I have an asset that has emission but its not casting any light really and i dunno how to use emission stuff
which pipeline are you using?
ok.. for what are you using a material with emission?
cuz if its for smth like light bulbs/lamps you can just place a (colored) light source
ok, then you just create a light source (right click on hierarchy > Lights) and place it where your light bulb is
if you want your emissive material to glow (not actually emitting light, just the "glow effect" itself on the camera), you need to bloom as a post processing effect
Okay so how 1. Which kind of light? Directional, spot, area? And also 2. How do i keep it from going through the walls into the other room
-
depends: the image below represents how light is disturbed from different kind of light sources. E.g. Spot light is optimal for ceiling lights, point lights for candles or fires, etc...
-
is more complicated. You'd have to post an image of your scene for that first (prpbably its because of walls not casting shadows but there are other reasons for light leaks)
yea you've to add the light, it wont work if you just use emission (except if you use global illumination but thats another topic)
okay so what light is best? Spot?
yes, you place them under your models. make sure they have anough range and intensity and they look down as well.
abviously if your emissive material is purple, you want to color the light purple too if thats what ur goinh for
so i did it, but its leaking through the walls to the next room
or do i even want the light to light up the whole room?
I made it so where it was really a spot, but the problem is that you cant see the cieling at all, and the light is still leaking
to prevent it leaking: go to your light and under "shadow type" select anything other than "no shadows"
now its not lighting up the room just the pod that i have in there on the right wall
place the light just a little bit under your lamps so it is not inside any geometry
if that doesnt fix it, please send an image
like inside the room or outside the room? bc rn its above the cieling
yea the light should be under the ceiling so its inside the room
ah oki
So its not going through the walls into other rooms anymore, but it is going through to the rock outside
but it fixed everything else
the rock outside is illuminated by the sun (the directional light) in your scene. if you dont want that, just disable the directional light in your scene
is the rock under the room?
yea should it be above?
yea i just moved it above in the hierarchy and its still doing it
nope but that means your floor in the room does not cast shadows. click on the floor and navigate to its mesh renderer. Then set Lighting > Cast shadows to On/Doublesided
nono i mean is the rock under the room in the actual scene/game
nooo ill rotate and show
its beside of it
also the floor is already casting shadows
type Light in the search box of your hierarchy. Go through every light in your scene and disable all lights where it says that it is directional (as seen in the image)
The bed below is lit by the spotlight, the bed above by a directional light (as an example)
still happening
🤨 maybe theres other light facing to the rock or theres something weird with the rocks material
the only light i have are the directional lights which are disabled and the 3 spot lights i have.
this spot light is the only one effecting the rock
for some reason the rocks material is a vertex color, would that have something to do with it?
can you show the rocks material
change it to a lit shader. if you want that look, increase the metallness/moothness then accordingly
🔥
Hey is it better to have these lights baked or realtime
Thats a complicated story.. id recomend you watching some tutorials on that on yt or smth. Basically realtime means the light emitted from the source is always dynamic and lits its environment. Baked light does not emit light - its ligth is used and received by static objects (objects that dont move) - and when you bake the global illumination for your scene (which can based on complexity of your scenes geometry take a VERY long time) the light is used for illuminating the environment.
Tldr:
Realtime: Low Quality / More Performance Heavy / Easy to use and fits with almost all usecases
Baked: Very high lighting quality / Almost no performance hits / .. The big cons: Takes a very long amount of time and isnt very adaptive + can only be used with static objects (everytime you move a object the whole scene needs to be baked agains completely)
what could be causing my shadows to move like this with the camera? notice the tree shadows in particular.
okay thats a great description. thank you
I can't fix these lines. And yes compression is disabled
Using Radeon Pro and A-Trous filtering does make it much better, but its still there
How can I make less smoothed, more solid baked shadows?
I don't remember how exactly, but you need to increase the resolution of your shadowmask
It might be tied to lightmapping settings but I'm not sure
does anyone know what the cause of these lightmap artifacts is?
Texel invalidity and UV overlap
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/
Chapters 9 and 15
Lightmaps are limited to texture pixel resolution (which have to be pretty low for large areas), so there isn't much of a way
Increasing resolution would improve the appearance though, and additionally it's possible to apply effects to the lightmap using shaders for example to posterize it
But that's tricky and an advanced topic
This is called color banding which occurs because our monitors are limited to a meager 16 million colors
If the color banding is from a mixed/realtime light you may be able to enable "dithering" that will smudge the lines
If the bands are on the texture itself I don't know if there's any way to fix it, short of applying similar dithering in an image editing program using some context sensitive algorithm
Looks like it's realtime though
And if it isn't, almost any kind of texture on the wall will conceal the bands
there are lots of debug visualizations in the scene view that can help with this
Most games suffer from color banding but you don't really notice it
You usually prevent color banding by not creating huge smooth gradients
e.g. by giving the wall some texture
like this!
There's still banding if you squint, but it's a lot harder to notice
We think the same way!
The specific chapters in my link give a link to the docs where all GI visualization modes can be found, but I admit I didn't try to spare the legwork in this case
oh yeah, I just thought I should throw that out there
so i'm having a strange issue with SpriteRenderers casting shadows for the wrong sprite!
notice the trees in the top left, how they are casting a shadow for the big tree instead of the skinny tree.
and as i walk around the scene they switch between the different types of trees seemingly at random
like if i go here the skinny trees have appropriate shadows again
A very strange problem, I'd guess something related to sprite batching
Sprite renderers are not really designed for use with lit shaders, and HDRP which I recall you using is not really designed for any 2D renderers so those can be sources of all kinds of weirdness
i wouldn't even know where to begin with debugging
and it's really annoying and distracting
Frame debugger may give some clues at what stage the problem is happening, and could reveal if sprites use sprite batching or SRP batching to give some direction of how to poke that
Could also port a test scene into URP to see if that fares better
Hi guys I have a quick question, so whenever I change scene, the lightning looks weird compared to when played each scene separately (what I meant is if I played from scene 1 teleports to scene two , the lightning is ruined in scene 2.) so it got fixed by making auto generated lightning (fixed) although when I build the game, it was stuck on gl data build for over an hour / while compared I turn auto generative lightning off the problem of long build wait time is gone, but when I click played and tried changing scenes in-game lightning is now ruined. Is there anyway I can fix the problem? Thanks!
Disable auto generate lighting and generate lighting manually for each scene
Also disable Baked Global Illumination for scenes that do not need to use baked lightmapping before generating
Thank you!
I think I might just try moving to URP. I mean so far I failed to get the post processing to have the look I wanted out of HDRP in the first place anyway and my frame rate is already lower than it should be (though that's much more likely my fault in scripts somewhere lol). I might not have to fight URP so much to make 2d elements work properly in 3D and it should give some extra processing time headroom.
What does the downgrade process look like?
You'd have to make the materials and post process volumes again and probably tweak lights as well
There's not yet a "downgrade process" so it's manual work
I'll need to redo all my shaders too right?
Shader Graphs can have multiple target render pipelines so that should be a way to make them compatible, save for RP-specific nodes
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/ chapter 9 for UV issues
Chapter 15 for invalid texel issues if they persist after you fix the UVs
Hi! I'm trying to make a scene with light switches in a house, but I'd like the lighting to be baked. Is there any solution to having "local" lightmaps for a room (as in multiple smaller lightmaps)? I think it'd be easier than creating multiple lightmaps that are switched between every possible lighting combination throughout the house. Though if it's not possible I may just have to do that
No official solution, but some third party ones
Realtime lights are easier for switchable lighting because of that
Technically you could additively blend as many lightmaps as you want, but the shaders of all lit objects then would need the functionality to be able to sample multiple lightmaps which is tricky especially for shader compatibility
Also, light probes and reflection probes would not update which are also important for accurate baked lighting
They'd need a system of their own to do some kind of switching or blending
Hmm I see. Do you know of any 3rd party solutions to it?
I recall seeing some lightmap swappers on the asset store but that's all I know
There could be free ones too
You'll probably find different kinds either designed for switchable lighting, or for day/night cycle lighting
Enlighten realtime GI is still in the engine, even if deprecated it should work fine
What would that solve though? I want baked lighting for performance and better looking lighting purposes
englighten bakes the light in smaller lightmaps so they are updated in realtime
you can also have both
for realtime lights use realtime GI and for lights that dont change use baked GI
Definitely worth seeing how Enlighten handles the scene
the only thing is that enlighten doesnt work with the new APV's
When I bake a reflection probe it seems to be baking from the wrong position, causing super bad reflections. Realtime, it correctly renders from its set point.
what version + srp?
Hello, could anybody explain me why I still got light bleeding through walls despite having thick walls? I've already played with the bias but can't find a proper settings to make it disappear. I don't get it.
My wall is technically one inner wall and one outer wall if that has any impact
Using 2022.3.9f1 and HDRP
Ok some more testing, I've disabled SSGI to see how it goes and the direct light does bleed
Scaling the outer wall to 2, the bleeding stops but the light access gets messed up. What's the minimum wall thickness needed to not have bleeding?
Plus I'm not a fan of making walls too thick since it would make shadows look strange at certain angles depending on the time of day. What other techniques do we have to fix light bleeding?
ok, settings shadow resolution to 4096 on the directional light did fix the bleeding but at low quality settings, the whole room is fully bright...
How to get a proper dark room in low settings too? I'm quite lost here...
urp lights are only showing in unity scene and not in game view, they have the correct sprite-lit-default texture
I couldnt fix this issue yet
I made a new scene and copy and pasted stuff from the old to the new one and it is working now!
Suppose, I have a scene which requires 2 days to have the lighting baked (using progressive cpu)
In my region, often blackout(loadshedding) occurs, in that case, How can I keep the baking Progress not to restart from the beginning everytime for stupid absence of electricity?
is there any way? im not even sure with my ups backup, as cpu uses it's 100% when baking, the ups cant hold much for long.
having another source of power, like a charged battery that can support ur pc during ausency of electricity
if anyone can help, i need my player model to be completely unaffected by light. you should be able to see the player when they're in front of you as if it was in a lit room
right now you can barely see it, however it's not because of the light intensity, but the skybox
the material unlit which will make it completely unaffected by any kind of light
2022.3.11 and latest urp version. Clearing the gi cache seems to have fixed it somehow.
unlit shader
i just imported an fbx model and i made the material in blender, but i can't get the "material 0.001" to change to unlit. how could i do this?
You need to extract the materials from your FBX in the inspector. Then you'll be able to change it.
Or alternatively use "on demand remap" to assign new materials, or assign them at prefab-level
how would one go about that?
I have looked around for a few hours and have not found a fix to my issue. I have really odd lighting on objects when baking my lighting. I use these same lighting settings in another scene and it works great. The objects are ProBuilder objects, along with most objects in the working scene. Are there any guides to fix this issue? If not any tips?
generate lightmap uv's for the probuilder objects
there is a button in the probuilder window that generates uv's for all objects in the scene
is that doesnt work increase the lightmap resolution to something like 32 for the probuilder objects
also keep the lightmap resolution to a number thats ^2
like 2, 4, 8, 16, 32, 64, etc
I am going to try these, I will let you know if they work.
I tried those fixes with no luck. I thought to share a video with what the rendering looks like; I have never seen something like this.
It still looks like UV overlap as mentioned and that's what the console seems to be telling you also
You can use the scene window debug views to preview for UV overlap issues, and another view can be found in the Baked Lightmaps tab by previewing the lightmaps there
Once you've fixed the UV overlap you should look into texel invalidity issues if those pixelated artifacts persist
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/
Chapter 9 for UV problems and 15 for invalid texels
Just note that invalid texel artifacts can appear anywhere if you don't have correct lightmap UVs, even if there actually is no texel invalidity
so do metal shaders not interact with the light map or light probes or something
someone told me they usually dont care if you are in a shadow
how do I get a shader that uses reflection probes to actually respond if I'm in a dark area etc.
im using the URP with baked lighting
I have this environment for example
and it doesn't seem to care if I'm in a dark area or not
whereas if I disable the metallic aspect of this shader it does
if an object is purely metallic then essentially its being shaded only by what its reflecting, not what its being lit by if that makes sense
so if you have an object that is pure metallic, yet its appearance doesn't change when you move around the room, then the problem is the reflection
does it not see that the area over there is dark?
I dont even really want reflections
I just want it to look shiny
in blender you can just do a specular style of lighting but it doesnt seem to work like that in URP
what is the problem with the reflection
Then instead of making it fully metalic find a balance between metalic and specularity
and also its because URP is PBR based, I remember we discussed this a while back and your aiming for more old school style of shading
im not sure the exact terminology for what im after, cuz idk how shaders work. I just know I want it to look a bit shiny, and be dark in dark areas and light in light areas
I'll boil it down then
use reflection probes with box projection
it'll help your metallic objects
or anything that you want to have shine
as for having like a strong specular highlight, that is dependent on the lights in your scene, since your using URP I don't think the shaders still have a specular term for baked lighting
unless if you are using realtime lighting
or mixed lighting
box projection didn't seem to change anything
how did you define the reflection probe bounds?
because the bounds of the reflection probe dictate the box projection
I dont see how the reflection probe should help
I went into ortho view and made it slightly larger than this area
ahh I see the issue
looks exactly the same
In case you didn't find out yourself, you simply click on your FBX asset in Unity then in the Inspector window, you just go to the material tab. From here, simply extract or you can directly put a new material in the material slots displayed then click apply.
before we move forward I wanna verify
what kind of lighting are you using @formal veldt
is it all purely baked?
are you using realtime lights? lights set to mixed? etc.?
whats your setup
from the looks of it I'm going to assume baked, but can you elaborate?
Isnt his problem that his gun material ignores lightning?
as far as I can tell it's all baked
it is, and light probes is certainly another cause
specifically improper light probe placement
And thats because he has the metalic setting trough the roof
if his metallic setting is through the roof that means the object is pretty much only shaded by the specular term
i.e. reflections
Ye
which is why I was going down on the reflection part
By default reflections are sampled from the skybox
he has a probe already setup in the room
although just to verify, what setting is reflection probes set to on the mesh renderer for your gun model @formal veldt ?
That doesnt change the way the gun is lightup tough
That just replaces the reflection sample from the skybox to the probe
this is most of it
show the advanced tab
I keep messing around with this one but usually both are on
Put the metalic map to something like 0.6
See how it looks
Also what version of unity are you on?
ive tried every combination of values for the metallic map and smoothness
those arent the issue
do you have light probes setup for that room?
I think so? because when I turn off the metallic the shadows actually shade hte gun
do you have a light probe group in your scene?
oh jeez
so thats a yes then
I didnt want to place them manually lol
What version are you on?
well thats what happens with automation, but I don't think thats the problem neither
but just as a test spawn a white sphere
and move it around the scene
does it get shaded properly? darkens/lightens where it should?
if it does then it only confirms that once again its the reflections that are at fault
it seems to be shaded properly yea
again the gun itself is shaded fine
as long as I dont try to mke it shiny
Damn ignoring my question...
@formal veldt
nice
this makes it clear as day now
so it is the reflection at fault
so how to fix? you'll need to modify the reflection probe settings
Hmm 2021
i.e. changing the bounds and moving where its capturing the reflection
a reflection probe basically captures a 360 image of the enviorment its in
I would have suggested using the new APV's but thats in unity 2023
and then (if enabled) it projects that texture into a "box"
to approximate the enviorment
Or put 3 different box relfection probes in the dark and lit areas
^^^ that works too but I wouldn't have too many reflection probes, can be bad for memory/performance
only if its necessary
For a game like this you can get away with it
Is not realtime so it wont be recalculated
And if he makes it row res it shouldnt be a problem with memory either
its still taking up memory and has to be sampled by objects within bounds
you can still do it of course
what would you do then
but I'm saying that I'm certain you can make it work with a single probe for that room
but if you can't
then multiple probes it'll have to be
The thing is he will have to spam probes all over all the levels
and?
how
if you want shine and the weapon to look how you want it, you need to set them up accordingly there really isn't too many other ways to go about it
unless if you are willing to dive into custom shaders and write a shader than can sample specularity from light probes
and other shenangins
or using mixed/realtime lights
is it possible to have shinyness without reflection probes
Yes it will just sample the skybox by default
I dont want it to look like the skybox I want to add specular highlights that are basde on the light sources of the map
see?
In that case mixed/realtime lights is the solution
But you dont need metalic for specular highlights
the thing is I dont want JUST light sources to light it
Yes but you dont need max metalic value
because I feel if I make them mixed lights its just gonna be black until it's in range of a light source
Realtime GI is a thing
some areas dont get reached by the light even with the bouncing
I need it to be dark in those areas
Yeah
Thats what light probes are for
I dont see how that has anything to do with the shinyness tough
basically I don't care about any meshes in the reflection. I dont need to reflect textures or details. I think I just need it to have a specular highlight based on the light probes
so when it moves around it has that shiny specular effect
that can only be done with a custom shader
there really isn't any basic specular shader? blender has that
you can sample dominant directionality
I've done it
its possible
but what hes asking will have to venture into the realm of custom shaders
regardless I don't think I'm gonna be able to write my own custom shader tbh
and if he can't do that, it'll have to be achieved with mixed lights
or reflection probes
specifically reflection probes with some tricks i.e. "specular probes" with emissives and such
Ive used the new adaptive probe volumes in unity 2023, masive improvement from the lightprobe groups and there is no manual probe placing required
his inital problem was that the gun that was set to a full metallic material, yet it wasn't being shaded how he wanted in dark areas, that means its a reflection issue at that point
the diffuse shading is apparently already sufficing for him
alright let me setup a scene just like what you have to guide you through it @formal veldt
Im not sure if the new APV's sample specularity tough
making a shader?
can I get a wide shot of that area so I can see what kind of enviorment your working with @formal veldt ?
no I'll show you ways to get what you want without needing to dive into that
ive just been testing in this area
gotcha, need a moment to build something similar
I suppose the specular might be hard to see since the gun is actually a flat plane and the primary light source is directly above and pointing down? idk if that would affect it
its a possibility, going to put together a sample scene though so I'll be back in a couple
also I found a webpage that describes what I am looking for
this is the exact game that made me want to do this style
I don't expect it to look AS good but something to this effect
that looks similar yea
gonna do a couple of things to make it match where I think you are at for the moment
so diffuse wise as we saw you had your light probes setup
the light gets dark as it should depending on where it is thanks to light probes
but now you want "shine" to appear
I'll start with the mixed light approach since that'll be probably what your after, but then I'll dive into reflection probe setup for something like this
so the material here is purely shiny
but of course I haven't setup a reflection probe at the moment so by default it reflects the skybox
so for the time being I'll disable enviorment reflections and focus on specular highlights which is what your after
so despite being in this area in bright sun there is no "shine" appearing
one way to fix this is to use mixed lighting
I have a single directional light in the scene, so I'll go ahead and change the settings so that its mixed
setting it to a mixed light means its essentially both a realtime light, and a baked light
since its full white I'll darken it so its easier to see the highlight
but now with the light set to mixed, the light you have in the scene is casting realtime lighting
and we have shine
I can make the material smoothness smaller so that this shine appears larger
and the shine will darken accordingly
mind you this is purely specular reflection, no enviorment reflections here
now let me show you the problem that you were running into when you made the object fully metallic
this is the reflection probe part
so I've setup a reflection probe, and made the ball purly metallic/shiny
however I move it to the shadow
it still looks "bright"
so this is where we dive into earlier what we were discussing
box projection, capture point, and multiple probes to better approximate reflections
despite being in the shadow the reflection here is wrong
and you can see that its reflecting generally in the area where there is most sun
we can help mitigate this problem by enabling box projection, which will allow the reflection to essentially change depending on where you are in the enviorment
it helps, but of course its still not right, since its in the middle of that room, and still appears pretty bright
we can play with the capture point of the reflection probe to change where its taking this "360 image" from
so with the specular, does this mean the reflections will show even if line of sight to the light is blocked?
if you have enviorment reflections enabled then it will certainly have that "bright" apperance even if its out of sight of a light
but if its purely only specular, i.e. you disable enviorment reflections in the shader then only that single little shine will be affected
moved the capture point down, and the reflection looks better now
this should start painting the picture
@formal veldt
I still can't seem to get the specular highlights
whats the material settings for that first one
the gray sphere
I set the main sun directional light to baked but I didnt notice a difference
I mean mixed
you need to rebuild lighting
even though going to mixed is just adding a realtime component?
im not going from realtime to baked
im going from baked to baked + realtime
when a light is set to baked, unity basiclaly disables it
and it doesn't reenable it even if you change the mode
so I have to bake the entire lightmap again?
yes
ok
@tulip tendon object here with light probes being lit with the shader method I mentioned
all baked, no mixed lights, samples "specular" from the light probe
although its very basic, it samples it essentially from the brightest point
I thought I needed mixed to get specular highlights
unless if you have a shader that can do it (which unitys URP doesn't) mixed is the only way
you can also get it with reflection probes with a "specular probes" trick but this is kinda hacky, and will likely not work for you given that you don't want to bother setting up reflection probes for the areas in your map
but it is possible
but beyond that, the only other way (outside of the reflection probes, specular probes I just showed, or a custom shader that samples specularity like I showed, or fakes it) is with mixed or realtime lights
now it seems that the material just isn't affected by the global lighting at all
where it used to be
that pic was taken with 0.697 metallic
even if I put zero metallic and stand in darkness its fullbright
and its the same level?
something must have went wrong with the light probes
ohhhh wait
ahhh I think I know
whats your lighting mode?
what do you mean
baked indirect means when lighting is baked, its only baking the GI term, not the direct lighting
what the heck does that mean?
here
left is direct illumination only
right is BOTH direct illumination and GI
in baked indirect ,its basically the right, but minus the direct illumination
its only the GI term
what is subtractive
subtractive means that when you bake lighting, it basically does everything in the lightmap (like the right image), but for mixed lights when it casts shadows it will "subtract" them from the lightmap
is there a way I can have this emit lighting onto the walls? Like have it so the texture pattern emits lighting
Idk if that's possible but figured I'd ask
how would I go about doing that?
wdym
is it realtime lighting? or baked lighting?
realtime
well to get that lighting to affect the scene you'll most likely have to bake it
you can use enlighten
which is a realtime GI within unity
still bright
but if you want pure baked (which I'd suggest especially if nothing in that scene will change) then use the progressive for that.
what does Realtime GI do, just make it so textures emit light?
can you enable shadow casting perhaps?
where
it does alot more than just "making textures emit light" but yes thats apart of it
on the weapon?
yes
it didnt change anything
do you have shadow casting enabled in the URP pipeline settings?
what settings are these
this is venturing into the point of URP troubleshooting which I'm honestly not to familiar with
but URP usually has an asset in your project
called URP settings or whatnot
you can also find it by going into edit > project settings > quality
and you can find the asset in there
wait so how do I get GI to work in the texture? tried looking up youtube tutorials but they aren't super helpful
GI is for the entire scene, its not really something on a "texture level" so to speak
it ventures into the realm of "lightmapping"
you can find tutorials on that
to get that texture to "emit light" you'll need to make sure emission is on
and then from there bake your scene accordingly
there is a bit of setup involved though so I'd be sure to watch a tutorial on one
cast shadows is on
screenshot?
huh, wonder what is missing
ohhhh wait
I keep forgetting
your gun model is just a flat dumb sprite
wait nvm even in that case it should be fine
ask in urp for help on getting proper lighting with mixed lights in URP
it would be easier to help you if you were in the built in pipeline but clearly some things have changed in URP so its not the same
specifically with shadow casting on your dynamic mesh for mixed lights
@formal veldt
I changed it back to baked and its properly lit now @night shell
but you'll be missing your specular highlights
rendering is tough, but learning about it makes it less hard
are you using a baked light for that example scene
for this one no, this was mixed lights to get the specular shine to show up @formal veldt
on the regular unity shaders that is
so mixed lights were working for you
yes, although they don't seem to be working for you
and your in URP so I'm not sure whats wrong or different about it
Is there a way to have a realtime light not cast specular reflections?
In HDRP yes, in other render pipelines I think not
Could have a shader with custom lighting that modifies or removes specular from additional lights, but I don't know if there's a way to only do it for a specific light
@formal veldt I didn't see if it was mentioned but you need a reflection probe for each spot where the reflected lighting changes significantly, or use only rough nonmetallic materials
Beyond that what you're asking for would require raytracing
is it possible to keep reflections from lighting themselves up?
like, there are no lights, it should not be illuminated
You need a reflection probe for that area, or potentially* an indirect lighting controller override if on HDRP
Could work but near the edges of the screen it'll fall back to sky or closest reflection probe
I could also just cope and have some unrealistic lighting in some areas
Hey, I'm having some issues with baked lighting. A bit of background, there are walls on either sides of the door that are their own separate pieces. However, this will leave a gap above the door if I don't fill it in. So, of course, I did put another one there, just above the door. However, it leaves a weird artifact when the baked lighting processes and you can very obviously see the seem.
Any ideas on how to fix this?
you just need to properly snap it
use vertex snapping
also i would reccomend to stop using progrids, it has been discontinued since its features became built in the engine
The block over the door?
And just that or?
Cause just doing CTRL and moving the central block made no difference when I rebaked it.
I have a big sun and a bunch of planets orbiting the sun. I want to project light out in all directions from the sun so that it hits the planets. How do I do this?
Hi, Is there a reason why only some of my terrain layers receive light when using real time GI?
(the opposite)
Both? I said vertext snapping, the one with control is increment snaping, to vertex snap hold V and hover over a corner then move it to another corner
A giant point light i guess
the problem now is that if I jack up the intensity the first few planets get lit but the farther away ones dont get lit unless the intensity is even higher drowning the first few planets in light
Unless I'm misunderstanding how vertex snapping works, I tried using it with V but it still didn't resolve the issue.
I still dont see the wall snapped properly
making a game, my lights for some reason keep turning on and off in playmode.
IDK how to do what you are saying then, nor can I tell how you see the wall isn't snapped properly.
you can clearly see the wall is not snapped properly
https://www.youtube.com/watch?v=GKBKBl1fhas check this out
I figured I'd make a quick tutorial on something today since every time I need this, I forget how to use it. Vertex snapping is a pretty important feature that I don't often use in 2D space. Let me know if you guys are interested in more Unity tutorials. I'm not exactly a Unity3D wiz, but for now I'd like to help some beginners, who are struggli...
that happens because on forward rendering there is a light limit per object, set the rendering path to forward+ or deferred so you dont have any light limits
oh ok
That is a wall trim.
Anyone know how you can create light shafts or sort of volumetric lights like this?
How do I get the light to invert? So only the edges are lit up instead of the edges being shadowed
put the lighting around the island not in it
Yeah then the middle part would be lit up no?
then do both?
I don’t see how that would make the middle have a shadow?
im confused to you want the middle to be lit up?
i think i misread your message?
No, only the grass (edges) should be lit up
well then put it outside of it like i said originally
Like that red line?
yeah
(I’m not on pc rn)
well it will have to go over the left part as well
Yeah
Oh well I’ll try it once I can
I understand the free form light as that the light is inside of the area
@copper steeple
this is how it looks, the platforms that aren't islands work fine
di you forget to remove the lights inside the middle one?
nope, i separated all the islands into different sorting layers, and set the large light to only affect itself and that island which is lit. idk if it was necessary but it was a try to solve it
and this is how it looks if it targets all sorting layers
yep
umm idk then
yeah same, idk why you wouldn't be able to make the same effect for islands..
Hello Guys, does anyone know why the lighting looks off in the game view? I only have this problem with Tiles using Normal Maps like the ones in the picture
Hello all! After changing the scale factors in unity to a larger number. My assets started having these weird lines on the sides where my assets connect. I am 100% sure that they align perfectly. I tried baking the lighting but it makes all my assets turn black
This is what I use as material
They were just fine when they were much smaller.
When I drag the real time shadows to 0 it disappears
Hello, I have some problem with reflection probes ( I guess)
HDRP, Unity 2022.3.10f1
can anyone help how to fix this
this looks like a problem with a plugin you're using
Zibra Liquids?
You should ask the publisher of the plugin for help. Looks like a bug in their code, specifically their RenderComponent.
They're wrong
what I can tell them that this is their fault
too late, game is already on steam, and it's the core of the game
I mean can we somehow confirm that this is bug on asset publisher side?
How would it be Unity's fault that their asset made for Unity doesn't work with Unity
we didn't
that one does look like our bug
if you look closely I was replying to another thing when saying that it wasn't a bug
I also haven't blamed Unity anywhere
Judging by the error somewhere a custom pass is trying to access a reflection probe incorrectly
Seems like something they might know more about over at #archived-hdrp
Nah, that's just issue in our code
We seem to filter out reflection probe camera's in one part of the code but not another, and then do illegal dictionary access
Weirdly enough, we've already fixed exactly same issue before, so no idea how it appeared again
I fixed this, but the visual bugs are still appearing. So this error doesnt have any impact on bugs with this asset.
Morning! I have an issue with dynamic object in my project, the issue is as followed: non-shadow casting dynamic object that are GI static still cast AO on their surrounding and themselves.
The following post describes the issue aswell, but this method results in the object not casting AO on surrounding objects, but it still recieves AO from other objects onto itself. Is there a way to completely exclude the object from AO baking but still having it recieve GI?
Doesn't sound very possible aside from some workarounds like baking parts of the scene separately
With that it may help to use this system for tying lightmapping to prefabs instead of scenes https://github.com/Ayfel/PrefabLightmapping/
But baked lightmapping is "baked" for a reason so it's probably not easy in any case
Another hack you could consider is bake once with AO and once without, then combine those manually in an image editor
Hello, I'm having an issue with lighting when building the game. Shadows simply don't work the same as in the editor and I can't figure out why. Quality settings is set to High on both sides. Using HDRP and SSGI.
I have two scenes, one city map and one indoor. There appear to be two problems, possibly related:
- On city map, the shadow gets some stripes in build only for some reason. I had this issue in editor too and changing bias value fixed it in editor but not in build. Why?
- Indoor, rooms are using SSGI since they are loaded dynamically as well as textures from the StreamingAssets folder. The problem is that everything is fine in editor, but in build, the wall don't appear to block light anymore and the same shadow stripes bug occurs on the side.
Would anybody have any idea what's causing those issues?
Hello eveyone. I want to add lens flare effect on some of the lights in my game. I downloaded a lens flare effect png with transparent background but the background of the image is displayed when i add the flare effect to the light. How can i make the background totally disappear?
try adding black background instead of transparency
no the image completely dissappears then
i selected lightmap in the texture settings. It shouldn't display that checkered background. Is there something wrong with the image itself?
I want to illuminate a large dynamic mesh with light probes but I can't use "Light probes volume" because I'm using URP, is there another way of doing that ?
Nobody knows about this issue? It seems like quite a big problem which should have occurred before though. I can't find any solution on Google :/
i would suggest to just use screen space lens flares
Thankyou for your reaction, it’s very helpfull!
I really need help with a reflection probe problem I'm having. The issue is I have this building model, and i want the windows to have proper reflections.
The problem is, if i place the reflection probe inside the model, it reflects the frames of the windows because their sides aren't being culled, because they arent a backface
Is there a way to work around this? I can't think of a way to solve this, other than maybe some method to exclude one specific object from a reflection probe (culling mask doesn't work because i need to reflect other buildings)
weird reflection example
put your reflection probe... not in the building
or disable the building when baking the reflection probe
Problem is, then the reflections arent accurate
dude its a reflection probe, It will never be accurate. If you want accurate reflections id say you should go for ssr
You can disable the "reflection probe static" flag on the buildings
You probably don't want to though if you have more than one building
Probably rather would place them between the buildings
As mentioned they will never result in "true" reflections is a situation like that
yeah i do have a few buildings
thats what i ended up doing, its good enough for what im going for and doesn't really look too bad when everything's filled with buildings
shadows in unity are trash, change my mind
Shadowcasting is limited and/or expensive in all render engines, it's kind of an unsolved problem so you have to work around the limitations of the system
Even if your post is kinda inflammatory and pointless you're technically not wrong
I don't care about performance of shadows itself. If your shadowcaster have small amount of geometry then shadows are not a big deal. I care about the look of those
By that I mean the shadow bias settings, normalbias and other stuff like that.
If you want advice how to improve shadows in a specific scenario you need to give some info to work with
In unity it doesn't matter how you set it. It's gonna look bad always.
Haven't solved that issue in years.
That's simply untrue
Every situation is different so the best thing you can do is practice and get familiar with the system so you know how to use it properly
okay so let's say I'm trying to setup realtime sun and its shadows.
I've got unity's terrain set up. Directional light is going around the terrain kinda like sun should.
well that's not true but u got the logic here.
I can't spin the terrain itself
when sun is going behind terrain, I get some weird shadows. By that I mean it's kinda light casting through it.
but that's okay. I change the normalbias value to higher and problem solved.
but there is another problem that is caused by changing normalbias value
Other shadows are just casted 100m away from the object. pixelated and idk what else. faces shadows are split to pieces
If nothing stops the light from shining through from under the terrain, it will shine through from under the terrain
It sounds like that's what you're describing
If that's the case I'd cover the edges and underside of the terrain with geometry
If you have to modify light bias settings at all you have to be careful with it or seemingly unrelated shadow issues tend to appear
The bias values have to be there for a purpose
I'm not sure what this means exactly
Do you have a picture of it happening?
that's what happened when you increase the normalbias value
that's where the normalbias value is set to 0.
and overall the shadow here looks good to me
and it could stay like this
but there it comes what I've described earlier with the terrain
so im trying to solve this overall shadow issue for about 5 years now. nothing has changed at all.
Which issue was referred to here?
light casting though terrain from behind.
that also happens not only on terrain but other objects as well
And that wasn't solved by blocking the light from under the terrain with extra geometry?
there is always a blind spot in that case. it's not perfect solution
"Blind spot"?
The "shadows are split to pieces" because the mesh has split normals
The properties of the mesh that's casting the shadows has a considerable effect on the appearance / quality of the shadow
Shadows have to be pushed "inward" (which depends on geometry) to avoid them poking out through the surface they're being cast by
For this reason you shouldn't have any too thin shadow casters, like I assume your terrain's underside is in this situation
yeah. for that to work correctly I need to make exact same terrain mesh that have inverted normals and also made additional face for covering the borders of terrain. otherwise the light will cast though the gap between those 2 meshes.
idk if I described that correctly
i tried just putting big cube beneath terrain
it was like I described here. when light is just beyond the horizon, its passing light under the terrain through the side gap
can't do it like that
You only need to cover the side gap and underside, not replicate the whole terrain
I'd try to set height paint the edges of the terrain with the lowest possible height
I use mesh terrains instead of Terrains so I could simply copy and extrude the vertices on the edges
the red thing is that cube I put beneath. but the gap I'm talking about is this green space
That's what we're both talking about
Five years of struggle and giving up so close to solution? 😏
this problem is not the only one 😏
Soon I'll invent the universal solution that I'm going to share with whole world ! 😄
If you can find some technical breakdowns or research papers of the techniques used it really does help you understand how to better navigate these features
It also will give you respect for all the clever hacks that let us have shadows of any kind in the first place ^^
I don't know if there are such resources for Unity's shadows but the techniques are basically all the same as are used in Unreal and Godot likewise, and you can find people struggling with these exact same issues there
so huh
has anyone tried this: https://github.com/SlightlyMad/VolumetricLights
or this: https://github.com/Unity-Technologies/VolumetricLighting
(for builtin RP)
i'm not sure if I'm doing anything wrongly but neither seem to work?
(I'm using directional light, so this excludes the second one already)
this is ideally what I'm trying to replicate:
Is there a way I can add 2D global light to a 3D URP project? Trying to do a mix of the two, the player characters are going to be 2D sprites while the enemies are 3D models. The project is currently 3D URP, but I don't have any 2D lighting options. Is there a way to mix them together?
I've got better package. not made by unity
so it's working fine ;D
is there an explanation of what I need to do
I'm literally a newbie with Unity lmao
(And does it work with buildin RP?)
sure it works in builtin
otherwise I won't use it
I only work in built in
there are 6 steps u need to do for it to work.
- import it to unity.
- find scripts folder in the package
- put VolumetricLightRenderer script to camera obj
- put VolumetricLight script to the light obj that contains ligh component. (assign proper references (default spot cookie image))
- go to projectSettings/graphics/alwaysIncludedShaders and put there 3 shaders that comes with the package.
- run the game and play with the settings in light script in the inspector.
is it normal that I still don't see the volumetric light in the scene?
(without running)
I have a MainCamera and a DirectionalLight
- Added VolumetricLightRenderer to MainCamera, set default spot cookie = spotlight
- Added VolumetricLight to DirectionalLight
- Added shaders to graphics
It's either I'm dumb or this doesn't work either
it won't work untill you run the game
if you'll find satisfying settings just copy component while game is running
and then paste it again when game is off
default spot cookie is just that one sprite that comes with the package
and that's all
alright, let me try building then
with play?
yup
it doesn't 
then settings are not correct or you just missed something
run the game and change script settings while in playmode
you should see the difference
try this
i'm using unity's default skybox just for showing purpose
notice that the game is runing
if I turn it off then script will turn off either
those are just example settings
always included shaders should look like this
this script on camera
nothing else
mmh
could post-processing maybe affect this?
oh wait, it works now lol
ok I definitely have no idea what happened but ty @unique mango you're a savior
No problem buddy
2D Renderer disables 3D features and vice versa
The only exception to this is using 2D Renderer with only "unlit" shaders for the 3D meshes
You can recreate all kinds of lighting-like effects using custom shaders that will work with 2D Renderer, but it disables all shader code that makes lights work normally within shaders
Difference is enormous, im so happy with this actually
"Fit"? At a glance it looks more like an animation issue
What do you mean by "fit"
That's not a lighting issue, more like #🏃┃animation
You're probably using some kind of animation to move the feet
If the problem is the position of the feet relative to ground, that implies animation issue
Lighting has nothing to do with character postures or positions
I'm having some issues with light baking where some cracks and crevices emit unnatural lighting, been fiddling around with lightmap settings to get it to a minimum, but still not happy about it, any tips on how to fix this?
and my lightmap settings
using 2019.3.15 hdrp
managed to get a proper bake without any issues after setting indirect multiplier on my directional light to a lower value
Hey!
Anybody knows where this weird flickering on the Characters head is coming from? (using a Realtime Spotlight)
This is called "z-fighting"
What's happening is you have two planes perfectly overlapping each other, so the gpu sometimes renders one plane first, and something the other
That's what causes the flickering
An easy solution is to move one slightly above or below the other
Oh damn.. so the Characters Model has probably duplicate Vertices at the Head? (sorry for ping, hope its ok)
It's fine, if you don't have 2 seperate game objects, aka 2 seperate meshes, that are layered on top of each other, then yeah your mesh has an issue
but check to see if you can move the hat(?) slighty up in local position
as he just said you can easily just move it above more, even 0.1 is fine
nah, it's an issue within the Mesh, there are no 2 characters at the same position
(already fixed the model)
https://streamable.com/1ol3yw
oh ok! yeah I had that same issue just with buildings and the floor before so
tbh i never had these issues before, but i also never tried to do anything with lighting etc, i'm 99% programmer 😄
learning something new everyday, for the next time i have issues like that, z-fighting will be my first thought
nice
Light probes work by grabbing the nearest light probe, no matter how far away that is
Always have relevant probes nearby
There's not really a way currently to have light probes that are only "local", but if you're using baked lighting you basically need to have probes in every area where the lighting changes anyway
Otherwise dynamic objects would get wrong lighting
What's a "normal" value for the amount of lightmaps after baking? My settings result in 160 maps, but it seems to have no significant effect on performance. Is this a high number, targeting PC as platform with GTX10xx GPU?
160? In which resolution? 😄
How big is the szene?
Nvm - I realised bakery auto-reset the size to 256... I now made them 1024 and tadaa: down to 19 maps 🙂 thanks anyways!
been experiencing an issue with one of my projects for a while now, it was originally a 2d project that wasnt going to have any lighting but ive since attempted to add lighting... and experienced the most confusing bug i have ever seen; no matter what i change in my URP settings, project settings, preferences, and even all the lighting settings change absolutely nothing whatsoever visually.. i always get an EXTREMELY lit scene despite no lights
even the materials in my project appear like bright circles
tried completely removing my URP and lighting settings assets both and remaking but nothing changed still
i 100% bet its just one specific setting somewhere i have checked that i really shouldnt but i cant figure it out for the life of me
even changing stuff on the materials like emission, metallic, and smoothness.... they all do nothing
what causes this dark line to appear after a light bake
only using directional light and a hdri sky
Your project is likely still using the 2D Renderer, which disables all shader features used for 3D lighting
Create a new URP asset with Universal Renderer (or whatever the not-2D option is) and set it as active in Quality settings (And also in Graphics settings in case you disabled that)
figured out that it was down to my lightmaps uv not lining up perfectly, the next question is though
How do I get them to line up perfectly, I modeled those cracks and are at a 45 degree angle but can't get them to line up with my current uv settings that were unity generated
You could try tweaking the lightmap UV generator settings, or create the lightmap UVs manually
been playing with the hard angle setting, but can't get it to line up perfectly
If those squares are visualizing your lightmap resolution, it won't be possible for them to represent geometric details that small
causes some really dark spots, but it's indeed not really noticable if you don't know where to look
I expect the crevice's shadow will spread to the flat surface even if the lightmap pixels line up perfectly
doing them by hand is the hardest thing for me, do you have a recommendation for blender plugins that can help speed up the process
oh okay that's good to hear
so it's not too unnatural looking
thanks for the quick response 
Hmm it sounds like a potential issue to me but maybe it's what you want
There's TexTools that gives you more tools for doing it manually
Automatic unwrappers tend to be awful (especially blender's "lightmap pack" unwrap), and the decent ones are premium-priced
Still, unwrapping a beveled slab should be quite a simple task to do by hand
this is the most discolored one on the baked lightmap, not sure if it's that noticeable if you don't know where to look
oh yeah those are, but I have 18 seperate fbx's that are somewhat big for optimization where some objects are a bit more complex than normal
Wouldn't lose sleep over it
If you want seams to be visible to some extent I'd make them a bit bigger
Of course, you always get better baked lighting with continuous meshes and very subtle seams are best done in normal maps and texturing
yeah had them as normal maps first, but I have to keep low specs in mind on this project where normal maps with a high aniso level still wouldn't show the cracks, so having those extra vertices was not a bad option
this was justifiable for looks in this case where performance didn't go down
Simply painted on seams are often perfectly good likewise
coming back to lightmap packing, yeah it was pretty horrendous to say the least 😂
hence why I opted for generated uv's
could do a high to low bake next time and make those cracks and crevices a bit more pronounced like you said
thanks for help
Since the shape is very simple, you can get a lot of use from generic seam, crack and other types of detail textures ^^
Will definitely do that next time around in that case
oh okay interesing.. will give that a shot, thanks!
nice! that seemed to be on the right track, 3d objects now appear to be recieving most lighting, except the entire environment section appears to still not work, and the 2D sprites dont seem to be receiving light (thats the main thing im trying to get work)
ah! wait i seemed to have figured it out, i created a new 2D URP Renderer and made sure it was in both quality and graphics settings, then added a Global 2D light and everything seems all good!
back again with another question, what causes this green color to appear after a bake, only green thing that's in my scene is my hdri
is there a way to fix this or minimize the effect
I've got my indirect multiplier set to 0 already
really wonder where this colors get sampled from
Initially it looks like a texture compression artifact to me
Indirect multiplier of what? Usually indirect lighting is what you want when baking
dir light
those colors get a lot worse when I have it enabled
you'll get all colors of the rainbow
did a bake without compression too, same results bit less noise overall
was thinking of leaving out my hdri cubemap and rebake it
Baking with/without multiple importance sampling setting can have some effect if the sky is being sampled incorrectly, but it's a bit of a stab in the dark
I'll have to look into that
is there any documentation on it?
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/
chapter 14 talks about it, though problems related to it are usually in the form of visual noise
going to be quite a rabbit hole to dive into
how can i make it so the light doesnt go over the sprite but instead, the sprite blocks the light
The 2D shadow caster component should have a property that controls its "depth"
closest i have managed to do is play around with the shadow caster 2d. I had to make my flashlight shadow strength to 1. (i was hoping to have it at around 0.4) but cant find a solution.
"Shadow strength" basically makes all shadow casters translucent by preventing it from fully blocking the light
You logically can't have it block the light and also not block the light at the same time
I know what you mean. Isn't there a line of code or something to put on the object with the sprite renderer to block light?
i hope that makes sense
Hi Guys, is there any way to make that shadow inside Red line to make it smoother?
Is it not blocking light in your latest screenshot?
It's a bit vague what you mean by "smoother" but if you mean the colors splitting into bands in a crunchy way you should be able to enable "dithering" on the camera or post processing
Most likely something to do with your camera clear flags
yeah
solved
in camera setting it was set to solid colour
Hello. I encountered this light leakage bug.
Spotlights have this strange lit line below them (the right part). It's for all spotlights. I already tried playing with basically every light setting I can, including setting the render mode to Important.
How do i fix that?
it is. But not how I wanted it. It is okay for now and testing purposes
Does any1 know what could be causing a consistent an immediate crash when generating lightmaps? This randomly started happening today, many different versions and newly created projects are affected.
Currently using 2021.3.27f1
Just migrated to 2021.3.32f1 and the same issue persists
how do you guys get world lighting that casts shadows in unity 2D?
