#archived-lighting
1 messages · Page 22 of 1
turns out they only appear in the lightmap occasionally
Unity version is 2022.3.4f1 btw
I believe I've fixed the problem. I had forgotten to make sure the Lightmap Static checkbox was checked for those few meshes that didn't receive light
Hello I have the same previous problem of ligthing as the last time but sine I switch to an other version of unity I don't find this settings anymore .
yes but I still don't have the settings ?
do anyone know how to fix this when i remove my directional light it goes away but when i place it back it come back
What settings are you missing
Sure you're looking at the Lighting window?
I feel like this might be a MSAA issue
ok, so my item has lighting in it but im getting this really weird box outline per light, and im trying to fix it
Got it fixed by changIng the skybox to solid color and with SAAA
This setting
Hi guys, did anyone know what happend to my Spot light?
Can you show what your Lighting window looks like
Newer versions may have changed slightly in appearance but the button hasn't gone anywhere
Exceeded pixel light limit per object
this is my Lightning window
this is the difference between when I start directly on the game scene and when I start the game on the lobby scene
Did you scroll all the way to the bottom? Which editor version? Tried resetting editor window layout?
I was wrong I check and I am not on a recent version ... I'm on the 2021.3.16f1
And their is nothing more on the bottom of this window
That's recent enough
I expect this is an editor layout issue
how can I fix it ?
Try resetting editor's window layout or choosing one of the presets
Window>Layouts>
thx It worked 😁 👍
heey, does someone knows why fog doesn't correctly works?
it just makes an strange halo on the road instead of making diffuse the horizont
i don't even know why those four halos are projected on the ground
any ideas?
this seems relevant
how to fill the area evenly with light?
Point and spot light have "origin" of light propagation and have the shape of a sphere
If you want to fill the whole scene with light, use environtment light.
If only a room, use Area Lights
area light is only for bake lighting
Ah you want realtime?
Well, then you have to deal with environment light or point lights.
I guess there is no built in solution for lights without falloff
I guess there is no built in solution for lights without falloff
sad...
Oh, thankss
Does anyone know why GPU baking suddenly started crashing 2021.3.32f1? It happens in empty projects too. I've even completely reinstalled Unity Hub, Unity 2021.3.32f1, and did a clean install of fresh Nvidia drivers. All the log editor says is using my GPU then Crash!!!
Im using 2021.3.27 and it works fine
Well like I said it just mysteriously started crashing Unity.
How come there isn't an actual error? It'd give me a Microsoft Visual Runtime Error and other times just nothing.
Did you try it with a lower or higher version?
I was using a Unity version from months ago
I think you did everything i would have done
Like updating drivers, reinstalling unity
Do you have some 3rd party assets that may cause a problem?
Do you build light with Unity or with Bakery?
Bakery?
Bakery is a 3rd Party Asset for baking lightmaps
It was much better years ago, but unitys built in lightmapper is great now.
I switched back from Bakery to Unity Lightmapper
In your case i would open a support ticket.
I did send a crash report a couple of days ago
You wont get feedback from that
That's on the forums right?
ah wait thats the non technical one
i guess you have to use the forum for techical issues
anyone please help? i am hopeless here
can you provide more screenshots of the problem?
Hard to see whats happening there
Which render pipeline? Are lights baked, realtime or mixed? Is there a light cookie in use? Needs a lot more info
I am a super noob when it comes to lighting. I tried to bake lighting recently and it all went horribly. Now I'm trying to restore my original default lighting, but in doing so came across this:
intensity 8: 1 of 2 walls receive the light
intensity 10.4: 2 walls receive the light
intensity 53.91: floor finally receives the light
why is this happening? I feel like I've messed up something simple and fundamental to my project/models
Once you clear the generated light cache lights, lights will return to normal
It looks like you unrelatedly ran into the pixel light limit per object
By that do you mean "Clear Baked Data?"
Yea, near the Generate button
Yeah, I did that but still have issues
but that's fine
I have another problem lol because I'm determined to get baked lights to work
The problem in your screenshot is exclusive to realtime/mixed lights
pre-bake and post-bake
after I bake the lighting, the light "disappears"
it's set to "baked," what am I missing?
Most common problem that causes this is the lack of lightmap UVs on the meshes for the light to be mapped to
oh...yeah lemme check that 🤦♂️
You should also confirm that the lighting window reports that lightmaps do exist at the bottom
isn't that done here in import settings?
Generate Lightmap UVs is checked as we want it to be
You could show your lightmapping settings and the lightmap stats section at the bottom of it
yeah just wanted to confirm that first. It is not reporting any lightmaps as you said...
I restarted Unity and it's working now. A bug I guess?
Using the built-in render pipeline. I am now trying to upgrade to URP and it kinda seems to fix this issue but some shaders are not converting properly so i'll see about that
Real time lights and there is no cookie in use.
I can, but I don't think most screenshots will help understand it more clearly.
Basically what happens is that there is a strange line below any spotlight. The line is only visible when viewed from certain angles.
I think my ambient occlusion settings might be off or something. I feel like the scale of the shadows is weird.
how do i prevent this light bleed img1
is there a way to make a light longer? a rectangle even if that makes sense like img3 (im new to this sorry, feel free to ask questions)
For Img2 -> You should use a mesh with a emissive material (if you bake the light)
For Img1 -> Depends on your Scene. You mean the light bleed on the outside of the wall?
I think this could be caused by your wall thats only a one sides mesh so light can go through, or its caused by a low lightmap (if you bake?) resolution.
really dumb question but does anybody know why this might be happening
this is HDRP, the reason there are so many lights is because this scene is just going to be used for a video so performance isnt super important
this happens when I bake the lighting
im baking cos if i dont it flickers like crazy
i manually set certain lights to be baked and others are mixed
for comparison this is what it looks like when its not baked vs baked
You mean this half circles there?
Did you generate a lightmap UV?
i didn't tick it in the unity importer because when I do it looks wrong in a different way
ill redo it like that so you can see what I mean
Okay. If you didnt provide selfmade Lightmap UVs from your 3D Tool you must check that checkbox
i guess thats the issue
the mesh uses a lot of differnt materials cos i didnt think I needed to bother optimising it as well in case thats relevant
okay im baking it with "generate lightmap uvs" ticked
are the parts with the circle on meshes that you repeated/duplicated somehow?
i did do a lot of duplication but not really like that
like it appears on parts of the mesh that I extruded and stuff
i wouldve thought that it would be more related to the UV mapping if anything
i would suggest you bake it with the generate uv checked and if thats not working, write again ^^
if theres a definite way to generate the UV lightmaps manually in blender i would appreciate pointers, optimisation is not important here
yup it just finished
and looks as weird as it did before
hold on a sec
"generate UV lightmap" ticked
worth noting that the chairs in prominent view are actually the only non-static row since they are gonna move
idk whats going on here
Does anyone know how could i optimize this simple scene? It works not as fluid as i would like on my mobile... I have to say that there is nothing programmed yet, so all is that. Some technique i could apply to it... , is for an endless runner...
prolly a low light map ( everything is baked as its a vrc world) and ty for the help!
Would removing lighting altogether increase FPS and how would I do it if that were the case? By removing lighting I mean no shadows, everything is illuminated like a Playstation 1 game
Yes it would. Every light and especially every shadow eats performance
what do you mean with optimize? You mean the amount of geometry etc?
I think its good and should run on mobile.
How would I go about removing lighting?
If you want to, just remove all light sources and go for environment lighting
Can someone help me with lighting? This scene doesn’t look great and I’m not sure what is wrong. I have no experience with lighting, so if you think the issue is with anything else (textures, models, etc) lmk. Let me know if you have any pointers. 🙂
first: i like the style 🙂
I think its to bright overall.
Your light sources dont pop enough i would say.
There is a great game with a similar style, maybe take some impressions from there:
https://store.steampowered.com/app/1525700/Tavern_Master/?l=german
Wow thanks! I’ll look into that. Yeah I think got mixed up in trying to add a bunch of small lights and they’re all the same intensity. Now it looks flat.
i think it would add charme if its quite dark overall until it looks like a medieval castle or something.
Keep in mind that you cant add to many realtime lights on mobile (looks like its a mobile game?)
It is. And that makes sense. Do all the lights in the scene render the whole time? So should I worry about the number of lights in the whole scene or the density of light sources?
In forward rendering path they render each per mesh that's within their range, so if no meshes are in their range they don't render
Inversely if many complex meshes are in their range, they all render again for each light
In deferred rendering path lights only render each per screen pixel that's affected by them
In both rendering paths shadow casting lights render one viewpoint for point lights, six viewpoints for point lights
There may be an overhead cost to shadow casting light, but generally it's only as big as the complexity of the meshes within the shadow casting light's range (multiplied by shadow resolution)
I see. Thank you vm 👍
@chilly kettle Yeah, exactly... I've already built it and even it works surprisingly fine, the mobile stills getting slow when i run it... Is the fog so expensive? how can i debug it on my phone to see what's the most expensive thing on the scene? i have to say that my phone it's not a bad one, so i don't wanna know what could happen if i run it in a worse one
The lights still need to do some kind of range check even if all meshes around them have been culled, so dormant lights will have a nonzero performance cost
But it likely is trivial unless you have hundreds of them
At this rate I’m going to have like 200 in a scene atm. But after this I plan to severely reduce the amount of lights to like a couple per room, so I think I should be fine. Plus most of my meshes arnt too complex.
As long as you're optimizing the meshes with LOD groups and optionally with occlusion culling then the lights are likely not a problem
If you're loading areas in with additive scenes or prefabs or something, you can use that to load/unload the lights as well
"Jittering" how exactly? Occlusion culling should only be disabling/enabling mesh rendering
I'm curious what it looks like since I haven't seen it before
I assume jitter in this case means it turns on and off sporadically?
https://www.reddit.com/r/Unity3D/comments/kqw54u/lightboundingsphereoverride_spotlight_flickering/ I'd try the BoundingSphere solution mentioned here
All the staff I know do work hard, but it's a big company and big engine so sometimes stuff falls through the cracks
Nobody in the posts made in recent years mentioned having filed a bug report, so you could do that
This prompts the QA team to make some statement about it
From what I recall occlusion culling often underperforms and they're looking to replace it
is there any way to save environment data like skybox images, so I don't have to reinput all of the settings every time I make a new scene?
My directional light global illumination is being received by objects that arnt included in the light's culling mask, they should not receive light on my lightmap
Not really knowing what you mean, but I think I can provide an answer from what I understand. The sun sends a massive light source throughout the entire scene.
Can anybody help me with the point light here? 2022.3.13f1
Is there a setting that toggles if objects are going to have their lighting updated while the game is running? All objects keep the lighting level they had before the game started, and I really cannot find the cause for this. Can't be baked lighting, since I tried turning them off.
There is a shadow mapping part on lights which may be your problem as it maps on enable
Help with what? Sorry can't see what is wrong straight away
im trying to make a flash light, it works out of play mode but in play mode it doesn't work any fixes? ( I use baked lighting and URP)
I love Unity's lighting
Hm. What do I need to check more exactly?
this on the light object
I'll check if that's on, but notably lighting doesn't update on URP, HDRP or the default one.
anyone have any idea why my shadows are like this? i want hard shadows but it doesnt seem to work
my related settings are also here
normals of my object also seems ok
wait... increasing the casecade count worked... but why??
likely just low resolution on the shadows and whatever you did offset that a bit
But if i have 1 cascade and my shadow quality is high that should mean all shadows are high quality shouldnt it
I sent picture of all the shadow related settings i know 😭 maybe im missing some others
The ground material's normal map is likely not set as type: normal map, or something else is wrong with it
You can confirm that by swapping to a material without any normal map
Directional light shadow resolution is mapped across the max shadow distance
Higher max shadow distance, lower shadow resolution relative to surface area
Cascades are used to split the available shadow atlas into regions by distance so you can have higher resolutions up close where they're needed, but lower resolutions further away as a tradeoff
Your shadows in the image are "hard shadows" which means they have minimal filtering, and the visual result is expected
They're still bound to the shadow resolution, they're not like the old "stencil shadows" that precisely conform to the shape of the mesh but cannot be softened/filtered
Only the third screenshot, of the URP asset inspector is relevant to realtime shadows
The Low/Medium/High shadow resolution tiers are arbitrary categories so that you can choose shadow resolutions per light in the light component's inspector, but that's that's only for lights other than directional light
I think i get the general idea from this, thank you very much!
I'm trying to set up 2 spotlights nearby but seems that only the one slightly nearest to the camera gets rendered, why?
Sounds like pixel light limit per object
where can I change this setting?
is there any way to make light not go through walls?
For reference this is what I mean. The lights are on the other side of the wall
I'll also note that the wall is just a cube
I will also note that this is a spotlight in builtin RP
What is weird is that there are no leaks in the walls, they literally go beyond the upper and lower ones 
You can try making the walls thicker and/or using a higher Shadow Map resolution on the light
Shadow casting needs to be enabled on the lights
If you're using baked lightmapping and shadows are enabled, the light could be leaking if the lightmap pixels are so large relative to your geometry that they spread over from the other side
In that case you may need to increase lightmap resolution and/or mesh scale in lightmap to improve the resolution
The best solution for lightmapping would be to have the walls and floors be a continuous mesh rather than overlapping separate pieces
But I guess it's a realtime light?
Quality settings, but it's a complex issue that might not be appropriately solved by simply increasing the limit so it's best to research the topic
If you search "light limit" here you can find many explanations by me
I have thought about that
The thing about the continuous mesh
But I had no idea how to do that and went the easy (and dumb) way... lol
Anyway, as soon as Im on my computer I'll check all your points, thanks!
Anyone got any ideas of what could cause this light flickering?
Denoising Mode (on the Fog Post Proc component) was set to Both, changing to Gaussian stops it
does anyone know why my lights dont work if i change them they dont work and pp doesnt work aswell anyone know?
How can I bake light objects that are blocked by other objects?
I am using baked lighting in my scene. I have an object that sits behind another object (a rock) in the scene. When I bake the scene, the rock in front is lit perfectly, but when I move the object as part of the game, the object behind it is really hard to see because it's in shadow. I can disable the rock and bake the object behind, but of course then the rock doesn't get baked.
looks awesome tho
Is there a way to automatically convert all realtime lights to baked ones on mobile? (or suggested alternatives)
Yeah gaussian eliminates flickering but introduces some ghosting/trailing/temporal artifacts from what I've seen
I usually prefer gaussian though
Is there a good tutorial to add player customizable lighting to a unity project?
I am having trouble with lighting being transferred to my actual game build. Once I build my game to my IPhone 12 all of the cast shadows disappear. This is a comparison between my Unity editor simulator and my phone. Is there something I’m not doing to bake the shadows into my scene or is it a graphics setting?
I’m using the default iOS graphics settings, but should a baked lightmap have cast shadows?
I wish I could take credit for that, but it's from the asset store!
Hopefully with the issue being in the distance, any of that won't be visible
I'm no lighting expert, so I could be way off here.
This could be a quality settings difference. By default the editor is on a higher quality than mobile devices, the iOS quality setting in use may not have the right light settings for you.
Project Settings -> Quality -> look at the matrix at the top, the selected quality for each platform is in green
Select all light components (from light explorer or by filtering hierarchy), set all their types to baked, bake
If your question is not how to set realtime lights to baked but rather how to have only mobile use baked lights, I don't think there's any pre-existing system to do that
as baked lighting and light type are both tied to scene, I'd make separate scenes with baked lighting and load those based on a settings option
Additive scenes are helpful to separate visuals from gameplay and to avoid duplication in this case
In some cases it's procedural so not really applicable. How about having a LightManager, having all my lights set to Baked, and if !Application.isMobilePlatform change some to realtime? (since that way the lightmaps will already be calculated)
Then you'd get double lighting from both the lightmaps and realtime lights
Assuming light type can be swapped at runtime
I'd guess maybe not, since baked lights might be stripped out at build time as they don't do anything, and only the editor cares about light type normally
Not that you can use baked lightmaps with procedural generation anyway, additive scenes or not
The custom script "prefablightmapping" may help in that case though
You mean even if the light positions can change?
So I guess it wont be straight forward then, but maybe I can just instantiate a Baked Light instead of a non-baked one, and then does it get baked at run time or just wont work?
Won't work
I'll read a bit more into it.. I'd assume people probably combined procedural generation and lights before!
They are generally considered a poor combination and a hassle to work together, so much so that Unity doesn't even make it possible out of the box as baked lighting is entirely tied to scenes and can't be moved
Even if it can with something like prefablightmapping, you run into the issue of discontinuities in light calculations and seams between parts
Here's one relevant talk about it: https://youtu.be/KbxiGH6igBk
Ah ok good to know, well.. I hope all the other optimizations I did will be enough to get decent frames on mobile, testing soon, otherwise I'll rethink things keeping that in mind moving forward, thanks!
So been having issues with lighting in unity that i have never had before, when i am baking my lights, this always has happened. no lighting settings were changed, yet i just cant fix the lights. Any ideas?
I’ve set all of the settings to be the exact same for mobile and laptop. And the same for each tier of graphics. Still no cast shadows on ios mobile
When using Dynamic Resolution on Mobile (and Unity Player) Built-In, things seem to mostly work except one thing: lightmaps (i assume) seem to work correctly at first but then, when a new scene is loaded, they seem to be limited to one screen corner making most of the scene dark, proportional to the dynamic resolution scale
This example would be what it look like of a scale of about 0.4
In-game example
SOLVED turns out there was another camera i didn't know about
Hi, I'm having a really weird lighting problem by default
Here's a repository containing a super minimal scene
https://github.com/ensapra/Lighting-Problem.git
There's literally nothing in the scene. I created the project rn, added a transparent plane, and an object underneath, ticked hard shadows on the light and this happens
The shadowmap
I'm using built in
The shadows are dithered shadows cast by the transparent plane @sweet blaze
And since you have the shadow casting of the light set to hard shadows, the dithering used for transparent shadows becomes really apparent
Shadow casting from transparent objects don’t really work the way you’d expect
So there are a couple of solutions to help hide the artifacts your seeing of the semi transparent shadows, you can use soft shadows which makes those artifacts less apparent, or just simply disable shadow casting of the transparent plane
Another solution also is light mapping but that’s a whole other thing
I should note that this is only caused when you have transparent materials casting shadows
Any shadows cast by non transparent objects would be fine
okay, i see, thanks
These look like texel invalidity artifacts. Use the scene “Texel Validty” draw mode on the scene tab after a lightmap bake
Green are valid texel, red are invalid. Such problems are caused by geometry that have back faces exposed (basically see through parts of a mesh)
This can be fixed by either fixing the mesh itself to close any of those holes, repositioning the objects so that those holes are not visible to the player, or on the material settings for the object with see through faces, enable “double sided GI” in the material settings
Just wandering, what could have triggered it? Wasn't having before until earlier today
hey, im having this issue with the lighting in my game. when i shine a light on a mesh, tiny lines of light slip through the edges/seams of it. right now im using a probuilder mesh to make a tunnel but im pretty sure it happens with everything, im in urp and the materials being used have the render face set to both (might be relevant idk)
Because your meshes are only one sided and have no thickness, with shadow maps this will create problems
Solution is to either thicken your meshes, or more simply you can enable Two Sided on the shadow casting mode for that mesh renderer
i tried to enable two sided shadow casting but it did nothing for some reason
Could someone tell me what is happening and how i could fix this? cuz iknow the camera is too far but i need the spotlight to be rendered by the camera aswell
i think youd have to increase the light distance or shadow distance thingy on ur hdrp settings
idk ive never used hdrp
Why is this happening? I’m using URP and have real-time point lights.
I'd guess you're casting more shadows than your shadow atlas can handle
Remember that shadowcasting point lights require 6 shadowmaps each
it was the fade distance
Does anyone know how to fix this pop-in lighting? Second picture is moving slightly to the left, you can see the light isn't actually on it
Try
Project Settings -> Quality -> Shadowmask Mode
Select Shadowmask to only have the spotlight illuminate the area it contacts.
As far as I understand shadowmask settings only affect mixed lights during baking, rather than realtime lights
My guess is that this may be something to do with how the leaf mesh is rendered/generated
I saw something similar when using lit shaders on built-in render pipeline's particle systems; the lighting was calculated only against the particle system's origin point
That may be because of the shader, or maybe something batching-related
Why is this lighting glitch happening? If there is more than one light the lighting separates.
So this lighting glitch is not happening when I use deferred rendering. But this is a mobile game so I was hoping there would be a workaround. Does anyone know what the issue is?
Maybe your Light Settings are set to Vertex Light.
Try this articles:
https://unity3d.college/2017/07/06/pixel-vertex-lights-unity3d/
https://docs.unity3d.com/2019.2/Documentation/Manual/LightPerformance.html
So, which rendering paths are you trying with?
hi guys i've been using unity since 2017. I worked as a programmer all the time and i want to switch to become a lighting designer/programmer due to my college major(i'm physics student and it's focused on optics field). where should i begin?
What do you want to do? Do you want to go into realistic renderings or more into mobile games etc.?
i'm not interested in any kind of mobile applications. I want to merge my physics knowledge and coding/designing skills to create light-based simulations, photorealistic renderings, and any kind of other applications like these
Ok. So you have to work with HDRP lights and can ignore URP Lights.
I guess this is a good start: https://www.youtube.com/watch?v=yqCHiZrgKzs
In this video, you'll learn how to create AAA-quality visuals for current and next-gen games. We’ll also show you HDRP’s key rendering features and how to tune settings for anti-aliasing, lights, shadows, exposure, and more.
Speaker:
Pierre Yves Donzallaz (Senior Rendering & Lighting Artist)
Did you find this video useful? Room for improvement...
thank you
i'll check it out
I have tried with the built in and I think it can’t handle as many real-time lights as I would like. So I switched to URP and tried forward and deferred. Deferred seems to be way too memory intensive for my phone. This glitch was happening with Forward Rendering.
Thanks vim I’ll take a look soon.
Baked probes only include "reflection probe static" renderers, whereas realtime probes include everything
yes but ive set everything to reflection probe static already
all the materials except the tree material use hdrp lit, tree use unlit
and in baked probes the only objects it include with colors are trees, everything else is pure black for some reason
You could try Forward+ rendering path
How many shadow casting lights do you have exactly?
BiRP has a very high maximum cap for forward pixel lights, but the problem is the cost
On mobile platforms it's usually best to have little to no realtime lights, especially without shadow casting enabled
like everything is full static
There's no obvious reason to me why they wouldn't show up, so that's something to look into
I'd make a simple test scene with default cubes to figure out the correct set of steps to make probe baking work and see what differs
Something that may sometimes look weird is probes being visualized in the preview with vastly different exposure, making them too dark or bright
For this reason you should have a sphere or a capsule with very smooth metallic material next to your test cubes
well realtime and baked
In the second image you can see the reflection partially working
This suggests it might be a problem with the probe's rendering frustum
Confirm that near and far planes of the probe make sense for the scene
yea and i really cant understand how
well its all default and nothing change when i adjust that
thats what the probe exr looks like lmao
Something did change as the reflections we see near the edges here faintly disappeared
There could be both frustum and shader problems here
Hence I recommend making the test scene as I explained
Hello, I have a problem with lights in HDRP. So everything was working fine. We didn't even change anything. Suddenly the lights starts to behave like this:
reflection probes baked
ligthmaps baked
occlusion culling baked
the funny thing is, this only appear in builds
you can see the glitch on houses (they are static). It somehow disable objects/shadows. idk. Its hard to figure you because on editor everything is fine 🙂
My lights aren't showing
@supple coyote Looks like it could be somehow related to high quality shadow filtering
Might be worth testing with medium and low
If some problem is build-specific always check which quality level you're using in editor the confirm it matches so tests are comparable
I have low, medium and high and the problem is on all three of them
high quality shadow filtering - where I can find this option?
Corresponding HDRP asset as far as I recall
That seems to confirm that filtering is not the culprit, even if it's always present at the crime scene
It could be some issue related to scales, shadow atlases or directional light clipping planes perhaps
But those are just stabs in the dark
I'd try to isolate the problem into a smaller test scene with default cubes, or to try to reproduce it in a fresh test project
I have the smaller scene I will try to fix this on these scene for now.
Funny thing is that we don't change any settings, the lightmaps and settings are the same from few months
Zero updates, zero changes
I changed my lights to directional lights
empty project is working fine. This flickering shadows are only to a few objects on scene, not on everything
can be something with GPU instacing material checked and making static objects?
Might be
Check that there are no overlapping house objects, and that their meshes don't have overlapping geometry
ok in few minutes I will check
I also discovered something but it will be hard to explain, but maybe it will be a clue
can i work on ray tracing and path tracing using unity and c#?
wtf
Seems like a generic hang-up
Which editor version is it?
2023.1
and yeah it hang up
That's an experimental version and out of date too by now, so I'm not super surprised if there are hitches
I'm trying to recreate lighting similar to what's seen in games like Half Life and Half Life 2 (using GoldSrc, Source Engine) in Unity HDRP. I've spent two days on this, watched countless tutorials, and still can't seem to achieve the desired effect. My main issue is with exposure - to match what was done in Source, the exposure needs to be constant, right? I was considering using only real-time lighting, but then I thought maybe mixed lighting would be a better approach? This leads me to another issue - the light baking isn't giving me the results I want and I'm constantly struggling with it. To get a satisfactory effect, do I need to place reflection probes everywhere? I Want to have indoor/outdoors in one scene P.S. My version of Unity has the adaptive probe volume system.
Also, how to proper configure volume for something like that?
screenshot for example
a screenshot with what you currently have would also help. but honestly trying to match source 1 style gfx especially in HDRP is a strange decision to say the least knowing how rather basic source 1 rendering is.
source barely has any realtime lighting, most lighting done in source titles were all baked with lightmaps, those of which were at a really low resolution. No mixed lights or nothing because they were very expensive at the time.
Post processing also was rather minimal in such games, so exposure yes would be constant, there was no eye adaption. (there was bloom, although the bloom was basic). But beyond that no SSAO, no SSR, not even tonemapping or anything like that.
Reflection probes also weren't really a thing and weren't used that often (they were also basic and didn't use any parallax correction). PBR shading was not a thing back then so reflections were used VERY sparsely
So in terms of matching exposure not only do you have to have it constant and no eye adaption, you really have to keep a consistent intensity for all lights in your scene roughly. So sunlight intensity wise would be similar light intensity wise to any lights you have indoors
because this was an era where HDR wasn't really in full swing all the way through (it was beginning to get implemented of course, but not to its fullest)
Thank you so much for your reply. I am not gonna to fully match source-like lightning but I want to look it like this.
I am noob about lightning in Unity and that's the reason why I am asking about light probes - I see that is something similiar to env_cubemap in source. But is it necessery to place them? Without them envirnoment looks strange.
You didn't answer my question - is it possible to achive source-like ligihtning only with realtimes lights in Unity?
I am asking about Global Illuminaton also
Theoriginal Source used in hl2 dosnt have realtine lihtning, only baked. So yea you should go for mixed. And for the exposure, half life 2 has static exposure and no bloom (other then the coast levels). The game uses static reflection probes so thats what you should go for. Also you need light probes to have your objects change brightness in different lighting conditions when using baked lighting
shouldn't APV do the thing instead of light probes?
Source just puts cardboard shadows for things that move which is why you need to use mixed lightning. Other wise, non static objects wont have any shadows
Yes
Why would you want your graphics to look like a 2009 year old game anyway? People who are using source are trying to up the graphics with dynamic lights and shadows, but you are trying to downgrade your graphics?
in HDRP of all pipelines as well
env_cubemap in source most likely refers to reflections, but as I mentioned in source games reflections were really basic and werent used that often
maybe I express myself wrong. I wanna to achieve "minimum point of lightning" like source, It can be better of course. Why am I pointing into source-like? because it has some climatic thing.
Whenever I tried to do something in Unity with lightning it was looking worse than as I mentioned source lightning xd
so that's why I am asking about it
well its important to understand what source was doing
makes it easier to nail down what you are after
I was into source a few years. And I was trying to do lightning in Unity like in source - maybe that's was a wrong way
yeah their lighting systems and the way you work with them are not really that similar
if you want source style lighting, light probes and full baked lights is the route because that is what source did
if you want to go with a more modern approach, mixed lights are what you need along with lightmapping
we can go more in detail of course with the modern approach
but just a little confused as to what your attempting to achieve and what exactly your aiming for
Do you have any tutorials which would help me understand unity lightning and baking it? Whenever I wanted to do for example dark interior I had problem with many things
So been having issues for around 4 days now with lighting in unity that i have never had before, when i am baking my lights, this always has happened. no lighting settings were changed, yet i just cant fix the lights. Any ideas?
Original Source did have realtime lights and baked lights both
It also supported bloom and after Lost Coast had HDR with dynamic exposure (though using gamma space only)
@vale flower Source is remarkably similar to Unity's BiRP and URP (but misses most of what HDRP adds on top)
Both have a variety of realtime lights, rely a lot on lightmapping together with light probes and reflection probes
If you're familiar with designing lighting in Source, BiRP in particular has few surprises
One difference though is that Source generates light probes automatically whereas in Unity you'll have to configure light probe groups manually
Unless you're using APV but as I understand they're more of an alternative workflow you'd use instead of lightmaps, which makes them less like Source
GoldSrc also uses baked lightmaps and probes too to some extent, but they're much more limited as are each of its graphical features
Why makes less like source? What's the difference?
ok finally I have successfully baked some lightning (I guess), when they are baked there is no reflections, when mixed reflections appears.
and what settings for baking should I have?
for testing and final bake
Im pretty sure rwaltime Environment shadows came with portal 2 and after. But realtime shadows did exist with flashlights, if thats what you mean
it came with episode 2 iirc
Lightmaps are textures that are limited by lightmap resolution, mesh UVs and texture compression which can give them recognizable visual quirks
APVs are interpolated points which can have their own quirks in turn
If you're emulating a specific engine's or game's signature look, you need to understand and mimic their technical limitations
I do not wanna emulate, I wanna just achieve something similiar to it (not one-to-one)
Why?
I may be misunderstanding your goals here
Your "desider effect" was to "match what was done in Source" but it's a bit unclear what you were referring to precisely
at least. But if I can do something similiar but also with realtime lightning it would be great
The example screenshot heavily relies on baked bounce lighting for its look, so you probably want that
But firstly I must have understanding how baking lights works and my goal was something like source
As mentioned you do need reflection probes for reflections
Source used them copiously
Usually one per room
as a note he mentioned earlier when baking lights reflections disapeared, he means specular highlights
Quite so, specular response from mixed lights comes from their realtime part
Baked lights don't have that, but it can be approximated using reflection probes with the help of what's called "emissive proxies"
ok it looks very close without any reflections
or with a custom shader but thats another whole ordeal
yeah and my question now is if lights are in "mixed" mode, they have reflections, do I must still create reflection probe ?
(Source got realtime light reflections in Ep1, but before that there were no light reflections aside from reflection probes)
to correct your terminology, you mean specular highlights
you can retain those "highlights" by using mixed lights
as spazi mentioned
For reflections yes
I urge you to research what reflection probes do (or env_cubemaps, same thing)
you can also retain them with a bit of a hack that involves reflection probes, and using emissives to approximate the highlights
again as spazi mentioned
ok but HDRP has RTX options and something like SSR
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/ chapter 5 for emissive proxies
it still need reflections probe?
Reflection probes are used as fallback for those systems
How about you ask more questions once you've watched this video in its entirety
https://youtu.be/DlxuvvYZO4Q
Step into the famous Sponza Atrium to see how to beautifully light an environment from scratch using a mix of baked and real-time techniques. Pierre Yves will showcase the GPU Lightmapper, the new Probe Volume system, ray tracing, and path tracing.
00:06 Introduction
01:18 Speaker
01:40 Volume system
02:47 HDRI sky setup
04:16 Direct lighting &...
those are different techniques to achieve reflections, and those are usually additive in a sense
I watched this video and this realtime global illumination looks so nice
usually it goes like this to keep things simple (and general)
[usual rasterized reflection pipeline]
- skybox reflection (360 image of skybox basically)
- local reflection probes (360 image of the enviorment at specific spots, these can also be "parallax corrected into a cube shape to approximate the enviorment)
- screen space raytraced reflections (performs raytracing in screen space to obtain more advanced and correct reflection information, but it can only trace whats on your screen)
[advanced]
- "RTX" full raytraced reflections, usually a replacement for the entire pipeline you saw from before and are accurate, and are agruably way easier to work with (but of course very expensive)
Then you shouldn't be puzzled why your reflections are missing without reflection probes, I'd assume
Ok thank you so much for your time and answers
One more question, how he get in this video realtime gi to work? I know that lights must be baked and in the mixed mode but what else?
ok this is what I was talking about. PHysically based sky, and without reflection probe it looks like this...
Ok it was "include sun in baking"
That's not correct
SSGI and RTGI wouldn't be "realtime" if they required baked lights
You can find the official instructions here
https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@13.1/manual/Ray-Tracing-Getting-Started.html
And you should also make a project with the HDRP template for a reference implementation if you seriously need it
But you probably don't
What of it? I already said you should add reflection probes
yes with reflection probe it also gone
thank you, I will take a look into that. I learned a lot of unity lightning here. Now I think I can make something. Thank you so much once again
It's best you start simple and learn only a couple of features at a time
HDRP really dumps all the fancy stuff on you and expects you to know what's what
Realtime GI and raytracing are really not a good spot to dive in, and really not necessary for most games, even with cutting edge graphics
yeah because it's so expenesive
And complex to set up, which matters most in this case
Honestly you should be using BiRP or URP, especially if Source levels are your reference
I will stay in HDRP because I wanna use things like water. But thanks for an advice
Are there any plan to handle/mitigate light leaking of APV? Left side is lightmapped, Right side is APV.
The capsule is dynamic object....
are you sure about that that's apv issue? @zinc flume
yes. light leak through thin wall because both side of the probe is valid. but both side contain polarizing exposure. I could maybe make a touch up volume to fake thick wall but I'll rather not do that on every wall I have in my game
Also, my screenshot contain geometry that is not axis aligned with the world, that might be hard for APV as well...
how thick your wall is ?
0.15m if I remember correctly
I don't know, I wanted to replicate your case but it always is shaded properly and there is no leaks
What's probe spacing did you use. I was using 0.5m in my image.
And this is 0.75m probe spacing
default one
Ok I see where your problem is propably
upscale your shadowmap resolution
tried even on probe spacing 5m and it is not leaking while I have high shadowmaps
also, might I ask which version of Unity are you using?
2023.2.0f1, also I am using raytraced shadowing but I turned it off to check it. When you are using low as f lightmaps and have raytraced shadowing on, problem still disappears
This is wild find out if it's true. and might be the reason why I could never get APV to not leak as I have never considered shadow map to be related to its leaking AT ALL.
So most of the time when leak happen I just mess with the probe setting and volume options.
take a point that your directional light is mixed/realtime so I don't know if APVs have to do something with it
(I am noob in lightning too)
But I noticed that when I was checking it have nothing to do with mixed/realtimes lightning
I have some problem with baking lights on Unity.
In substance I have done all the UV, baked the texture and all is good.
I set all in Unity and when I bake it's all corrupted? I have only a directional light and the whole GameObject is set to static.
I'm using URP
How could I fix it?
It happens only after baking light?
@zinc flume APVs have a bunch of options, manual and automatic for adjusting probe position and sampling to reduce leaking issues
They are shown in this talk https://youtu.be/iU7X5xICkc8?t=538
@clever hedge Unity's lightmapping uses the second UV channel for lightmap UVs, which to work correctly must be set up with some specific rules that ordinary UVs don't have
Unless you have your own authored lightmap UVs in the second channel, you should enable "generate lightmap UVs" in mesh import settings
Mainly the rules are there must be no overlap, there must be proper padding relative to lightmap resolution and all UV islands must be within normalized UV coordinates
there are so many games that try to go for a retro look though. like old playstation graphics and such. and pixel art too for example. why are you surprised about this?
source doesnt actually have you manually placing light probes like in unity. so i guess unity is worse than a game engine from the 90s in that regard. in unity you have to waste time placing light probes.
like, you have to spend time filling each room with like 50 light probes? and if it's a big open area then you're gonna need to place hundreds of light probes in it? maybe thousands even?
there has to be a better way
Thank you, now I'll try to create a second channel for UV on Substance and try to reimport on Unity
Or just enable auto generation
Costs no effort and it's usually perfectly good enough
Adaptive Probe Volumes are the "better way"
why is this video using light probes then? look at the amount of light probes at 15:24, did he manually place them? or are those the adaptive probe volumes
17:29 is even worse, there's like 10k on the screen at once
10k light probes in that one area
They're manually placed light probes
15:35 Probe volumes```
Probes aren't that slow to place manually, as you can box-select many, duplicate and drag to quickly get a huge 3D grid of them, then delete or move the ones that are in bad spots
There are also scripts to automate that process
APVs are supposedly optimized enough to handle that
oh ok, probe volumes seem a lot easier to place. cause manually placing thousands of light probes seems like an impossible task. even if you can drag quickly, rooms arent always squares but very complicated shapes so you'll have to do a lot of work to fill them up properly.
so whats the advantage of using light probes instead of the volumes?
They're an older, simpler system so they may be quicker to set up in simple situations and probably work better with older hardware
Whereas APVs are a newfangled thing still in active development, and not just a component but a whole toolset
APVs are also meant to replace lightmapping afaik, which normally works in tandem with light probes
i looked APVs up on google and it seems like they're not for the built in render pipeline? its the one i use because i heard it's the best and i'm not looking for photorealism or anything
hi guys, i have a random generated maze system, how do i bake the lighting during runtime?
APV is one of SRP-exclusive features
HDRP gets the newest versions of APV as it's being developed, and URP also has it in somewhat limited form but feature parity is probably the goal
BiRP is not particularly better (nor worse) than HDRP and URP, and HDRP doesn't lock you into photorealism (although its tools are made with that in mind)
all the objects are instantiated when the player loads in the new scene, so the lighting has to bake again, how do i achieve this?
You don't
what do i do then?
Real-time lighting
where do i activate that?
It should be active by default when you create lights
The modes are set on the lights themselves
Also not sure why it wasn’t mentioned but there are tools and scripts that exist where they make the process very simple and automate the placement of light probes for an entire scene
i want to ask, is BiRP perfectly capable of visuals of both DUSK and super mario odyssey? two completely different artstyles and im wondering if BiRP can accomplish them easily.
With some work, yes
i've heard posts about people wanting built in to be deprecated, is it really gonna be deprecated in the near future? cause it sounds like there's nothing wrong with it. and its not like urp and hdrp are straight up better.
As far as I know not really, but a lot of projects I know do use them still. URP still does not have feature parity with BiRP yet despite how hard they are pushing everyone to use it. Personally I would avoid both render pipelines because they are constantly changing. BiRP is rock solid and has been battle tested, and has the most resources available for it
HDRP is straight up better if you want HD graphics
URP is better if you want modern features and ease of use
BiRP is still good if you want to tap into a decade of user created assets and resources
I believe the decision to modernize the render pipelines was mostly because BiRP is built upon legacy code upon legacy code so making updates for it became too cumbersome
Despite that I find it still works very well
Implementing something like the SRP Batching would've required a rewrite of the rendering engine anyway
It’s up to you, you can always create a project and do some tests with each pipeline and see what you prefer
At current point in time URP is lacking only a few of BiRP's features, and surpassing it in other areas
what areas does it surpass birp in?
Still, if you're making your own rendering features and your own optimization under the hood, you won't miss URP really
It has SRP Batching, VFX Graph, now APVs, Forward+ rendering path, colored light cookies, higher quality shadow filtering are ones I've encountered
Light and shaders generally seem to be of higher quality, like per-pixel lit particles, more blend modes out of the box
Both have Shader Graph but URP gets more robust native support
The most notable thing that's missing is Screen Space Reflections
The new URP sample scene implements them but they're not a documented feature
hmm ok, but what is the difference in performance? if someone's playing my game. will urp be more heavy on their pc, or is there any difference at all?
hey is there any reason why the black void appares when I switch my additional links from per vertex to per pixel?
you see, the thing is... he is using hdrp. using hdrp to imitate source dosnt really make sense.
URP is supposedly lighter but real world reports vary both ways
Obviously also depends a lot on the game's graphics features and what kind of optimizations you're using
With BiRP you're usually doing a lot of work to reduce draw calls using types of batching and instancing but SRP batching makes that unnecessary
So while the performance might be the same in ideal conditions, it does save some effort
URP's SSAO that's enabled by default probably takes up more frame time than all the other rendering combined which can skew the results sometimes
But it always depends
If you have a lot of lights, forward+ rendering path can reduce their cost significantly
In that case it may be possible to match the performance by limiting light ranges and slicing meshes, but it's nice to not have to you know
With all render pipelines it'd be best to work to their strengths rather than try to put them up in a one to one comparison
SRPs are smoother to use out of the box, but BiRP is much more expandable due to being picked apart for years by the community
thanks for the explanation. its hard to choose between birp and urp for sure
The trick is to become a diehard one for one render pipeline so the grass is never greener on the other side of the fence 😉
what if i become a birp diehard and it gets deprecated? i recently saw some urp fans on the forums raising pitchforks demanding birp to be deprecated for some reason
That's even better as you can feel righteously bitter and complain forever, as nostalgia only makes it shine more with each passing year
usually when something gets deprecated in unity in my experience, it still stays within the editor it just has a deprecated tag
birp fanboy here 😛
i've been against render pipelines for a long while though, like BiRP as I mentioned is mostly untouched now but its been with unity since the beginning
and its been used on all kinds of games that have shipped, arguably its the most battle tested/hardened out of all the other render pipelines
vs with the others they are still very new but are constantly changing
Yeah, deprecating it will be more of a formality until it naturally becomes incompatible with one of the newer editor versions
Even still we can expect old editors to stay available and work just as they did back in their day
i fixed that, but now i have a new issue
so the only problem are the point lights rn
i've put my camera rendering to deferred
and my point lights all take up like 400 batches
disabling shadows brings this number down to like 70 batches
Shadow casting?
i guess yea
this is not normal right?
Each shadow casting point light must render 6 shadow casting passes that include all meshes within its range
Deferred rendering can't help with that
when i disable deferred rendering, i get like 3k batches
idk what i can do tbh
if i just get rid of all the lights, my batches are fine
There's a reason why even triple-A games avoid having a lot of dynamic lights, and avoid shadow casting point lights in particular
so, what kind of lights do i use then?
i need ceiling lights
cuz i tried this as a test version
Baked lightmapping could be applicable
Prefer shadowless point lights, and spot lights for shadow casting
everything is generated at runtime
like, the map gets instantiated as soon as the player warps to the new scene
To some extent baked lights could be used by loading level parts as additive scenes with a specified offset, or by attaching baked lighting to prefabs using a custom script
yeah, i was thinking of adding a loading screen and letting the map generate, then bake the lights?
But if you're stuck with realtime lighting you need to get clever
For example if you need shadows from a lamp you could have a spot light facing down, and another shadowless spot light facing up right below it to mimic soft bounce lighting
Can't bake at runtime
fk
but just, point lights add waaayyyyy too many draw calls
While I don't recommend swapping render pipelines mid-project, if you're using URP or HDRP you can rely on SRP Batching which eliminates the need to wrangle draw calls
i don't use any pipeline
just have default
Still, only use shadow casting lights where absolutely necessary and prefer spot lights whenever possible
basically what i want is, something like this, one sec
like 1 big room
and 1 light under each ceiling tile
but that uses way too many lights
but i know its still possible
but idk how i should handle this
lighting with procedual generation is probably one of the hardest things you can do
unfortunately
yeah i see
and i've noticed
and most of the techniques fly out the window
but this is just a maze generated, it doesn't generate more maze when going to the barrier
It's a worst of both worlds scenario even if you don't have draw calls to worry about
so there is nothing i can do about it?
you can technically utilize baked lighting to light procedual worlds, although its difficult to explain
but this was done in a title done by bethesda which I forget
oh
You could consider this workaround
but essentially the game was procedual, but enviorments were preset and baked before hand
and were essentially stiched in such a way where they appeared seamless
Blades: https://youtu.be/KbxiGH6igBk
But this is pro stuff
even, when i turn off all shadows on all point lights, i still have 500 batches left
from those lights
you can probably write some additional code to handle culling of lights
if lights or such are occluded disable them
same with meshes as well
Batches /draw calls aren't the end all be all of optimization
The 6 shadow casting perspectives per light are expensive
is there a way to reduce that number?
Use spot lights or disable shadow casting on point lights, as I've suggested a few times
you can disable shadow casting (and even lower shadow resolutions of lights) with basic distance checks
essentially LOD'ing for lights
how do i disable shadow casting?
i only put the "Shadow Type" to "No Shadows"
Yes, this disables shadows
Something to note is that the stats window you're looking at is known to be inaccurate
If you want precise information you should be using the frame debugger
yeah, i use that
there are still like 500+ draw calls in the RenderDeferred.Light dropdown
some have keyword "POINT UNITY_HDR_ON"
most of them
I would expect that deferred rendering doesn't need a lot of draw calls but I'm not familiar how it works in the built-in render pipeline
i see
do you recommend switching to another pipeline?
does it have benefits?
i had another project where i switched to URP and all my shaders were pink and couldn't fix it
well, only if i assigned the right texture back to each object
which took me hours
Not usually mid-project, and not without version control as it often requires irreversible changes
I was listing them earlier here: #archived-lighting message
There's an automatic converter for Standard and other built-in RP's default shader which you should be using
yeah i used that, but it didn't work back then
always errors
so i did it manually
anyways, thanks for the help man!
i guess im just gonna spawn lights randomly
I would also look into ways you can cull lights
Yea, or the meshes
Lights don't do much unless they're lighting something
alright, thanks
I've already suggested a basic way you could cull lights by reducing shadow resolution (and disabling shadows) based on distance, and you can do something similar with meshes too by reducing the amount of them drawn on screen by distance, or by other more advanced techniques
the less there is, the better
have anyone tried making light culling system that works with distance? i have thousands of lights in my scene and it needs to be optimized, i guess unity doesnt have such function by default so
also is there a way to prevent this look
lightning gets extreme brighter on objects that are close to light but this is not what i want
usually to optimize i play around with shadow cascades cuz those are performance killers in lights, the rest just add LOD's and play with the draw distance, add some fog, occlusion culling
i mean...thats how light works, just decrease the intensity or range
how do i play with the draw distance of lights? i think thats exactly what i need, shadows already turned off
yeah but its like too harsh, not like that in other engines i used idk
what render pipeline are you using?
i ment camera draw distance
hdrp
there are more lights than the amount unity supports so i have a lot of flickering and it looks horrible
for the flickering set the render path to deferred, it gets rid of light limits
HDRP should be on deferred by default
it didnt
extremely annoying
is it the same in game view?
oh its normal in game view
but im not making a game, making a mod for some other game
i hope it will be normal there too
uhh thats what i meant
looks really bad
i had this issue with realtime lights on URP as well also on deferred, it was only happening in scene view, not game view it might be just an optimisation thing unity does for scene view
just turn down the intensity
but then it wouldnt be bright enough for road
do you have any indirect lighting in the scene?
now this is what happens on game view
whats that? u mean like directional light?
by default, lights only give direct lighting
meaning light that comes directly from the source
indirect lighting is light that comes from bounces of objects
lemme get some examples
this is only direct lighting
oh i see what u mean now, but nah i dont think this scene has it
in this case i use SSGI to simulate realtime indirect lighting
but screen space GI relies on screen space data
meaning if the light is not in your camera view no indirect lighting will be calcluated
thats where raytraceing comes in but thats into the expensive lighting territory
so in your case you can try using SSGI combined with APV's
also add some LOD's to your scene
from that video you sent i can see the street lights are still there when very far from the camera
the street lights that are far like this can be culled and improve performance
(using bakery)
I just cant seem to be able to get rid of this artifacting
looks fine in the preview
looks like lightmap UV issues
how does one go about making your own then
since unity cant generate it correctly i think
is there a good tutorial to use
i dont know any specific ones, go on youtube and search for one
Unity generates good Lightmap UVs if you dont fck up the values 😄
results are the same no matter what i set here
been messing with the values all day, default included
Coming back to this, nope increasing shadow resolution didn't help. and you can see the sampling debug here showing that apv sampling from the other side of the wall 
and if you want my geometry set up
The more I test apv, the more I'm convinced that this tech needs serious fix for light leaking before Unity should even consider basing precompute gi on this leaking mess. Why is Unity trying to push it so much when it can't even handle simple setup. 🤔
added your scene, added light and it is not leaking.
as I mentioned it is not APV issue
So I will have to try with Unity 2023.2 later then
Although I am quite sure of what is happenning, since the probe sample debugger cleary show that it's leaking. Might as well not waste any more time
Hi. What is the best way to do 2d shadows and stop this from happening? I'm using Shadow Caster 2D and it doesn't seem to work very well
im just getting started with lighting, and i added a couple of lights to my scene, but baking produces weird artefacts. what am i doing wrong here?
im using real time directional light lighting in URP, but it looks awful and generates in strips, how can i make it smoother?
I guess your Mesh doesnt have Lightmap-UVs.
You should also show us the settings of the bake.
did you check the "shadow resolution" options in your pipeline asset > rendering?
yes, i put the resolution on the maximum 4096
i did some changes with the cascade and it now looks fairly good, but theres still the odd stuttering when the lighting moves and it has to generate more shadows. Can this not be changed to be smoother?
Dont know what you mean
ill record a video, one sec
you can notice the stuttering when the lighting updates
theres lots of strips of shadow that seem to generate when the lighting updates which causes it. Im not sure if that can be fixed or thats just how the shadow works and cant be changed
how big is this "gameboard" in unity units?
Each tile is a cube, 10 by 10 1 height
And it’s a 5x5 grid
so its 50x50 Units?
How does it look if you shrink it to 5x5?
I’ll test it
Did you watch the video I linked you
It included multiple solutions to APV light leaking
I try all of that.
1.Virtual offset doesn't work here because there is no probe inside geometry
2.Probe touch up volume with invalidate probe setting work on the top ceiling, but not the side wall and result in sampling splotch
3.view bias /normal bias doesn't help
also, invalidating probe just make the lighting data on the area getting lost
This is a result of too many overlapping lights in forward rendering
You'd have to confirm that you're able to use deffered rendering
The light intensity issue can't be easily remedied, as HDRP is built around real-world accurate logarithmic light attenuation
It can be remedied with a tonemapping profiles to lessen the contrast between light and dark in HDR space
There's no built-in light culling system, but you could use any system that you use for culling/loading in gameobjects in general
Lights that affect no meshes don't do any light calculations, and in deferred rendering lights that can't be seen aren't rendered
This is kind of an unsolveable problem but as long as the resolution is high and soft shadows are enabled it may be acceptable
Using cascades doesn't make sense with orthographic camera, as all distances appear equally close
For this reason it's important that your directional light shadow max distance is as low as it needs to be, and camera's near plane is as high as it can be
It doesn't look as good as I'd expect from a 4K shadowmap so maybe the resolution is being wasted on incorrect distance
isnt the size of the gameobject a reason?
Only relative to shadow resolution and shadow distance
The actual math is more complex but it's helpful to think that the shadow's resolution is mapped up to the shadow distance
So basically if your scene fits within a shadow distance of 100 you're getting all 4K shadows across the level
If your level is only 10 units long in this example, it'd be getting a fraction of the shadowmap and appear with low resolution shadows
If shadow distance is decreased to 10, the shadows should appear just as accurate again as they did with big level and long shadow distance
I think the resolution is spread starting from camera plane, but I haven't confirmed that specifically
Usually camera near plane is very close to the camera but with an ortho camera it's important to check there's no wasted empty space there
@uneven grotto Oh and to fix the "strips" you may be able to rotate the directional light around it's forward axis, which realigns the pixel grid of the shadowmap
It may cause strips elsewhere, but it can be a good compromise
When the directional light turns, it may be worth trying to also rotate it in this way to kind of obfuscate the pixel shimmering that you see otherwise with a moving sun
You definitely need soft shadows enabled for that though
I’ll try all of this thanks, and soft shadows is on
how can i confirm that? i mean like its already set to deferred so
and also how could i do those tonemapping stuff to improve lightning to my liking
and for the last thing, so would occlusion culling do the job for light culling?
HDRP has settings in many places so you may have to snoop around for all the necessary ones, can't say more precisely
Tonemapping is a volume override, where you can find other post processing overrides as well that may be useful
Tonemapping requires HDR and linear color space but HDRP by default has all those
Anything that culls meshes will reduce the cost of light, but I think occlusion culling specifically also removes lights
i changed the angle so the sun has no angle its just facing straight down and that strips are gone. But the stuttering still occurs. Maybe its jus the way im handling the day night cycle. Ive basically got 2 directional lights as a child of an empty game object, and that game object rotates
maybe the rotation isnt smooth and its not actually a lighting issue
It's because of how the directional light shadow fundamentally works, as I said it's kind of unsolveable
But might be mitigated with the steps I detailed
dam. I guess how ill leave it as is, and slow down the rotation so its less noticable
thanks for all the help though
Most importantly you should go through your shadow settings as I explained
The best cure is to improve shadow resolution which in your case might be held back by incorrect settings
i think ive already done those but ill check
The shadow res is on the highest 4096, and ive lowered the distance to 60 which is the lowest in can go before the shadows are cutoff
That's good
I'd set cascade count to 1 as it may be distorting our results
And then check if increasing the near plane of the camera the same way you decreased the shadow distance has a positive effect
alright sweet
the near plane is currently on -50, increasing it to like -40 or -20 doesnt really seem to have any effect on the shadows, and further than that clips through the actual scene
I guess it might not be the starting distance of shadows then
Maybe not an issue but my conventional wisdom states that near planes should not be negative, instead you would move the camera backwards that much
alright sure ill try it
If the camera/near plane is as close as they can be, I guess the conditions should be ideal
yeah doing this just achieves the same thing no difference to the shadows. Ill just try to keep it as subtle as possible
Hi all, I am having a issue with URP lighting. For some reason, it becomes all fucked up when it finishes baking (one without the emission).
Does anybody have any idea what the problem here is?
Nevermind, figured it out.
What did it turn out to be
Lighting compression
Hi all - I originally joined this discord to ask for help with a shader but while taking a screenshot to explain the goal I've noticed a different problem that I've spent half an hour failing to resolve
on the left is a reflective sphere, with reflections from a reflection probe in the center of the chain-link-box-thing
on the right is a reflective sphere somehow recieving reflections from an old version of the reflection probe that no longer exists
for some reason, everything in this scene not within the range of a specific reflection probe has this reflection, with the (no longer existing) red spotlight
even if I delete every single reflection probe in the scene I still get this reflection
how do remove this ghost reflection probe and make it so that every object in the scene not within the range of a reflection probe that exists just reflects the skybox?
update: this was fixed by clearing baked lighting
If i use "Directional Lighting" on BiRP, my batches goes from 250 to 500 + is this just the way lighting works? it doubles the batches? or is there other ways to not double my batches and still light my scene (like i guess not using Directiona lighting?)
im generating a map realtime so i don't bake anything, i just use my 1 realtime light
Kinda is the way it works
Objects hit by a light have to be rendered again to get the effects of that light
Hi. My lights is not working in builded game. In editor it works perfectly. I have quality on ultra.
Does anyone know why my baked lighting isn't visible? Baked GI is checked, there's a lightmap created, everythng seems to be ok, they're just... not visible
happy to provide more info to anyone that might know what the issue is, just shoot me a ping
lighting settings
and lightmap
all lights in scene are set to baked, other than the two directional lights I have, which are set to mixed. Those are the only ones visible on play
rebaked it again with the exact same settings and it worked, whacky
Quality also on ultra in the build?
No, it was on low. Thanks mate. Didnt saw that 🙂
In my game, the fogs away from the camera look sharp and ugly like this. How can I solve this?
Search for how to render fog on a skybox in your render pipeline
Perhaps this, since it looks like you are on URP
https://forum.unity.com/threads/apply-fog-to-skybox.1120732/
I'm a newbie to Lightmapping, I was used to Box Project the UVs of my models when I worked with realtime lights, but now that I have to bake everything it f*cks up the lightmap, how can I achieve the effect of Tiling and Box Projection UV but also be able to bake that?
Can someone explain line renderer to me? I dont get it at all
Realtime lights don't use lightmap UVs
Baked lightmaps do, and you should let Unity generate lightmap UVs for them from the mesh import settings rather than making your own, unless you know precisely what you're doing
Lightmaps use the second UV channel so you can have whatever UV mapping you want in the first channel without interfering
That's not relevant to lighting
or physics
trying to light this small area, and I lit the room (red) first. it room (red) looks good now, but room (blue) doesn't, so I generate lighting, and it gets all messed up. any way to get it consistent across rooms?
Hart to say without seeing any settings or additional Info
So when unity warns about multiple scenes loaded with different lighting settings, is that something to worry about as long as i control which is the active scene? Or does it still matter?
Just a quick question
If we import Bakery into a project, then bake lighting, then remove bakery from the project, does the baked lighting stay?
yeah it should, but you have to delete all the missing scripts from it.
But why should you remove bakery after bake? 😄
No, only the active scene's lighting settings are taken into account when baking with multiple scenes
So it doesn't matter if you have different settings assigned to different scenes. I recently raised it internally that maybe we should remove this warning because it doesn't add very much value, but it's definitely not the priority right now.
hey gang, im using URP an am getting this weird dark areas that dont seem to pe processed the same way the rest of the level is
any tips on what to look out for
oh yeah, its also a polyshape made with pro builder
Make sure you have the 'generate lightmap UVs' (might have a slightly different label) checkbox on for the probuilder object. Beyond that I'd look in the debug draw modes to check that the UVs and charts are there, the texels are valid and finally that a lightmap is being generated for these faces.
I am baking a outdoor & indoor scene with just the Environment Lighting and no additional light sources.
I thought that the environment light will lit the complete scene, but it seems that the house is throwing a "shadow".
The Environment Lighting is very dark indoors and bright outdoors.
Is there a way to light the whole seen at the same rate?
(Images with "Cast shadow" On and Off on the buildings mesh - nothing else changed)
Is the first image not showing the result you want?
It does.
I disabled the Cast Shadow of the building.
But i wanted to add a sun also and this will cause the problem, that the sun is shining through the walls ^^.
I could add a realtime directional light for the sun, and enable the cast shadow of the walls after bake, but this is for mobile VR and i want to avoid realtime lights i guess.
I always thought, that environment lights will brighten up the whole scene, but i read that they dont and are more like an "emissive skybox" with light for the outside.
I could add some arealights inside i think.
Probably no easy or elegant way to do it
Environment lighting brightens up everything if lighting is not baked, so it cannot tell what's occluded and not
Since you're baking lighting anyway you can simply give the interior some lights
There is no build in way to brighten up the whole scene, right?
I guess "Bakery" has that.
I believe you'd have to resort to hacks like combining lightmaps or using each material's base map as its emission also or something like that
Oh.. thats not what i want 😄
I guess i will live with the first view and dont care for the "sun" 😄
Maybe it's cloudy ^^
why not add a static/mixed 'sun' light then bake?
because it will shine through the walls (if i want the environment light to reach the indoor scene)
or it will be to dark when i active the shadowcaster on the wall.
not if you bake it
if i am stitching together a bunch of prefabs realtime to make a large maze level, what are my options with baked lighting? could I individually bake each prefab store them and somehow stitch them together in a realtime gen build? or should I just do realtime lighting with 1 source, and use emission and other things, and just use realitime Global Illumination post processing v2 BiRP stack? and just turn lights off via proximity so I am keeping my lights low in numbers ? (1-8) I am currently at around 300 - 1000 batches depending on whats on scene and trying to stay around there or less. performance wise im at around 160 fps-ish, but aiming to cap at 60 anyway for consistency (this is on a 3080 so im sure lower gpu will have lower fps). any thoughts? thanks!
- stitched together is possible but a lot of trouble, if you go with it you may find useful:
https://github.com/Ayfel/PrefabLightmapping/
https://youtu.be/KbxiGH6igBk - PPv2 has global illumination? I'm not aware of it
- You'll probably want to just go with realtime lighting and cull the meshes and lights as much as possible
Make sure to familiarize yourself with forward and deferred rendering paths if you use realtime lights
on BiRP - PPv2 stack
left off / right on
but this is just a test, i actually have a directional light i turned off just to see the GI only
test just to see GI on emissive objects only
also, thanks for your reply
I see, a custom solution like this could be helpful to improve the look of realtime lights
Just check to see if it has specific limitations that are relevant here
I'm trying to get Unity to stop baking my lighting. As far as I know all my lights are set to Realtime and Baked Global illumination is turned off. If I rotate my Directional light it starts baking and Unity will hang. Would appreciate any thoughts.
If your lighting window has an "auto generate" checkbox next to generate lighting button, disable that
Also make sure realtime and baked GI are both disabled
Seems like it could be a bug
I'd restart the editor also
And if there's an option in the generate lighting button's drop down to clear baked lighting cache, that may help too
Sadly that didn't fix it, but ill keep playing with it. Thanks for the input.
Hi! I'm getting dark corners at the edges of my walls when baking lightmaps (using bakery). Anyone know how to fix this?
I only have a skylight and directional light in my scene. The room is only lit by the window. But even the wall facing the window still has the dark corners
ambient occlusion is disabled too
this honestly almost looks like how it should, your just seeing the natural shadowing that occurs in the corners of the room
Hmm I guess that does happen, but it feels overly harsh here. Here's another POV, I feel like it definitely should be spreading out to the corners a bit more, this corner here is really dark
Increasing bounces didn't really help either. So idk maybe it is realistic and I just need to tweak the lighting more
Update: Changing skybox helped with spreading out lighting a lot more. I thought it was a bit odd of a "solution" for it to so dramatically affect how the lighting was spreading but maybe I just had some weird conflicting settings ^^' It was a throwaway skybox anyway
you might have SSAO on
Hello everyone, I'm looking for some advice on lighting my scene.
I've made some modular walls, flat textured, and I'm getting seams when I light with baked lighting in URP. No matter how I tweak the settings I can't seem to get rid of them. Here are my thoughts on what the problem could be,
Mesh
Meshes are created in MagicaVoxel, cleaned up in Blender with VoxelCleaner v2,
TheStrokeForge - Vox Cleaner
Here are the meshes as they appear in the Unity preview window. The fireplace module has a hole through it to resemble a chimney.
UV
UVs are generated by VoxelCleaner v2 as well, I know the generated UVs aren't 'padded' (I think that's the right term), so I do get some UV errors in Unity, however the UV errors don't appear to be next to the seams?
Lighting Settings
Finally, here are my as-is lighting settings, I've done a bunch of tweaking but seem to get the same results. The only time I've got rid of seams is when I moved to Realtime GI mode, but I'd like to use Baked lighting.
If anyone can give me some direction on this, I'd really appreciate it!
I am using 2023.3 and the new settings for the shadow caster 2d on a tilemap. How can I get the shadow to cast on the wall behind the wall where the player is currently positioned? The shadows work, but if it's in the same tilemap it shows all tiles regardless if they are covered by a shadow or not.
Does anyone know why my shadows look different if I start a scene from a different scene? When I run the scene using the Play button, everything looks fine.
Play button automatically generates lighting but it's not saved into scene so you have to generate it manually (with realtime and baked lightmapping disabled unless you intend to use one of those workflows)
Why not let Unity generate lightmap UVs? Lack of padding can still cause bleeding issues even if there's no detected overlap
The automatic generation you can synchronize with the correct lightmap resolution
No padding for UVs in general can cause texture bleed
So, what can I do?
Generate lighting manually as I said
Hey, Unity is rebaking your environment lighting in this case. You mentioned that Unity hangs. Can you show your lighting settings? How large is your scene?
Generate lighting on each scene manually. This occurs because the scene does not have any env lighting of its own. When you open it in the editor the environment lighting is baked for you but not saved anywhere (hence you see it when you hit the play button). Similarly it's baked as part of the build process. Playmode scene loading is stuck in between these two with no good way of invoking a bake while in Play mode.
This entire system is poorly thought out and we removed it in 2023.2. Now you need to bake the lighting if you make changes to it, leading to no such confusion. We will keep improving this in future releases.
The APV's are most impressive
this is URP in unity 2023.2
everything is light probe lit
and these are the settings
i bumped everything to 11 and it only took 2m to bake
scene size for reference
these are the probe settings
no leaking or artifacting visible
yall gotta admit this is insane
actual in game view
Interestingly it fixed by removing and adding the skybox again.
GPU Lightmapper go brrr 😄
We're still fixing some bugs with memory usage and very large scenes in APV. 2023.3 should be even better once the dust settles with the new features
Thanks for posting, very much appreciate the feedback!
yeah i noticed lol, when i tried to bake in a bigger scene it started to google chrome all my RAM and crashed just about everything
Ah nice! Thanks for the report. We've fixed this in 2023.3 and backporting it to 2023.2 soon.
while your here, since i dont know where to report this, there are some bug reports i made that have been fixed but they were not marked as fixed for me, so if you could forward this to the right person or redirect me to where i should report this it would be awsome
Sure thing, that seems to be an issue with the tooling on the reporter's side for you. I'll forward this to the right team tomorrow when I'm at the office.
thank you
Hello, i'm trying to bake the lights for my house, it looks nice without baking or messing with lights whatsoever, but for perfomance and all that i need to bake the lights, tho whenever i do i get these really weird results, have tried playing with settings but nothing really seems to change:
Some walls just remain fully black, the ground gets random big tiles and it overall doesnt look at it should, without baked lights it looks nice
the big tiles on the floor are the "tiles" of my floor, they're separate square objects
For the completely black objects, you need to turn on "Generate Lightmap UVs" in the asset importer and make them static in your scene. For the tiles on the floor, turning off ambient occlusion if you have that on will probably help.
I do have all that for the black objects, i will try ambient occlusion later, thanks in advance
So I got a issue in my map, I got so many lights that they are flickering at least in the preview mode. What can I possibly do to avoid or fix this issue?
This will see like a dumb question, but... If I take a cylinder and stick it in the ground, and one side of it is shaded darker than the other, and that moves as I advance the time, is that a shadow? Nothing is rendered on the water.
I ask because I switched shadows off in Enviro3 (the only lighting source I have in the scene) and these shadings on the cylinder persist.
is it okay to have 4k lightmap texture for mobile?
i have some myths and itches with this "4k" thing , i know that the lightmap count will be significantly reduced but will there be any performance issue using a 4k texture ?
why is only part of this tunnel system lit? the "shell" was done first, and the "walls" second. both are done with probuilder, but the "walls" just aren't rendering correctly.... what can i do?
i removed the Light probes and i have no light probes on the scene , but all of my object is still effected
i forgot to make them static :P
you have to clear the bake data to get rid of lightprobe because they are baked even if you remove that after lightmapping
Are shadows enabled on the renderer? Is the light source set to realtime shadows? Do the used materials/shaders support shadows? What is the shadow render distance setting set to?
Is is possible for global illumination not to load properly in a build? When I started a new game most of the lighting wasn't working (objects were lit despite it being dark). However when I saved and loaded the lighting worked perfectly.
It really depends on which lighting features you're using and how. Can you explain how you set up your lighting and how you set up your scene loading?
There's a limit on the number of pixel lights you can have on a single object within view. You can increase that limit in the URP settings or the Project Settings in BiRP.
I am struggling to understand this question 😅
i did clear the bake data , but as soon as i render/bake again it comes back ,
bake again keeping the lightprobe component disabled
What is there recommended way for handling baked lighting/probes when additively loading scenes?
Most of the resources seem to recommend designating a scene as the "master", load it as main and other scenes as additive and then bake. Does this still work?
Also, in runtime, does this setup require the master scene to be always loaded before the additive scenes. Or does it not matter?
Shadows and shading are two different things
Shading which lit shaders do generally refers to the function of lighting surfaces relative to their angle towards light as well as distance to it
Shadows are a feature on top of that to remove lighting entirely on materials that are occluded from light, referred to as "shadow casting"
The widely recommended way is to not do that and use realtime lighting instead of baking
There are a bunch of hacks and workarounds to make it sort of work but none of them are good or easy
The topic has been discussed a few times on this channel in the past week or so
baked lighting looks better. The whole game is additively loaded. I can't just give up on having baked lighting. The game's not procedurally generated so this should be a common case with a recommended workflow from Unity.
I did search the channel with "additive" and "lightmap" keywords before posting and didn't find any good answers.
Additive scenes are just one of the potential solutions to using baked lighting with procedural levels
I can't fetch the earlier conversations from where I am but it shouldn't be an awfully long scroll up
look into Adaptive Probe Volumes
I guess procedural levels are not the root problem here as I assumed?
the thing is i dont have any light probes at all anymore
but for some reason , its still there like a cache , ive tried deleting all my lightmaps and rebake everything , it still wont go away
I actually figured it out, turns out it was some light and reflection probes. I think they were disabled at some point during the game and that’s why saving and loading fixed it
This is exaclty what I was looking for, thank you for that excellent answer!
are you using several scenes?
probably you should clear gi caches
hey does anyone know why my lights dont work meaning if i try to mess with them they dont respond to any changes and pp does the same thing as well anyone know?
Hey friends. Struggling with the lighting in my scene - shadows on the trees look different in editor vs build, I assume something's wrong with my shadow cascades? Confused why it's not popping in the editor, only in the build. Any ideas what may be the problem?
Different Quality Settings?
solved it. was an issue with Dreamscape tree leaf shader. Had to declare light shadows and cascade light shadows on one line: #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE
If you are using forward rendering then this might be why, forward rendering has a limit of 8 lights if I'm not mistaken
IIRC that is still in preview in URP so I can't use that.
I actually did try the "bake everything at once under a master scene" approach and It seems to be working. I have a question though:
How are light probes handled for additive scenes? The light probes only existed in the master scene(positioned accoridngly for each additive scene). But in play mode I seem to be getting light probes and lightmaps working without needing to actually load the "master scene". Is it actually necessary to load the master scene in runtime after baking?
not exactly true, i use them for my game, i made a reddit post using them in URP https://www.reddit.com/r/Unity3D/comments/18gl380/the_new_unity_apvs_are_actually_rly_cool/
AFAIK it's added on Unity 2023 which means also agreeing to the new runtime BS for APVs. I can live without it if I can make the single scene setup work.
the runtime fee only applies starting unity 6, the 2023 tech releases are not affected
hey does anyone know why my lights dont work meaning if i try to mess with them they dont respond to any changes and pp does the same thing as well anyone know?
anyone know how to fix?
Materials that are smooth or metallic require reflection probes (or a sky if outdoors) to be reflective
What you mean by it looking "awful" could be due to many reasons
There's only one light and no ambient light so the shadows are unnaturally dark
The materials may be too rough so they show no specular reflection, or perhaps using a shader that doesn't implement specularity at all
How do I add ambient light?
It just looks odd
Or am I being paranoid?
Look at the drinking cup
Those shades are shit
Could be because they are set to baked
Also could be a bug, try rebooting
they are set to baked
but doesnt it mean just for them to be baked lights
Baked lights are not expected to be moved
oh but its not that my lights just stop working if i bake them
pp would stop working if i bake them and with my lights as well they just wouldnt be turned on
i think it might be fixed now but i had to delete pp and download it back to and put new lights
im not sure
If you said donwload post processing then it's most likely built in pipeline
Since srp has post processing built in(urp and hdrp, for custom srp you have to code it yourself)
If I'm understanding this right, Unity 6 is the 2023 LTS version. I required to stick to the current LTS version for this project. So I can't use APVs.
Could someone confirm if the single master scene baking approach actually requires the master scene to be loaded at runtime? I'm finding unity forum posts that say I need to do that but probes and light maps are working for me in additive scenes without the master scene even loaded.
If you baked your lights, then you should be good to go
Afaik even if you load a different scene at runtime, your lighting won't be affected because it was baked in the editor
Hey, your issue with the bug reports should be fixed now
awsome thanks for letting me know, but there is also this one which has not been an issue anymore but is still an active bug
Hi, can someone help me please. I am getting pretty bad light bleed in my scene Baked , unbaked still produces light bleeding.
Light settings
Check the lighting and the materials for the notes I gave
If you can share their properties it might be possible to give more specific suggestions
I don't think I said anything about either of those things
im baking with blender so idk how I could add the metallness or remove the roughness
If you feel stumped, best start by sharing the light's and some materials' properties
idk what u mean with material properties
Is the light baked in blender?
no
Your meshes are in unity as mesh renderers, they have materials defined in that component that determine their properties such as how they react to light
this?
this one was just not looked at yet by the URP team. they'll get to it 🤷♂️
Yes
It looks like they're not using any smoothness or metallic maps, so they'll default do dull 0 metallic and 0.5 smoothess
and your normal maps don't look right at all so the objects are not receiving lightfrom the correct direction
Simply put your PBR maps aren't exported in the way Unity expects
Hello people! I have a question, I was trying to use 2D lights in my top down game, but because everything is rendered in Y it makes it look weird at various times. I would like to know if there is a way to use a sprite and what settings I should put on it to make it look like a light
I get why the light maps are working. But unity docs specifically state that lightprobes are not properly handled when loading/unloading scenes additively. But after baking, they are working for me in additive scenes without the master scene(the one with the light probes) ever being loaded.
Lol? That's...interestinf
what is the best lightmap compression format for mobile if i have lots of lightmaps like 20-25?
The one that gives you the best result while having the lowest file size ^^
What resolutions does your lightmaps have?
sorry for the replying late , but im confused about choosing the size too, sometimes im thinking to have 4096 , because it will make the lightmap count reduced and save some drawcalls
and sometimes, im thinking ....like should i use 4k textures for mobile?💁♂️
Some mobile devices doesnt even support 4K Images.
I would stick to 2k. But you say you have 20-25 4K Lightmaps? 
im foresighting the lightmap count ...as i have a map of 81sqkm (bigger than gta 5)
yeah, im still sticking with 2k map
What are your baking settings?
i would go with GPU instead of CPU Lightmapper, but the rest looks okay.
For the first Test Lightmaps i recommend using a lower Resolution like 5
i heard cpu lightmapper give better result than gpu
obviously , in case of speed , progressive gpu is the winner
but i was concerned about quality , that's why i choosed cpu one(I lack a 4gb graphics card too^^)
Both are the same quality wise
The difference comes with what hardware is used to lightmap the scene
But the end result is the same
If your also concerned with lightmap counts, you might also be able to reduce things further by making some objects still contribute to the lightmap, but receive lighting through light probes
For example say you have trees in your scene, you can have those still marked as contribute GI static, but in the mesh renderer settings for the tree meshes you can change the “Receive GI” field to LightProbes instead of Lightmaps
Granted when you do that, that means any meshes using light probes have to have a light probe group setup for the scene
And since I know your concerned with performance, light probes are very lightweight
I see, but somewhere it was given priority to cpu over gpu lightmapper, whatever , i dont have a 4gb gpu anyone , cant dream oof it 🙂
sorry for bringing it here just for some moment , but as you had said that it;s possible to mix up lightmap and texture uvs in one variable , so that gpu can have some rest . I tried that on my vegetation shader (using alpha blend), have I successfully done it accordingly? could you please give an glimpse on it?
here is this , just for showing you
Looks correct to me
is it possible to have both lightmapped and lightprobed objects rendered in a single pass when using legacy vertex lit rendering path?
Hello, I have a question. Can I somehow make some gameobjects to ignore exposure? I have the effect when looking up to the sky/sun some of the gameobjects going really really bright. The effect is cool but it's to hard
the exposure itself is fine, I don't want to change it, but idk how to manage this transition in brightnes
Does anybody here know what might be causing that it looks like two DirectionalLights might be cast? The one with a nice tint to it is baked, the light one is well, I don't know why it is there
It's not practical to try to exclude anything from being affected by exposure, rather than fixing the exposure itself
I'd first look into the sky settings to figure out why it the exposure system sees it as so dark that everything else needs to be blown out
Also disable the particle system temporarily to rule out its interference
Then you could tweak automatic exposure settings to see if the problem is there, and consider if a fixed exposure works better in this case
If these don't reveal the issue you could ask in #archived-hdrp , they could know better how the HDRP adaptive exposure works precisely, which I assume you're using
First rule out there being extra directional lights using the Light Explorer window
That can be ruled out.
What type of light is it? Are you also using some kind of volumetrics? Does the phantom light react to you rotating the directional light?
Well the directional light is a directional light, that's for sure, I am not using any volumetrics as I'm using the Standard rendering pipeline, and the phanom light does in fact rotate while rotating the directional light.
I'm wondering if it was of type baked and changed to realtime, or it's mixed and not working quite right with the shadowmask mode, or someting like that
We're definitely seeing both baked and realtime parts of the light, presumably from the same source
Normally baked lights are realtime in editor until baked, and then they disappear entirely
Mixed lights should appear as baked to some objects (after baking), but as realtime to others
Yeah it might be something to do with the shadowmask mode, as this is a Mixed light.
Do you have anything I could check to ensure everything in theory is correct?
I'd do test bake first as the light Baked instead of Mixed
Then test bakes with various Shadowmask modes
Could skip the first step if you're confident but I like to test everything foolproofly
Remember to use GPU baking if you have one, and turn down the samples and resolution (not "max lightmap size") to speed up test bakes
Yeah the foolproof part might have strangely enough been the problem, after moving the light a little bit, and rebaking it, the issue was somehow solved just by doing that.
Goes to show that you can hardly be too thorough!
Hey guys, any ideas on how to fix lights leaking through walls? Im using a point light and URP
How to make viewmodels that are under the influence of camera stacking follow the lighting of the scene?
The gun is bland and is not following the lighting of the scene
Nor does it project shadows
This is the material
This is the weapons camera
This is the pistol
Make it cast shadow
Hello, I have some lighting issues where my ambient light becomes 0 when im on a build
It looks fine on the editor, but on a build it's pitch black (the ambient light)
question...
we have a game with like 40 levels, each level has its own lighting in it though
is there any way to tell unity to bake all 40
rather than having to open each level one at a time and bake?
I believe you will run out of vram, but you can try
Just have them all opened and the lighting will bake for them all
hey, you can write a script (place it under Assets/Editor ) to do this.
using UnityEditor.SceneManagement;
using UnityEditor;
using UnityEngine;
[MenuItem("Tools/Bake All Scenes")]
public static void BakeAllScenes()
{
List<string> scenePaths; // or fetch them from EditorBuildSettings
foreach(var scene in scenePaths)
{
EditorSceneManager.OpenScene(scenePath, OpenSceneMode.Single);
Lightmapping.Bake();
EditorSceneManager.SaveOpenScenes();
}
}
disclaimer: didn't check this code it may not compile, treat is more or less as pseudocode
im a level designer ^^; Im more on the art side though, so do I just... put this in to notepad++? sorry lol just trying to make sure I do it right
oh ok let me check the code first then so you don't have to debug compilation errors yourself
basically i dont need to do it during a full build, I just want to trigger it globally for review and let it bake out without having to commit to a full build of the game
😄
Why complicate so much when you can just open them and bake tho?
If they have to do it again it's going to be super annoying I guess
Fair enough
because we have a ton of different people working on it at once, and basically once a week they want me to fork a branch, rebake at final quality.
Yup makes sense
so its not unusual for people to leave lightmaps at like 1x quality for speed, and forgetting
but we use a global quality setting so I dont have to manually adjust each scene, just set it correctly and bake
❤️
This will make a menu item for you under Tools and will bake every scene that's enabled in the build settings
Enjoy 🙂
Just fair warning, once you click it you won't be able to cancel until it's all done
where do I put said script?