#archived-lighting
1 messages Β· Page 24 of 1
artefacts are caused by exposed backfaces
For your case, it should be the easiest way
there are still little shadows on the leaves that makes it seem burnt
Okay. Next Question:
How big will your forest become? ^^
not that much, its actually a little forest
im quite sure, that baking the leaves is not the best way
longer baking times?
Yep for foliage it's the correct solution
Big Lightmaps ^^
i would try to set them static, but change "Receive Global Illumination" to Lightprobes in the Mesh-Renderer.
And place some lightprobes around the forest.
That should be good enough
right
im going to create a small forest just for testing and will tell you
there's one thing tho
I should separate leaves and branches
since on the lods they're just one mesh
Three LODS and Three Meshes
but i should have 3 lods and 6 meshes
leaves and branches
to do what you told me to do
because you want to baked the trunk and use Probes on the leaves?
im not sure how LODs behave when beeing baked. @arctic isle - do you?
should i set just the leaves to receive gi to probes?
or the entire mesh?
i would suggest that you test what works best
baking lights is often try and error
We have full LOD support for lightmaps and probes https://docs.unity3d.com/Manual/LODForBakedGI.html
There's one thing that i'm wondering about, why the shadows down here are just a reflection of the plain faces of the mesh and not the transparent textures instead?
Means LOD0 uses the baked lighting from Lightmap and LOD1 and 2 use the probes?
Here is evident in realtime lighting
You set up each lod separately, so you could do that for performance yea
maybe caused by the shader?
Im not sure how this shader behaves with baked light.
This shader was made using Amplify shader editor
fortunately I have it
I could try to tweak some settings and make it work
im quite sure that has something to do with the alpha or how they made it.
I'm seeing people on forums that say that bakery solves a few problems when lightmapping, but tbh I don't wanna spend that much money for just baking lights, since the only problem that im facing now is just this
using the standard URP/lit shader with alpha cutoff works
it renders the shadows properly
but using the Amplify one it doesn't
i used bakery for years but switched back to Unity lightmapper a year ago
the unity one is really great
and you cant use the unity debug features for bakery lightmaps
Heya, I decided to use a spotlight as a viewcone for a top down dark themed game. Any idea what's going on here?
The first image is with 0.5 shadow strength and second one with 1 shadow strength and it still leaks through somehow
In both images there is a wall to the right of the player. There is a ceiling that prevents from light entering (shadows only)
I fixed it! I just had to rename the maintexture parameter from _Texture00 to _MainTex and change the name of the shader from "Raygeas/AZURE Vegetation" to "Raygeas/Transparent/AZURE Vegetation" @chilly kettle
shame on them, that they dont use the standard unity names
so I'm not sure if this happens without URP but for some reason my lighting goes really bright in some places when Contribute To Global illumination is on the object, it seems like smaller places do this but the room Infront of the bad one I smaller, I'm also going to post this in #archived-urp so those people can help, i also sent an image of a good room and the light map
also this only happens after bake
@stark temple (so sorry for ping) you helped me with my other problem you know how to fix this? (again sorry for ping)
I have no idea
alright
Anyone know why Unity won't detect my HDR display? I have HDR on in Windows 11 as well.
Or if anyone knows how to enable HDR, lmk. I've followed all the Unity articles I could find (2). I'm on 2022.3 and in HDRP. I also tried 2023.2 with URP but no difference. On an LG C2 42, windows 11.
there is something wrong with the material on the bright room, try replacing the material with other material, clean light map and (re) bake
What it means when there are transparent things when in UV Overlap view?
these are trees
Means they don't have any valid lightmapping
everything except for that wall is perfectly fine,
but that wall has some baked artifacts for no reason
i wanted to enable double sided gi but its not available in urp
You can use the Texel Validity debug view to find the problematic polygons
Exposed backfaces cause texel invalidity, so it's best to fix them on the model rather than using double sided GI
It can also happen if there's overlapping geometry
My volumetrics have disappeared...
I had them on before, and it worked correctly.
I must've done something to some setting, because now they don't work.
I have Volumetrics enabled on the light.
I've got Volumetrics ticked in the HDRP global settings.
I've got fog in my scene, with volumetric fog turned on. It's quite thick too.
What could I be missing?
Nevermind. My smart ass had this ticked in.
Hey there for some reason when i try to bake lighting, Unity just crashes
So i tried using the "Bakery" unity asset and this shows up
I'm on the latest drivers tho and i even tried doing a clean reinstall of the latest drivers using DDU
currently using an RTX 3080
Anyone have any ideas on what's going on?
Maybe there's something relevant in the editor !logs otherwise you'd need to look for help from the asset creator
This is happening with the unity light baking aswell so i think the issue isnβt to do with the asset
Iβll send over the crash logs in a bit
I thought I was going crazy, I finally have proven to myself that I wasn't. Okay so here's this image... The mesh with the super black shadows (WHAT I WANT), was made in 3D's max. The other mesh that's lit up even in the shadows was made in pro builder. Both have the same exact materials, yet the one in bro builder is obviously more lit.... I am using HDRP.
Here if you can figure anything out from this i would greatly appreciate it π
Did you check the "Generate Lightmap UVs" box in the mesh import settings?
Ill take a look in a sec π
@arctic isle - i'm just curious as to why both look different with shadows. Like why is PB shadows more lit and the mesh made in 3ds max more dark? Both are using real-time light. I'd rather stick with real-time lighting if possible, I know baked would fix it. I'm just genuinely curious as to why both types of meshes just appear different in general.
perhaps you're using a different material/shader for each?
Ahh I see something. Reflection probe makes everything more equal in lighting. But that's the interesting part - without reflection probe the PB object still appears just as bright, but if I add a reflection probe the 3ds max mesh is just as lit as the PB mesh
maybe the 3dmax mesh has a really high specular / metallic setting
and so would receive less light from diffuse sources
no problem!
Hey, the crash looks like it happens within the nvidia drivers. I'd recommend 1. triple checking you have the latest drivers and 2. downloading the latest 2022.3 as I see you're using 5f1 which is quite old https://unity.com/releases/editor/whats-new/2022.3.16
i've checked like 10X now and have done a clean install of the latest drivers (and older drivers) and i'm 1000% sure the drivers are at their latest lol
So i have 0 clue what to do next
Get latest 2022.3- I don't recall fixing a crash like this in the 2022 release stream but who knows. Maybe the latest drivers + old 2022.3 has some hiccup
If that doesn't fix it, maybe it's a bug
also, maybe a long shot but (after you upgrade to latest and if it still repros) worth checking that you don't have any strange invalid meshes in your scene. if you do find something still report a bug because we should be handling this more gracefully.
i don't think the issue is with Unity honestly, I'm pretty sure its something to do with the Graphics Card
gonna contact NVIDIA support and see if they can help in any way
Great! Feel free to ping me here if it ends up being a problem on the Unity side. Good luck!
I think it is related to urp so Ill move em
Why does my freshly made baked gi have this weird circle weird light shapes? These are my settings
I'm in urp
By increasing lightmap resolution it becomes even worse
Putting the resolution to 1 texel per unit seems to fix it, but I will get messy lighting later when placing objects
what type of lights are you using?
if you use spot lights, you'll have access to the 'baked shadow radius' value which will make this smoother. The distance to your meshes is what makes the hard edge here.
alright, imma try with it
oh I just forgot Cast Shadows enabled on my ceiling lights meshes, actually I don't really care about shadows on them
I previously disabled it but I think that reimporting some assets messed up things a little
I understand the point of using spot lights tho
ok what's this sh*t now
there's a room between tho
no cast shadows on both light ceiling meshes
im making a horror game and need to make this creepier and darker. any tips?
First idea: Turn down the light π
Go to Lighting > Environment > Change source to Color > Mess around with it and make it dark
then i guess you should add torches around with point lights?
That's how i'd go about it if i was you
thats smart thansk
thanks
i cant find how to change the source to color
What are you seeing
"source" as instructed
i was looking at the wrong one thanks
can someone help me fix these wierd shadows? im using pro builder btw
I tried google but it didn't helped.
Why does the darkness turns completely black after baking and how can I go around this and have a still visible darkness like in the first picture, but also having the light points baked?
This is super handy! No idea this existed. My main issue is light bleeding between modular assets
can you show the light bake settings?
You could add an area light that is very weak or increase the brightness with post processing
The darkness could happen because either theres not enough bounces or the lights are realtime
Is it not included in the screenshots?
oh.. i am blind π
Okay. Looks fine for me.
Are you sure that everything you want to bake is set to Static and the Lightsources are set to baked?
What is with roomdoors and wardrobe door that needs to be animated or moved?
For dynamic objects you work with Light Probes
i was trying to bake lighting for my vr game and it always says this: (by the way the time keeps on going up and up)
hard to say but its possible that your CPU is struggling to render the scene
you can do alot of things to optimize the process and make it more managable for both the CPU/GPU to render the scene when using progressive
drop sample counts, enable filtering, create a custom lightmap parameters asset and disable baked anti-aliasing, make sure that you have realtime GI disabled, and if you aren't using mixed lighting, make sure that is also disabled (or at the very least set to subtractive)
how do i make a light that emits light in all direction
without y'know, exploding my computer?
i just realized i could use point
Hello! Sorry probably stupid question, but I cant find any info on Google.
How can I use baked lighting with realtime objects? I've a part of scenery that is set to static and should have baked lighting, but as soon as I do this, my dynamic objects stop casting shadow from directional light.
This is how it looks with dynamic lighting.
When I change light to baked and bake lighting, I've got this. As you can see, capsules no longer cast shadows.
You need to use mixed lighting
Mixed lighting combines both aspects of real-time and baked light
use light probes
or better adaptive probe volumes if your using unity 2023
Could you please link some resources about this? I'm not sure if I understand whats hapenning here. I'm on 2023.
i can show you some pictures using every light mode
tell you how it works
so this is a realtime light
it works as you expect
this is baked light
which has your problem with the dynamic object not being lit
there is mixed light which combines both
but that means your dynamic object will only get lit by the direct light
indirect light wont affect your object
and having many mixed lights can also be expensive
so thats what light probes are for
as you can see the dynamic object also recieves indirect lighting
in this scenario i used the new adaptive probe volumes
which are only available in unity 2023 for URP
it looks like this
it samples the baked light from the scene and gives it to dynamic objects
this process is pretty much automatic
all the probes are placed during the bake time
@placid forum
Thank you for this very detailed explanation, I really appreciate it!
So, in order to use baked lighting I must use light probes and dynamic objects will be lit and cast proper shadows then.
Thanks, I'll play with this and see the results.
π
*mixed lighting will allow dynamic objects to cast shadows onto your baked lighting
light probes will help correctly light your dynamic objects, but mixed lighting will allow the realtime shadow casting you were looking for initally
volt is correct though, mixed lighting can become very expensive when you have many mixed lights
although depending on many factors, how expensive depends on the scene, and if your only going to have 1, one is usually fine even on mobile
you could also go the fully baked route, and there are methods there also for faking shadows for dynamic objects
but thats a whole other can of worms
the APV's can also cast shadows more or less
but is not as accurate
APVs casting realtime shadows?
ye
im testing it right now with a dynamic cube under a baked spot light
and the area under the cube darkens
specifically casting realtime dynamic shadows?
because from what I recall APVs were baked
dont want to say too much again though because I haven't messed with them in the newer unity versions
nvm, it was the ambient occlusion causing it
so only baked, figured
but realtime APV's are on the roadmap, so thats great
that is great indeed
I have only one light and several dynamic objects. My dynamic objects are not casting shadows when I set mode to "mixed" thou. Are probes required for shadow casting?
Okay I could did something wrong earlier, now they are properly castig shadows in Mixed mode.
Thanks for assistance, I think I now uderstand this topic better π
probes are not required for shadow casting
So, generally I should use "Mixed" light and still use Light Probes, right? Because on "Baked" mode when I've put light probes, dynamic objects are not casting shadows.
yes if you want to maintain realtime shadow casting you would use mixed, when on baked mode there are no realtime shadow casters because its all baked for performance
@placid forum
now granted I did mention its possible to have "shadows" even when fully baked, but thats a whole can of worms with a bunch of techniques that can achieve such a thing, but with various drawbacks
Thank you David for assistance. Sorry for spamming, I'd love to ask you one more question when we are on track already. I'm using 2023 and I'm cosidering deploying this to mobile devices (phones), which lighting model would work the best in terms of performance? I assume baked lighting will be better than real time.
But what about light probes? Shall I skip them for mobile devices?
light probes are very lightweight, you shouldn't skip them for mobile devices
in terms of performance for mobile though, the best would be purely baked lighting
I recommend using the adaptive probe volumes instead of the light probe groups, those are automatically placed in the scene and offer way more accurate lighting
you can also use those as a replacement to lightmaps and they are a lot faster to bake
Okay added flashlight pickup and culling but one problem is the lighting on the flashlight itself, how do i add proper render to the flashlight itself? Also the flashlight has it's own camera basically 2 cameras in one scene. Also in the end which pixel resolution you guys prefer? 256x128 or 128x64 for PS1 graphics?
The flashlight camera is a overlay camera by the way
Oh yea since this is the lighting channel, i'm using URP by the way
What are you asking exactly, "proper renderer"?
Why does the flashlight need another camera
Oh hey Spazi! i think already fixed it! i just need to removed the Directional Light that was causing the lighting bug ha ha! Ah yes the flashlight with a camera. it's a FPS fix technique they use for wall culling fix
Expanding on the "sneaky fps trick" video
Music: Road Trip - Slynk
MP40 model: https://sketchfab.com/3d-models/mp40-machine-gun-pistol-downloadable-5a61e4dc4dda4b08a7aa452f8477d790
Gaming channel: youtube.com/c/GarbajGaming
Discord: https://discord.gg/mpHFmhW
Twitter: https://twitter.com/Garbaj2
A side effect of using another camera for an overlay is that it doesn't render the environment so you lack lights and shadow casters, so other methods may be preferable
No idea what "wall culling fix" refers to
You have to preface your problems in more detail
the "Wall culling fix" my bad for spelling it wrong, it's a way to fix items in first person, hang on lemme record it
here's the "Wall Culling fix" basically if i don't use a 2nd camera for the flashlight it would clip to the wall as seen in the clip
now this is the flash with it's own camera! so it fixes the culling problem! but the lighting is inaccruate
basically use of camera stacking
Ah, by culling your rather mean clipping
Glad you found a solution
If you end up needing different alternative options I can enlighten you
Yes please Spazi there's this method i'm confused about and how it's works, they said shrink the item inside the player collider but size it up via a "Shader" somehow which is odd, i don't if they mean ShaderGraph or "other", here's the video https://www.youtube.com/watch?v=9MB_bNLYAX8 skip to 1:00
Wishlist on Steam: https://store.steampowered.com/app/2280900/Blood_Rot_1918/
Support on Patreon: https://www.patreon.com/OBrooks
Go and subscribe to @garbaj! Do you know of any games that use this technique?
I first learnt about it from the Unite LA talk about the then-new FPS sample. Apparently the new Doom games use it, but I haven't been a...
Also they said it's a "fix" for the lighting of the item?
oh "doesn't suit for interacting with objects" ah never mind
Says "isn't a great fit" which I agree with mostly
With two cameras item interaction is totally impossible which is worse than not a great fit
Not sure why a shader is mentioned here as it's not really necessary or even helpful for this effect
This is generally the method I'd prefer though, even if there's a third option that overrides render order
Still you'll need to do more than this to get the flashlight to work correctly
If you poke the flashlight directly into a wall, the light source will be occluded
That's more just how we expect things to work than an "issue"
In that situation you'll have to decide if you want the light to be blocked by the wall's shadow, if the flashlight should move out of the wall's way way dynamically, or if the light should be attached to the player's viewpoint rather than the flashlight physically
Has a simple fix!
Bake your lighting, and USE LIGHT PROBES.
Wven tho your weapon camera dosnt render the environment, the lighting info is still stored inside of light probes so your viewmodel will be lit correctly.
This is generally useful advice but not the solution in this case
Light probes cannot create occlusion from any realtime lights
sooooo make the lights mixed or baked? Shouldn't that work?
With baked yes, mixed no
Baked lights can't have any specular response outside of reflection probes though
I think in this case the solution was to simply disable the directional light because it wasn't shining indoors anyway
Yep I just fixed it via removing the directional light
Im trying to apply lighting to my 2d game im haing this issue
why with sprite lit default is it still light?
isnt it supposed to be dark
i have the URP set up in the project settings too
If you have no lights, Lit sprites are treated as Unlit
It's meant for convenience
i did figure it out
No point having Lit sprites unless you have some light after all
i just had the wrong renderer
Anyone know how to view JUST the AO in the scene? like you can with Unreal?
Baked AO?
Texture AO?
You can view the baked lightmap via Debug Draw Mode (not exactly only the AO).
And you can use a custom shader and plug the AO into the Albedo channel, if you want to see the AO of your Material.
@chilly kettle Good point, I meant Texture AO. The option to plug it into albedo just to see what it looks like isn't exactly what I'm after, I want to see and know for certain that the AO is enabled.
What's "texture AO"?
Ambient Occlusion Texture Map
So, in a PBR shader? Not with post processing AO or lightmapping AO?
All three are ambient occlusion and use texture maps
What I mean is, that you bring your own AO for 3D Objects with the AO-Texture. And thatβs easy to show when plugging it directly in the albedo channel ^^
Maybe RenderDoc will let you view individual texture passes
But you could also just make a scene with some distinctive ambient lighting to try them out
The AO output of a material is nothing but a multiplier for any light that's "indirect"
go to the rednering debugger > lighting
Oh that's cool!
I forgot these overrides are also in Play mode from the debug menu you get by pressing ctrl + backspace
So, this is the bed of a dump truck that's lifted up to dump dirt. I'm having a weird issue where light seems to come through at the corners of the model instead of being all shadowed in there. Does anyone know what might be causing this?
How do you access this? I can't find out via google. Even the Unity documentation has this 'Select Window > Analysis > Rendering Debugger' which I don't see 'Analysis' in my Window> options.
Window -> Analysis -> Rendering Debugger -> Lighting
Oh sorry, just realized you said you didn't see it there
What Unity version?
Yeah, am using Unity 2022.3.1of1
Analysis is right there. 5th from the bottom...
Doh! Thankyou π
Lol! happens to the best of us!
Oh this is great, just what I wanted. Thanks!
Shadow bias pushes shadows away from mesh surface normals, so they don't "sink into" the geometry
But if you have split normals (hard edges) in your mesh, the pushing effect creates gaps between the shadow casting polygons
The best solution would be to disable shadows on the mesh, and have a copy of it that's shadows only with its normals calculated to be totally smooth/merged
If that's not an option you could try tweaking the bias values (while avoiding extremely low or high biases), increasing relative shadow resolution and enabling two-sided shadow casting
A problem that looks similar to that can also result from generally low shadow resolution
I've tried tweaking the bias values and increased resolution. I'll try enabling two-sided shadow casting.
Hands down the most watertight solution is the smooth-shaded shadow caster mesh
It should be a built-in option
I bumped it up from 1024 to 2048. This is a work project and we have limited graphics due to high level of physics calculations, so I'm not sure i can put it any higher because of the performance hit.
Thanks, I'll look into that as well.
Graphics are calculated on the GPU, while physics are on the CPU so their performance costs shouldn't stack up
I believe we offload a lot of the physics calculations to the gpu as well though because of the high amount of them. We have physics based diggable dirt and physics based machines, so there's a lot going on.
Interesting! Then you'll want to pay special attention to the shadow settings
Increasing shadow resolution is not the only way to increase relative shadow resolution
Shadow resolution is spread across shadow distance, so decreasing distance increases the resolution effectively
Shadow cascades are also useful for packing higher resolutions closer to camera where it's needed without affecting the distance or resolution, for a small overhead cost
Yea I was playing with the cascades a lot but just couldn't seem to get rid of the problem. even when I bumped everything up to really high resolution just to test the fix, it still had the same issues. Almost makes me think it's a model issue, like it doesn't recognize there's a model there in that small area.
It's possible
The mesh you use for shadow casting should ideally be fully gapless and have totally smooth normals, and minimally overlapping parts
It sucks that we can't easily define a "shadow caster mesh" directly from the mesh renderer component, nor change the mesh properties for shadow casting
So you have to use a child object mesh renderer for it
Or alternatively author the mesh with no sharp edges at all, instead using bevels with hardened normals
But that might double the polygon count
I wouldn't be surprised if it's a model issue. We use a 3rd party company for doing our models and they seem to have a lot of issues. I may open it up in blender and take a look. I'm not an expert at modeling at all, but if i can at least see that there is an issue we can send it back to be fixed.
Thanks for the help, and all the info on shadows. If anything, I've got a lot of possible routes to try for fixing or improving the issue!
There's no issue here technically
Shadow bias works as it's expected to
Models with sharp normals are common
Them together have this unsightly side effect and Unity doesn't provide any fix to it directly
Ooooh I see.
But if the gap is unexpectedly big, it's also possible that the mesh has an inverted normal that appears as a gap to the shadow caster, but not to the viewer in case the material is two-sided
But that may be a bit far fetched
@static thorn here's an example of what I think we're looking at
Ah ok I see what you mean. Is there a way to check for back facing normals in Unity?
The fix I'm suggesting is to use the mesh on the left for shadows only
Not sure if directly, but I'd check to confirm the material has render face only front, and then inspect visually
Alright
You can control the normal smoothness of an imported mesh within Unity if needed
Using Normals: Calculate with Smoothing Angle of 180 makes it entirely smooth
The only annoying part is you need to duplicate the mesh and use both
Then duplicate the mesh in scene, set the duplicate as the child object, change its mesh to the smoothed mesh, set mesh renderer to shadows only and set the parent mesh renderer's shadows to none
If that fixes the problem then it likely was the sharp normal gap problem
Alright, I'll give that a shot.
How do I make light be a different color
I changed the color to red but it doesnt change
vertex lighting?
not sure what your setup is there
Just some realtime spotlights going over a probuilder road
The streetlamps are mixed spotlights
I figured it out, the street lamps were set to important and the maps not properly baked for some reason
Hello! I am having a very bizarre issue with lighting in built-in. When using deferred rendering on a scene with realtime lighting it looks like this
forward rendering on this same scene looks like this
nothing unusual so far
but when making a completely new scene from scratch, these are the results
forwards looks like this
but deferred looks like this
which makes absolutely 0 sense to us
there is nothing fundamentally different between the setup of both scenes
both are using the same standard lit built in shader
hell, if I disable every single light in the scene it still looks like this
while forward looks like this
I am completely lost here of why this is happening
it even seems like there is something adding light to the scene
but as I said there is no lights in the scene
so yeah, if anyone could lend me a hand I would greatly appreciate it, I am out of ideas, there are no lights in the scene, no lightmaps (game is purely using realtime lighting), no enviroment light so I am completely lost here, specially because it does work on other scenes
this might be an issue of how we are importing the packages I think these assets come from another project that works in HDRP, but still, the behavior seems highly unpredictable
reflections?
maybe? I have no idea where to look at
this seems like a bug to me tho
because if I move the assets outside of where they "should be" they instantly are illuminated like they should
so for some reason being confined to that space makes them look like that
and by that space I specifically mean that space
if I move the parent this happens
Spot on, thank you so much
why would reflection probes make the scene act that way btw?
forward
deferred
well forward rendering has a very simplified reflection setup, I believe its only 2 per object, and a crossfade is done between the two
with deferred its a little more complex, but it leads to better fedelity. You can have as many per object, and blending between probes is higher quality
now not to sure whats different about the reflection setup, but clearly it looks like the deffered rendering doesn't have a good reflection fallback
yeah, I was going insane I had no idea what could have caused that
in the topic of "I have no idea why this is happening"
its kind of hard to explain but I'm sure someone here can explain it better than I can but your issues are just with reflections
thanks for the info, deleting the probes certainly fixed it, now I am getting another problem that doesnt happen in a clean scene, if you can see from the video, on deferred, when I have an object being iluminated by 2 real time light sources the places where they meet looks pitch dark
ok so it seems like you aren't aware of the differences between forward and deferred rendering
both are rather different, and have different limitations
but what your seeing there in that clip you posted
is a limitation of forward rendering, that being that there is only a set amount of per pixel lights you can have for an object before unity falls back to vertex lighting them
usually the limit is set to 4
4 per object
but you can increase it
but there is a side effect
deffered is alot better and doesn't have such a limitation with per pixel lights, and it also scales better with more realtime lights
Yeah aware of that, its also significantly slower with multiple realtime lights which is why we were using deferred on this project. I dont get this clipping issues on another clean scene so I am wondering why this might happen on this specific scene
ohh wait I viewed that wrong, your switching to deffered which has those patches, I thought it was forward
haha yeah you would think its the other way around!
Forward should look worse
yet deferred has the artifacts
I already cleared the baked oclussion culling so its not that
hmm not sure what it could be, I have no idea what your scene setup is so it could be due to alot of things
I'm assuming this is the built in pipeline?
built in yep
mix of both hmmm
it seems the glitch here is the spotlight is acting as an area light for some reason
nvm again its acting as a square in both
but in forward the indirect lighting masks it
deferred doesnt
it seems like it lighting the objects in chunks?
aghhhhhhh
spot on
works perfectly now
thank you so much for the help
I lost like 7 hours of work today due to these 2 stupid little bugs π
Forward wasnt an option because the game framerate was tanking
if frame-rates are tanking might need to eliminate lights/shadow casters
if lights don't change in your levels might be worth just baking them
only on forward, game is running at smooth 90+ fps on a scene with 0 optimizations, culling and like 40+ real time lights hehe
we have some gameplay mechanics tied to turning on/off light sources so we would need some custom solution
but yeah, thanks for the help! The same setup not working on essentially the same scenes was driving me crazy haha
Is there any way of stopping 'double shadows' when using subtractive mode baked lighting? E.g. when the dynamic character heads into an areas with baked shadows, I can see both the baked and realtime shadow?
1st Image:
I have made these triangular mesh tiles in ProBuilder for generating a procedural mesh terrain but some of the edges of the triangles are sometimes very visible and the shadows are kind of strange.
2nd Image:
If I set the material to unlit, the edges aren't visible at all anymore so I'm guessing it's due to a lighting issue
3rd Image:
If I drag a road spline with terrain edges using the same material through the terrain, the lighting is very strange again. One side of the road is completely covered in shadow which makes it very obvious that the terrain consists of several smaller pieces.
Is this a lighting issue or an issue with the material/normals? I tried to select the meshes and check the "Generate Lightmap UVs"-box which I hadn't before but that didn't seem to do anything. Is there something wrong with the meshes and how can I fix this?
Thanks!
This could be similar to my issue, do you have any tips for my problem I asked about? π Seeing as you appear to know a great deal!
I'm not generating the meshes at runtime, I'm merely placing them so could it be that I need to recalculate the normals for my meshes beforehand in the editor? Can I do that?
Guys do you know any Tools that can bake Shadows ONLY?
That Works like unity 2014 lightmapper.
Whats the best Setting for a high quality baked light?
if you are willing to wait up to 10 minutes for baking the light with a 4090.
Whats are the settings because the default settings seems to be pretty low and just increasing every value x4 doesn't seems right with some values in the lightmapping settings.
So whats settings are the best for a highend quality baked light?
How can I bake light in 1 scene but in parts, not full baking in single time but like in 4 parts, but scene is single
Hi. In my project, the glare is reflected from the lighting of the models (textures). I saw on the Internet that I need to remove 2 checkboxes so that this does not happen, but this only works on standard materials created in Unity itself. This is not available for my textures (in the model itself and in the "textures" folder, where texture images are stored).. How to remove glare?
P.S. I did not understand which channel is responsible for this problem. I apologize in advance
does anybody know why this happens? its a terrain tree painter and im using a prefab but when i place it and i go abit far, they render like this for somereason, im getting this error aswell
It looks like the lighting problems are normal discontinuities between your ground pieces
You'd likely need some code to merge the normals of border vertices of adjacent tiles
Or generate the mesh entirely in script with merged normals to start with
Maybe what you're looking for is to set bounces to 0 or indirect intensity to 0
"Shadows only" doesn't fully make sense to me but without any indirect bounce lighting you'd only get shadows from direct lighting
There are no universal "best settings"
The default values are generally the highest you need
If you feel it's not good enough, there could be other causes for it that we might be able to diagnose if you provide images
Are the cars static? If so, is the lighting baked?
Does the light provide any shadows for any dynamic objects if you move it out from within the pole?
Normally you cannot, but there may be some custom solutions
Partial light baking seems a bit challenging as every object might be shadowed or illuminated by objects you would exclude in this case
I see. Does that need to happen at runtime or can I do it before in the editor? Because I believe I found some code for recalculating normals at runtime here: https://forum.unity.com/threads/how-to-recalculate-normals-so-they-appear-smoother-on-chunked-meshes.898649/
It's in the post by someone named "yurowm"
It would need to happen at whenever time you compile the chunks together, unless you set the normals at the seams to always point a specific predestined direction so there can be no discrepancy
That'd require every seam to be essentially flat and level though
This is a material setting, not a texture setting as they are very different kind of assets
The option should be available on your custom materials using the same shader as here
I see. I don't know how to "compile chunks together" xD I'm just placing the tiles in a grid!
So what if I just do it on every tile/mesh when I place them
It doesn't need to happen at runtime then, but at least before you finalize the level
Hmm, I'm placing them procedurally at runtime. That's what the game is about, kind of. You build little procedural islands
So I'm guessing I'll just run that recalculate normals-script whenever I place a tile at runtime then?
Yes, or once all tiles are placed, depending how your system works
Do I need to create a separate material for each texture?
As the warning implies, distant trees use billboarding, which won't work without the correct shader
Yes, or if your mesh already has embedded materials with the texture references you can extract them as well
I was hoping that I wouldn't have to make a material for each texture, but I will have to... Thanks
okay HOW do you add a texture to a directional light (the sun)
Understood, thank you! π
Do you mean a light cookie for the sunlight's shadows, or a sun sprite / flare in the sky?
no idea what a light cookie is but
yk
when you have a light
Can you try to explain in some more detail?
see that sun looking thing?
yeah i wanna change that (look wow minecraft clone :D)
There'a generally three methods to give the sun visual appearance
First one is the sky shader itself which is what you're likely looking at
Flexible if you're making shaders to begin with but inflexible if not
Second one is a lens flare component
Third one is a mesh or a sprite that's set to render in front of the sky but behind the world, and controlled with scripts
the thought of making a shader gives me the chills so
what's a lens flare?
You can figure out that faster by googling it than I can tell you to google it
Each render pipeline has its own lens flare implementation
I mean the point of me asking it here was because Google wasn't helping me it was confusing me
So I figured asking people who I can actively talk to would be better
Sure, but you need to be able to point out the confusing parts or we'd just repeat what the google results tell you
I fixed it, it was some thing in the terrain settings
cars are not static, player body casts shadow
player body not static either
lighting is fully baked, lights are mixed
If you hold your cursor over the setting, it days higher values can cause better quality.
Ub my case the quality is not accurate enough and very pixelated.
I just can take the degault values and multiple the value by x2 or x3
But are there some settings that should not be made higher or even cause worse qualit- if the value get higher?
There are other reasons for pixelation than the bake quality settings, which is why I'm asking for screenshots
Oftentimes totally unrelated causes
Why are my contact shadows acting up like this and flickering?
Uh all Shadows are now black
thats now with default settings
forward rendering limitation
what render pipeline are you using?
with the built in pipeline you can increase it to be as high as you want, in URP you can increase it up to 8
urp
how can i do this? is there a source you can recommend?
as mentioned in there also, its specifically a limit to the amount of lights per object
so theoretically you can have as many lights as you want in a forward rendered scene
you just can't have more than 4 lights (or 8, depends on your limit) PER OBJECT
Sure, I'm not sure what else you mean by baking "shadows only"
I think your light sources are way too close to your candle meshes
Bake resolution is the only setting that affects the actual texel density of the lightmap, other settings may reduce noise and improve the accuracy of the lightmapping
But no light source will work very well when it's too close or clipping into geometry
You can also increase lightmap resolution per object by increasing a mesh renderer's "scale in lightmap"
But you shouldn't try to get sharp shadows by increasing lightmapping resolution, as the diminishing returns are incredible
You'd rather use mixed lights in that case, or fix the problem that's causing unnecessarily sharp shadows in the first place
https://youtu.be/HnbZbPo7gnk?si=WilSTWsE9t3Tz3yK
I wanna bake shadows like in this game idk
Gra do zagrania na:
http://murdershadow.ct8.pl/
Wymagana wtyczka unity web player:
https://unity3d.com/webplayer
KrΓ³tki niezobowiΔ zujΔ cy gameplay prezentujΔ cy grΔ autorstwa MrKibass'a i Unit13. By Gamers for Gamers.
What's the issue with the kind of result you get with default settings?
It should look similar or a bit better
If you need it to be precisely similar I guess what you want is a lightmap baked with no bounces that's brightened by a bit afterwards
Bakery has a global brightness option but with Unity's own lightmapper you may have to do something hacky like brightening the whole lightmap afterwards (and maybe also light probes)
You get a similar effect using a realtime light with a solid ambient color
If you don't have to do anything hacky, all the better
wow ty for your time man
i solved it reading these
You can see there is no dark Places
does the 8 lights per object limit also apply to baked lighting?
Not purely baked, but mixed type lights yes as they have both realtime and baked functionality
is there any way to cast the shadow of a 3d model onto a tile map/2d sprites?
Hi I am trying to use fog and in 3d it works but in 2d it doesnt
How should I fix that?
I want fog to appear behind the house
Mainly if you stop using sprite shaders and use 3D shaders on your sprites and tilemaps instead
But it's technically also possible to make your own shadow caster pass and sample that in a sprite shader
@deft fiber How do I change the shader of a tilemap? change the materal from sprites-default?
yes
Not all sprite features will work if you stop using sprite shaders, though
what stops?
2D sorting and sprite masking mainly, color tinting also but that can be reimplemented
Hello π I have a problem with "flickering shadows" Unity: 2022.3.16f1 and HDRP
It's on a very tiny specific angel. No occlusion culling or anything with turning off gameobject.
The light is realtime
this happens only in build. During playmode in editor everything is fine
Looks like shadow 'acne' , try adjusting shadow bias
https://docs.unity3d.com/Manual/ShadowPerformance.html
I accidently discovered that making gameobject static cause this problem. When I turn off static checkbox then shadows are ok
but why?
this one not help, but making them non-static also doesn't work everytime
reloading the scene also make it worse
I have a fire effect made with vfx graph that I want to see reflected on the ground, how can I do it?
hi, i want to increase my point light range while keeping the intensity value?, is there anyway to do that? because i already tried to increase the range but it wont change and i realize that i need to increase the light intensity too
Range is an "upper limit" to how far the light can illuminate, and will not affect intensity unless it has to cut off the light's effective range
Lights are always brighter closer to the light source, so you can't "extend" the light without changing intensity
https://forum.unity.com/threads/how-do-i-increase-point-light-range-without-changing-intensity.1101673/
yup figured, and this guy figured it out by changing the Lighting.hlsl source code, sadly i am not familiar with it, and i am afraid changing the source code will have other issue as well
It requires you to have a modified URP which can be troublesome
Another option is to only do that on a per-shader basis
guess i need to learn about shader for lighting, thanks for your help 
If you find tutorials for toon shading or custom lighting you'll be on the right track
Those usually implement a custom light attenuation, which you probably want to be basically gone entirely
does anyone know why my player shadow is pixelated but all other shadows arent?
It looks like the other shadows are too, but the ground doesn't make it easily apparent
Check that soft shadows are enabled
now that i look at it a bit closer, all shadows are pixelated, but enabling soft shadows doesnt change anything
They should also be enabled in the quality settings, I believe
wdym "quality settings?
https://docs.unity3d.com/Manual/class-QualitySettings.html
These if on built-in render pipeline
Active URP asset on URP
If soft shadows are disabled in the quality settings, trying to enable them on the light source would not do anything
im using urp, so what do i have to do? sorry for the questions, im unfamiliar with lighting in general
Hey does anyone know why I'm having this weird color blending happening??
Definitely looks like a reflection from the light
Turning smoothness down would likely eliminate it
Did you find the settings in the URP Asset?
i'm making a map and i used a shader pack called poiomi to make the neon material, but then when i bake it, the lights seem off, specially on the doors, the doors are so bad, the rest of the lighs seem like they could make more light but they don't, can anyone help, plese? i'm new
Did you try with the default materials with emission rather than custom if the problem is specific to that?
default doesn't emit light at all
also this error with these options
darkness inside the light
It will if you enable emission in the material with global illumination: baked and the object static
Test it with defaults only first
I'd always tart by looking for issues using the GI debug draw modes, primarily UV overlap and texel validity
https://docs.unity3d.com/Manual/GIVis.html
There's probably more issues there too so look f or similar problems that are shown in this guide
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/
Could be denoising problems or lightmap UV bleed problems, at a glance
oh it actually works, but it's very weak
Then you can boost the material's emission intensity
It could be that some of the custom shaders were boosting their own visibility or brightness in some way, which would make it hard to make everything consistent
Since you have a lot of occluded emissives, you could try increasing max bounces to 3 or 4
Note that you have warnings about UV overlaps in the console, which is what my earlier links will help you deal with
Hey, Is there a way that I can somehow bake light/shadows into a prefab?
I'm new to light baking and the visuals side of things. (Been about 4 or so months working on the dev side of things though)
I'm trying to achieve a look, and baking light (the static objects thingy) gives me pretty results
The issue is that, my level map will be dynamic (i will be initializing prefabs at runtime)
Now I've chunk of level map that stores 10 levels each. I want the look it gets when I bake light in the scene (when I make all of the objects in the chunk static)
I also want to give short animations to stuff on the map (interactive animations, when they are pressed, I would like to play a short animation)
I am using the builtin render pipeline. Idk how to write my own shaders. So shader side of things are kinda limited for me.
Just ping me when someone replies to me, I wont mind.
Thank you a lot, in advance. π
Could try this
https://github.com/Ayfel/PrefabLightmapping/
And also theck out this for some tricks potentially
https://youtu.be/KbxiGH6igBk
Thank you once again.
I will look into it tomorrow and will update here.
Stay blessed
Complete beginner here. I am trying to add a spotlight, that I was hoping to model into being a sort of an "opening in the sky", to indicate if a unit is selected or not. I have added a spotlight as shown in the image, but it seemingly does nothing. The map is an isometric grid with multiple layers in it. The character is a rigidbody2d entity, with a fixed z position. When I start my game, the spotlight is seemingly invisible and has zero effect. What am I doing wrong / misunderstanding ?
Are you using the 2D renderer and is it a 2D light?
@deft fiber Good questions ! No clue how to answer them! π
@deft fiber The light is created from the menu. Right click hierachy, Light, Spot light. Unmodified at that. How do I check what kind of renderer I am using ? I have just set up a default 2d project and added an isometric tilemap to it
URP 2D?
How do I check?
OK, never mind. I found some stuff online. I'll meddle with that for a bit and see what happens. Thanks for the hinter @deft fiber !
Once you have URP 2D installed and configured, you can use 2D lights with Lit sprites
This one, yes ?
I think I have set up a new renderer, but no difference, even though I added a spot 2d
no, i have no clue how to find that
URP asset is referenced in your quality tab, clicking it will take you to the asset
That will contain your shadow settings
Googling any of these terms will likely yield more information
You can check that your active URP asset in the quality tab is using a 2D renderer, then confirm that your sprite renderers have a Lit sprite material
With those, the 2D lights should work
i enabled soft shadows but my shadows still look clunky?
any idea why?
The resolution is too low / shadow distance is too high / not using shadow cascades
i've been messing around with these settings, but i cant achieve good looking shadows without also them being seen from far away. is there a guide i can read on what settings are optimal?
None that I know of
The default settings you get when getting an URP project template (or should get when installing URP) are usually good for most purposes
But depending on the scale and needs of the game they still often need to be tweaked up/down from there
Yours seem to be set to absolute lowest
i'll try my best to mess around and see what i can do. thanks for all of the help otherwise π
If you make a new project from the URP template using the same unity version, you'll probably can plagiarize the settings from there, or even export and import the asset over
i did that and it looks perfect now. thanks a lot!!!
@deft fiber Sorry for my delayed response - I was out travelling. Is it this you mean ?
Yes
The project settings>quality tab should have a reference to that asset in the currently active quality level
If you make a new project using the URP 2D template, create a new sprite gameobject into scene and a 2D light, it should light it
Could make a test project like that and compare
That was set to none, but I selected that asset now
If it was set to none, you also need to ensure that project settings>graphics has the reference as well
In other words confirm that the URP 2D configuration is complete
There are step by step guides to that in the docs
It was set in settings -> graphics ... which I did when I followed that guide π
I guess, since I created my game objects before I added URP2D, they are missing some sort of config that gets automagically added with URP ?
project settings>graphics and project settings>quality
So, next check that the sprite material is Lit like I mentioned previously
@deft fiber On the spotlight I have created, or do I have to add a material to my character ?
Sprite renderers need the Lit sprite material
@deft fiber The sprite renderer of my character definitely doesn't have a Lit Sprite material. Nor does a material of that type exist in my project, it seems
Ah, I finally got it working ! I had to convert my assets to urp2d π
@deft fiber Thanks a lot for patience and quality feedback! Much appreciated π
The only converting for urp 2d is swapping the material
For some reason the sprite Lit material is hidden from assets but newly created sprite objects have it
@deft fiber I went to Window -> Rendering -> Render Pipeline Converer .. once I ran that and converted to (Built-in to 2D URP), it made the materials and automatically applied it to my assets
@deft fiber Getting there π
Hi, I have an issue. Whenever I imported my blender map and I bake lights in unity, the map gets bright/lights up. I want the shadows to look good and I donβt know why itβs doing that. Any tips?
What does the "glow up" look like?
Got any warnings in console?
It basically makes the map really bright
Idk itβs like a bright light
So why don't you show how it looks like
Words are ambiguous, but most lightmapping problems can be recognized from their appearance
Iβm going to open my unity project and send you a picture
@deft fiber it does this
Itβs weird
Prefer to take screenshots in the future rather than photos, can't see much here
You should rule out UV overlap and texel invalidity problems first as they're the most common
https://docs.unity3d.com/Manual/GIVis.html
These debug view modes can reveal them, but only work if the lighting has been baked in the current session
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/
Additionally look for a visual match of the error using this guide
And if your surfaces are using custom shaders, try baking with unity's default lit shaders instead to rule out that issue
Custom shaders may apply lightmap and brightnesses in unpredictable ways
Whatβs uv overlap and texel invalidity? Iβm not very good at unity
Chapters 9 and 15 of the linked guide explain those
Why is my default scene so bright I dont even have any lights
Scenes have Environment Lighting by default.
How do I deactivate this?
In the Lighting Tab
yeah that makes sense ty
Looks like lightmap UV overlap
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/
c.9
god i hate text in unity , it just spawn a big ass canvis
is there a way to make it not be.. this big and have to scale it down everytime
Use Screen Space - Camera π
You aren't expected to scale it down
You can double click the Canvas gameobject to frame the scene view around it
(or hit F with it selected, also, I like to hotkey the 2D mode to "2" key so you can very quickly view the canvas as it is)
Canvas treats each unity unit as one pixel, rather than one metre so the size difference is intentional
Also, #π²βui-ux this has nothing to do with lighting
Game View vs Scene View why is the game view white?
Mostly looks like fog but really hard to tell from a vague image like this
No fog
Any idea for better images?
Oncropped and showing more things in the scene
Maybe also what type of lights you're using in the scene if any
No lights
Which render pipeline? Is post processing enabled?
URP post processing is disabled in the camera settings
And if you enable it?
no difference
any other component attached to the main camera?
using canvas?
yes
reduce the alpha of the overlay ui
np
Quicker if you can provide screenshots that show everything, including the hierarchy so way less need to guess things one by one
For future
I will do it in the future thanks anyways
Hi, have a nice day, guys.
I would like to ask what possibility cause the lighting in my imported scene go wrong?
I setup lighting for a scene in a different project and then export as unitypackage to another project.
I checked ProjectSettings/Graphics, /Quality and Rendering/Lighting configs but they are the same.
For me it looks like your Materials are more rough / less glossy on the right image. And maybe the direction or intensity of a light has changed?
Thanks for replying but no, the material of the model is the same, same goes with the lighting settings within the scene.
After checking the project settings and lighting settings, I thought about the difference of Unity version. The one I setup the scene is 2022.3.11f and the one project I actually use is 2021.3.14f. I tried upgrade the project but the result is still same.
That's it! Thank you sir!
I am really new to unity and it seems to be a problem with my blender house that i imported to unity. does anyone know how to fix the walls being see through in the inside but not on the outside
Are they only made from a single face, or do the wall have a thickness?
What you see (or not see) there from the inside is the "backface" of a face.
In Unity and many other tools you can see through a backface of a face.
In your Material you can change that to "both sides", so the engine renders not only the frontface but also the backface.
why the light in the scene view is not the same light when running the game ?
looky nearly identical to me ^^
In game mode, I can see the pixels of the lamp, which makes the quality feel lower
Can you show that more detailed? ^^
I feel like the scene mode is smoother
how to fix it? I'm using vintage house materials
game light is so bad idk why please i really need help about that
thats not a pipeline
the light looks fine to me
you mean the pixelation?
Do you use a low quality setting when building the game?
Is Anti Aliasing helping with the problem?
Show an uncropped screenshot
Seems likely that you have zoom enabled in the game window
Another option is lowered render scale in render pipeline asset, but that rarely happens by accident
any idea why light changed by script is so bright at night?
RenderSettings.ambientIntensity = 0;
sunLight.color = Color.black;
sunLight.shadowStrength = 1;
0:11
Even if the ambient light changes, the reflection probe does not
RenderSettings.reflectionIntensity = intensity;
like this?
Environmental lighting consists of the main directional light, the ambient probe and the reflection probe
I think now works thanks
I think overriding the intensity settings works yes
Other option is to recalculate them, which is accurate but expensive
Third option would be to blend between precalculated probes, which could be the best result but maybe finicky and unsupported
yeah Im doing day cycle and calculating it when time changes
what about those normal shadows?
I cant find anywhere to change it
By "normal shadows" do you mean the ones cast onto the ground by the directional light?
What isn't lit by the directional (or any punctual) light is lit by ambient light and reflections
The mix of which is determined by material smoothness and metallicness
All lighting is affected by normals
I dont really understand
I mean those black sides
they are completly pitch black
Yes, they are lit by ambient light
Since you're modifying ambient light, it means your ambience is all black either from having no ambient/reflection probe information, or from you reducing the intensity to 0
is there ANY way i can make transparent materials cast a shadow in URP
ive been looking for a solution for 3 hours now
an Opaque Shader with Alpha Clipping
Ill try that rq
TYSM.
Idk why I couldnβt find any answers online when it was that easy
i know what you mean π
Where is that setting?
In you Render Pipeline Asset / Settings
Why does baked light looks so much better than realtime?
Realtime lights do not bounce. Baked lights can bounce so you have a way more realistic appearance
Well. Realtime lights can bounce with Raytracing, but thats very expensive, like you can see in Cyberpunk etc.
why exactly?
I mean such complicated realtime things like raytracing does also exist, so why no default realtime lights that can bounce?
well, a lightmap doesnt need highend hardware and achives the same visuals like a realtime light with raytracing that needs a good GPU ^^
what is a lightmap?
The resulting texture after baking light ^^
Little APV test in 2023
Does anyone know why this is happening? This is in the scene view and if I zoom in or zoom out it changes color, like green, blue, red, and yellow. I don't know if this is a new feature in 2023, I've always worked on 2019. Any help will be appreciated!
my lighting goes through walls, i have the walls normals flipped since you are inside the box you can see the wall texture, but from the outside you can see in and light passes through
Oh! you need something blocking it from that side.
A simple fix would be to make sure those walls are double sided
You could test it by toggling on render faces "both" in your walls material
how can i do that?, i used pro builder to make it
Just edited my above reply to something more specific to solve that!
thank you!
anybody know how to make a fake shadow effect like in this picture i dont have lighting enabled in my scene
ok thanks ill look up a tutorial on youtube
a decal of a black circle is the easiest way to throw something like that together
thanks for the advice but i already solved the issue i just send a ray out wherever it hits it moves a sphere to it
It will not work on non flat geometry. You can use a decal instead of a squished sphear to solve that as Kabinet suggested
You can also modify the shape of the shadow blob with decals, like make it smooth around the edges
wdym mean flat surface?
any idea why bro's legs aint casting shadows
Normal maps are not set as type normal map, or something else is wrong
I'd try to poke the problem more precisely by moving the mesh and the light, to see if the problem could be positional
Also confirm that shadows are enabled on the legs' mesh renderer
yep turning normal map from 1 to 0 fixes it, but then obviosly i have no normal map active
Normal map textures need to be set as type normal map
lol im a bit dumb, thank that fixed it !
is there any good alternative for lights with IES textures in URP? (Seems to only be supported in HDRP)
Light cookies perhaps
Sorry to bother and for the long message but I wanted to know why, in HDRP 2022.3.17f1, in the shadows section of the directional light (Sun), there is nothing else such as the "Dimmer" or the "Tint" etc.
I also wanted to know if it is possible to change the maximum rendering distance of grass, rocks and other details, because every time I try to do a level design I have to try to cover the furthest part of the terrain (usually it is 500x500 large) with large assets to Don't give the feeling that it's not complete
lastly, it seems that even if I bake the light, the reflection probe always gives this message in the inspector: "baked reflection probe normalization data is invalid". I would like to point out that everything I have said up to now I have also tried on a new and clean project to see if it was just a moment
Thanks in advance
could someone explain or link me something that explanans reflection probes, im not sure how many you need, is 1 per room good? or if a room is in an "L" shape shoudl i use 1 that covers the whole thing or two different probe? does the location of the probe its self have and effect or can i put it anywhere as long as its borders cover the room
That depends on the realism of your scene i would say.
If you need some realistic reflections on reflective Material such as Glas or Metal, you should add some more Reflection Probes to your scene.
One should be enough per Room, if its not to big.
If its an "L" shaped room, you could add two probes, one for each "L"-legs of the room.
so this room is okay to have just the 1? imo its looking good so i think so
if purple is your room with some walls, you can add reflection probes like this (red)
whats the point of the middle small one? cant you use jsut extend the top one?
if there is a wall, the top one cant see whats behind the wall
a reflection probe is more or less just a 360Β° camera
and what it sees is mapped on the reflective materials
oh yeah mb just saw the walls
@chilly kettle do you think ill need 3 probes in this room or just the 1?, idk how performance heavy they are. i have it set to every frame, idk if i should put it to "on" or "on demand" idk what on demand does
Games normally work with LODs when it comes to show objects in a far distance.
And im sure you know the look, when stuff in the distance appears from nothing or changes its details when you come closer.
You have to keep in mind, that reflection probes are not like a perfekt mirror, like you can see in the reflections of your water.
They are always a little "off".
For the performance:
If your scene doesnt change much, its enough to BAKE the reflection probes.
You can change the resolution to save space. Turn it down as low as possible until you cant live with the quality anymore ^^
Often its enough if the Reflection Probe is like 128x128 px. If 128x128 px is enough, you can use dozens of them.
tbh its not even a detailed scene other than the water, and the water refracts the light anyway you you cant even notice it
so i can probably get away with it
what does on demand do?
let me have a look in the docs
on demand updates the probe if you request it by code
i would recommend baked.
ok ok π
as youve said if you look hard enough its perfect, its just like sniper scopes in scp when you rotate, i guess it has a reflection probe
so how could you get accurate reflections?
There is a technique called "Screen Space Reflection".
I have never used it, because i am completly into stylized art.
But i can give you the docs ^^
https://docs.unity3d.com/560/Documentation/Manual/PostProcessing-ScreenSpaceReflection.html
The Unity Manual helps you learn and use the Unity engine. With the Unity engine you can create 2D and 3D games, apps and experiences.
stylised art? as in art thats not realistic and more creative?
oooohhh thanks! ima go look at this
Yeah.. like warcraft etc.
Thats the stuff i made: https://www.instagram.com/p/Cz3nClKqXZq/
this is what I did and as you can see just beyond the river you can see the grass prefabs and a little further down the bilboards but if I try to paint other details further down or add them manually they don't appear, except the trees, unless I move the camera closer and in the terrain settings I had already set the rendering distance of the trees and details to the maximum.
I wanted to know if there is a way to increase this render distance
Do these trees use LOD Groups?
yes, but also grass and rocks
you can adjust the distances, where the different LODs appear.
I'll try as soon as I have the chance
Maybe I left them at the default parameters
but thanks
hello again π I'm going trough the unity template about URP and I noticed something weird. I'm in the section about local lights. There is a expert tip: "To optimize performance, you may decide do reduce the number of real-time lights, turn their shadows off, or set their Mode to Baked"
So I did it, to learn I change one of the spot light from mixed to baked and after generating a new lightmap the shape of the light is broken. On the screen in right circle is mixed, and on the left circle is baked. Could someone please explain to me why this happened?
when I go back to mixed the ligth shape is the same as the one on the right
Mixed lights also have a realtime component so you get baked bounce lighting from them but fully realtime direct lighting and shadows, including normal maps, while baked lights only write to lightmaps
Lightmaps don't capture normal maps, but if you're baking with Directional Mode enabled, then the additional directionality maps can give you a somewhat vague approximation of normal mapped lighting
Lightmaps are also limited by their resolution, as mentioned, which makes them a poor fit to capture any sharp spot light shapes
lightmaps do not have normal map data, if you want baked lights to affect normal maps use APV's
Any way to incresce the render distance of realtime and mixed spot lights in unity?
They fade out when you go far from them.
Do you have a lot of lights? Maybe they are turned off because of the light limit
Its a hallway with 4 mixed lights shining down from the top
Baked indirect lighting
go to edit-> project setting -> quality -> increase pixel light count to your desired number of lights.
Could solve the Problem
if you are using URP - go to your Universal Render Pipeline Asset and increase the Per Object Limit value, located under Lighting > Additional Lights.
Im using hdrp
Are you baking using distance shadowmask, or shadowmask at all?
In my experience shadows have a fade out distance, but lights do not
With the exception of shadowask distance which basically blends between mixed lights and baked lights at the threshold
I think it has improved slightly, these are the images, I just don't understand what sense it makes to put the detail distance to the maximum if the grass reaches a maximum of 43 distance. if this is maximum, patience, I will adapt
Yeah you're gonna want screen space reflection to get accurate reflections on your water
Reflection probes will help shade the room accurately
But they will not provide accurate reflections on mirror like surfaces (like water)
Funnily enough I was working on a scene like that in unity back when it was the hype so I could give you some advice specific to that type of environment scenario
Use area lights for the big light holes, set to mixed mode so that the light bounces around with a nice bake, but still gets nice real-time specular highlights
You want your scene to have full reflection probe coverage, but placement depends on how much of a difference there is in lighting around the scene
For that shot there is 1 reflection probe that covers the entire room because the lighting is mostly the same, and the difference in reflection is not noticable (since the water is reflecting realtime reflections with screen space reflection which overrides reflection probes)
But then for example I had this dark tunnel somewhere, and you would need to put different reflection probes there so that they don't reflect the "bright room"
I would place one at the threshold between light and dark, and than one in the dark area to make sure the dark spaces are shaded properly
I know other people have given you almost the same suggestions above, but just wanted to drop in my 2 cents since I dig the aesthetic
Not sure if this is an option in URP, but in HDRP that feature exists
I have quite a dense scene in my game in terms of lighting and if this didn't exist I'd be fucked π
In this case judging by how square and blobby that light is it indeed looks like too low of a lightmap resolution. You can increase the lightmap resolution as a whole for the scene, or a more optimized way is to increase it only on objects that need a higher resolution if the rest of the scene is fine
On the object's mesh renderer there is this value where you can multiply the resolution given to that specific object without upping it for your whole scene
It however still wouldn't capture the grain of the wall very well. To improve this you could enable "directional" lightmaps
However this means unity will generate an additional lightmap to store the directional data to give you a higher fidelty of light hitting at an angle at the cost of more vram, and space on disk
Yeah it's an uphill battle here too
We work with HDRP for the lighting and rendering fidelity, but the added overhead is quite a big chunk, so we still needed to implement a whole bunch of our own optimizations to make it run on lower end hardware
Especially because we did it as an "upgrade" to our already shipped game that ran on built-in rp, so we needed to make sure our original system requirements were still being met
Good thing Built-In was unoptimized as fuck too π
Don't even talk to me about the high shadow filtering that's still broken 
The "universal" part refers more to compatibility than the features
You can look into the diffrent rendering types( deferred and forward ). lights and shadows are more performant in forward rendering
Yeah we use deferred, but shadows just cost a lot
i have a smooth tile texture (which i kind of want to change but they will do for now) which reflect the room as well, but i think i want to
thats pretty much exactly where im trying to get to, for now i have white walls since i cant find a texture i like or colour
Planar reflection probes are there, they even provide better reflections
Since ssr cannot show what isnt on your screen
So planar refs are better for water
what youve said is really helpful!
But also a lot more expensive than SSR
That is true. You win some and you lose some
Oh yea that one would be nice to have, using scripts for light culling is kind of unwieldy
Luckily light cost is mostly proportional to geometry in its range, which is pretty easy to cull using LOD groups, and if you have big levels you'll want to be loading/unloading parts of the level at runtime anyway
where did you get your wall texture from? ive been looking for a pool tile PBR texture but they are paid or not what im looking for
I made it myself in substance designer
hmmm, do you think it would be difficult if i installed it and try to make somethign simular or should i stick with free assets, at least for now
It's a good program to learn, but can be quite extensive
I can give you my texture if you want it, I just made that as a personal fun project
this is a problem i have with reflection probes, u cant tell cuz its too bright in most places but in the dark it looks metallic and u can clearly see the 360 view probe image and it breaks immersion
if you could that would be amazing
even then maybe ill try and give it ago and learn it down the line
Not sure if I'm allowed to share files so download it quick, and then I'll delete it π
got it 
Yeah that's because a bright reflection probe is shading a surface with high smoothness that is in a dark area
i take it in this image you have a filter on your camera to make it look like a video tape/ recording, what do you call that kind of filter? when i look at VHS affects it seems a bit too strong for my liking
But that's also way dark, do you have any baked indirect lighting in your scene?
I would suggest setting most of your environment lights to mixed, setting your environments to static, and doing a bake π
a single real time point light but the pillar cast a shadow, and thats why i thought maybe SBGI is something i should use to lighten up area like that
You could, however screen space global illumination does not work with reflection probes at the moment
So I would personally bake your global illumination
tho i dont get these sliders, numbers where okay but HDRP uses these sliders and it confuses me lol, turned it down but it still seems smooth
would mixed work?
Yes, mixed keeps the realtime light, but bounces around baked lights to go in to all your crevices
this is with the texure you sent me, need to scale it and that ofc
but like the other texture i have a problem with everything looking dark and metalic, and im not sure why
Without making (or buying) custom image effects you can get a long way by adding film grain, bloom, chromatic aberration, and lens distortion
And then add exposure override and on compensation boost it slightly so that it looks over exposed like an old/cheap camera
You could use depth of field with manual ranges to ever so slightly "defocus" your image as a whole as well
make sure on the normal map import settings to set the texture type to normal
Unity used to warn you automatically if you plugged in a texture not set to normal map in to a normal map slot, but not anymore
So it's an easy mistake to make
the texture is perfect thank you! the last one i had had a bit too much dirty look to it
Cool
Another tip is to use temperature on your light instead of color
Easier to get the right shade of white that way
currently baking to see how its going to look
not too bad, need some water reflection and adjust the lighting i think
this room looks much better than the bigger room, maybe the bigger room needs more powerful lighitng
Notice how that area is no longer super dark because it gets bounced lighting from the rest of the room π
Now you just have to play with it until you get what you like 
:) its not far off what i want tbh
Here it looks like not all your geometry is set to static, or not all light sources are mixed/baked
for the accurate water reflections, is that a volume applied to only the water itself?
its all static and I changed all of them to mixed, tho maybe it didn't work ill try generating lighting again
Why wouldn't you be?
In case there is something weird about sharing zip files in the server rules
I like this place so I just wanted to be safe π
if there is nothing else I can do about this, I would like to know something about the directional light and reflection probe issues that I wrote about earlier
@timber egret
Sorry to bother and for the long message but I wanted to know why, in HDRP 2022.3.17f1, in the shadows section of the directional light (Sun), there is nothing else such as the "Dimmer" or the "Tint" etc.
Not sure what you mean there, but if you are looking for extra/advanced features on lights you can click on the three dots end enable the additional options for each section of the light component
thank you β€οΈ
I don't know about the invalid reflection probe
For the grass disappearing should indeed be the LOD distance, I'm not quite sure what your problem is
regarding the reflection probe I searched a bit and it says it's a bug in the current unity version
Where do you find the max distance to be 43?
on the Z axis of the object
yes
On that same image I see some play on the lod slider
Beyond that size it could be that the object itself becomes smaller than pixel size and just gets "lost"
I'll have a look in my unity
in fact, beyond a certain distance it shrinks and disappears
instead trees, for example, reach almost to the end of the ground while other smaller plants or even grass disappear before them
yupo
so can't do nothing
What you could do if you really want to render grass at that distance is create an additional LOD group on the prefab with a bigger version of the mesh
So it is a bigger version if it's further away
But keep in mind if you're doing this for anything other than a render it's not gonna be good for your performance
I understand, thank you very much for your help, at most I will reduce the size of the environment
or enlarge the prefab as the distance increases
Usually if you want performant grass you'll have to fade it out at some distance threshold, and when it approaches that you'd make it gradually smaller and less noticeable using LODs
Some games even implement a system to shrink the grass down in the vertex shader itself, so it'll blend into the ground grass texture extremely smoothly
That's a smart one
thanks for the advice but at the moment I'm only doing static level designs, but thanks for the tip
Static or no, these optimization techniques work just the same
π
Looks like you're using a 3D light with 2D sprites
Someone has a clue how to fix these shadow artifacts?
i can only reduce them by changing the shadow bias depth.
This is called "shadow acne" and normally occurs on extreme shadow bias values (too low bias iirc)
Yeah I know the name. But the only way to fix is the shadow bias right?
Yeah basically, unless there's some other cause
I've seen deferred rendering path cause some similar shadow glitches on some editors and platforms
nope, normal model
has nothing to do with normals.
I nearly fixed it by adjusting shadow bias ^^
if normals were screwed, i wont see this face because the backside dont show? ^^
lol, i am aware of fundamentals like smoothing groups ^^
But thanks. im fine with the shadow bias
I didnt know where else to go but anyone know how to fix this? iv already tried lightmaps, also I cant bake lights because my pc will have a seizure
@deft fiber - im so confused. I did my lightmap uv manually (First screen) and baked the scene in Unity. But the UV is getting ripped apart, and i have no clue why.
I thought it might come from a manual change in the "Scale in Lightmap", but thats default.. you have a clue why this is happening? It steals so much UV space.
If your lightmap UVs are in the second UV channel and automatic UV generation is disabled, Unity should use them as-is
https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html
Yeah UV0 is texture UV1 is lightmap.
As you can see, my uv makes it into unity, but some parts are moved.
If you compare my UV and the Lightmap you can see, that this shell just moved up (and i dont know why)
You'd have to specify what's the "this" you want fixed
That said, you can see from the lighting window and console log that you have lightmaps in use that have an UV overlap problem, so that can cause any number of issues
That is strange
I'd try to remake the gameobject alone into an empty scene and bake lighting for that
If the problem still occurs, I'd try the same but with a newly imported mesh
Just to poke at the problem
@chilly kettle Lightmap resolution, max lightmap size and indeed also scale in lightmap are settings to watch when testing
did everything. And max lightmap size / resolution wont explain why unity splits part ov the UV out π
i guess my model is somehow broken
Other models seem to not have the issue?
dont know, i saw this the first time, normally i can trust on the automatic generated lightmap uvs
Not possible for me to fix this.. π haha
I have redone the whole UV, but always the UV shells are moved in the lightmap
Always the same ones, or some at random?
What about different meshes?
each one is a mesh.
I guess each mesh needs its own lightmap UV?
So they're separate objects?
yay! π Thx for the hint
hey, this is a bit of a weird question.
so my game has a few scenes and they are atm, working pretty well (ranges now 13-14 ms and below which is pretty good in editor) without baked lighting.
so i thought to bake lighting and instead of a performance gain, i instead had a performance decrease, quite big, now ranging from 14-16ms and up.
is it okay not to even bother baking light? it feels weird not baking light.
like it feels wrong to make a game without baked lighting
this isn't a 1 scene issue btw, this is across the board (my best scene ranges from never going above 10ms without baked lighting, even realtime reflection probes on an older laptop in editor which is pretty damn good).
is there any graphical reason i should bake light regardless? or is it purely for optimising (because if it was purely for optimising, for some reason it offers no performance gain, the reverse actually)
You get bounce lighting and occlusion with baking that you otherwise can't get
If you use Baked lights you simply remove lighting calculations as they are stored in textures, so the performance loss doesn't make sense
If you bake with Mixed lights instead, you basically have both realtime and baked light for each light, so the cost would be slightly higher than purely realtime
it only happens after baking the light, the profiler says it's to do with the editor which, if this was true, there shouldn't be a difference
Try profiling a build, if the editor seems to be to blame
You should basically always profile builds
If you clear a bake, can you undo that clear and get the bake back?
I think that just straight up deletes the lightmap files
But if it doesn't, then I guess there might be some hacky way
Probably no any kind of official undo option for it
i guess only with version control
Ok, I took the plunge and tested.
The bake doesn't get deleted, all that happens is the data asset gets removed, which can be re-added from the project window \o/
Oh that's cool!
I'm recoding a 360 vid, trying to work out what setting/ feature is causing these differences in the cubemap
there aren't any flares on the lights, which is the usual cause
I still have these really obvious seams and edges between my meshes even though I have tried to recalculate the normals at runtime. Look at the images to see the difference between with lighting and without lighting.
I don't think it worked to recalculate the normals with a script because the meshes look really weird, almost as if they are turned inside out so it could have been the script that was wrong. But I have tried to fiddle with the model settings on the meshes and changing how it calculates normals and generates Lightmap UVs etc but nothing seems to fix these very obvious seams.
Could anyone provide some further input on what I should do? Should I "bake" lightmaps somehow? And would that work since I am generating these meshes procedurally at runtime.
Hello guys I am quite new to lightmapping, can I ask why there are weird light map like this after baking lightmap?
Btw after I switch to baked lightmap view I noticed that my lightmap resolution don't increase altho I increase my lightmap resolution in the lightmapping settings(But the lightmap res of the box outside my model increase as well).
Any idea to solve this problem?
btw I expect it look like this, like it is in blender~
The size of each lightmap texel is smaller than each one of those cells in the wall, so that kind of detail can't be displayed
Lightmap resolution has no effect likely because your mesh has already filled the max 4K lightmap size
That doesn't quite look like 4K for that amount of geometry, so check if something is hogging all the lightmap space
I'd split the mesh into more objects
πshanks you
Also, note that that kind of paneled wall with sharp edges is kind of a worst case scenario for lightmapping, due to automatic lightmap UV unwrapping being forced to create seams for each and every panel
Usually manual lightmap UVs are not necessary but in that specific situation you may end up needing to unwrap the panel wall in such a way that it has no seams
Recalculating normals (or using a fixed normal direction for seams an I suggested) is still the correct solution, even if the script didn't seem to work in this case
Baking does not provide any benefit here
Yeah, I went back to look through your answers and changed some of the mesh settings to "calculate" so that Unity might calculate it for me since the script didn't seem to work. That didn't help, however. Do you have a script in mind that would work for me that you could recommend?
Looks like it's the post processing, when bloom sources are not on screen, neither is the bloom
I'd assume you might end up having to render the facets with a higher FoV and a higher resolution to compensate, and then cut just the middle part for stitching later
I haven't done any runtime normal recalculation so not specifically
The "calculate" option merely recalculates normals when importing, something your modeling program likely does before exporting
Still, you could try setting each edge vertice's normals to face up in a modeling program and see how that works (and make sure not to override it with unity's import settings)
Might avoid the need to recalculate at runtime entirely
Oh, I see. So maybe in ProBuilder then? Because that's where I made the meshes.
just baked my lighting and this is happening to my texture any clues?!?
can you show the raw lightmap data?
Could be bad Texel Validity
show these two
i get this warning but when i go in uv overlap theres nothing red
There are 5 objects in the Scene with overlapping UV's. Please see the details list below or use the 'UV Overlap' visualisation mode in the Scene View or Lightmaps in Lighting Settings for more information.
- Cube (19): 143 texels
- Cube (16): 143 texels
- Cube (21): 143 texels
- Cube (17): 143 texels
- Cube (20): 143 texels
I have been using this script so far but I doesn't seem to have any effect at all... Do you know if I'm missing something?
using UnityEngine;
public class RecalculateNormals : MonoBehaviour
{
void Start()
{
Mesh mesh = GetComponent<MeshFilter>().mesh;
mesh.RecalculateNormals();
mesh.RecalculateTangents();
}
}
It's basically just this example script: https://docs.unity3d.com/ScriptReference/Mesh.RecalculateNormals.html
Normals are calculated from all shared vertices.
If your meshes are still separate parts that don't share verts, this wouldn't practically do anything
Ooooh...
The debug view here being grey and black means it has no data to show at all
GI debug draw modes are only valid for the current editor session and scene after baking
Do you have any ideas on how to do it between meshes? π Or will I need to combine meshes and then run the function?
Will need to combine the meshes, and likely vertices too in a separate step
I see, thank you!
how do i fix these uv overlaps
What is this lines that I see here? The object has the two sided illumination being an interior but idk how to fix this little lines of light passing through
https://docs.unity3d.com/Manual/ProgressiveLightmapper-UVOverlap.html
That said these don't look like a big problem, the artifacts you were showing earlier are texel invalidity
Happens with sharp edges
It's best to use shadow blocking geometry to pad the walls
Ah! so creating just some things to block those edges and done? thx
If you've got an interior and the only problem is the sunlight, it might be enough to just pad the roof geometry with a shadows-only quad mesh
yep, that's what happening, the directional light is doing this thingies
You may also find it useful to use smooth shaded shadows only cubes as the shadow padding mesh
Or if you have complex shapes that can't easily be padded, you can in that situation fully fix the issue by letting a smooth shaded variant of the mesh take care of all the shadow casting
Smooth shading is the important part, as smoothed normals prevent the shadow gaps from forming
Hmm this complex shape is made on probuilder so that might be another added problem, but thanks, I'll try to see how to do this smooth shading on the object
If not, the scene is gonna be at night and in an interior, so maybe I can...not do directionals and with lights just do everything
ProBuilder is kinda limited in many regards such as this, so it's officially only recommended for temporary greybox levels
I see, welp, as a greybox is great, so I will bring this base to blender to do a better version and fix this problems, thanks for the help!
Some of the lights have emission on the material, disabling those lights sorted it
Ah, I assumed the blazing glow was a desired effect
Would have been nice to keep them, but extremely short time frame and they're behind the viewer.. so the 4 lights causing the issue can go!
Oh okay and how would I fix that?
Which one is "that"?
UV overlap or texel invalidity
the texel invalidity