#archived-lighting
1 messages Β· Page 10 of 1
Hey, does anyone have a good unity documentation i can follow. I need to apply a .hdr file, but idk where i apply it
unfortunately baking requires alot more steps than just simply setting lights to bake. I would watch this - https://www.youtube.com/watch?v=okYhs6kQ0xw
Let's learn some basics of light mapping in Unity 2020.1 using Universal Render pipeline (URP).
You will also learn some Unity tips and techniques to improve and speed up light baking workflow.
βοΈOld House 3D model : https://bit.ly/2xQSeU4
β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬
βοΈQuick Links :βοΈ
Introduction - 00:00
Part 1. How to bake lights ...
this is for URP but the same ideas and process applies if your using the built in pipeline
hello, i wasnt sure where to ask this, but this random shadow appears on my plane when looking from some angles (realtime directional light) which disappears when turning off the shadows on the plane. its the default unity plane model, and help? thank you
@left spire if it's an indoors level, you can set ambient light to black
You can also generate appropriate reflection probes, and correct the smoothness values of the materials
Can you tell me where I can find a tutorial on that
Im a beginner as you can see. π
I don't know what my next step should be
I found a way for ambient light but what about those materials?
Thanks I fixed it!
hello
can someone explain me how i can do lighjting in 2d? im struggling on this for quite some time now
in tutorials they just quickly done it with the urp i think but for some reason that doesnt work
im also a beginner btw
All my models are in the .asset format, making it impossible to create proper UV maps, since they don't have import settings. Are there any tools that can automatically convert and replace these models, or can generate proper UV maps for them?
It's preventing me from turning realtime lighting into baked ones, so any help would be appreciated! ^^
Unity fbx exporter package
Is it possible to cast a light on a video being played? (canvas with raw image). Currently the green light only affects sprite renderer behind the canvas and not the canvas itself. Here are the properties of the canvas and raw image
Is it the default UI Material of the raw image that is causing it?
also my light settings
anyone an idea why the lighting in the distance is much brighter than that from close range?
Shadow distance likely
thx lets see if that helps
Note that your shadow resolution is divided over the whole distance, so when you increase it your relative shadow resolution drops very quickly
For this kind of situation I prefer to use shadow cascades, so that the cascades are bundled pretty close to the viewer, and the last cascade alone taking up most of the shadow distance
So there is shadowing quite far, but we won't care about the resolution really
i have a quad with a transparent texture on it set to "cast shadows: off" in the renderer but its still casting a shadow in the lightmap
disabled:
What render pipeline is it on? It doesn't seem to happen to me on URP
what the hell
i just upgraded my project to 2021 lts and now when i bake with mixed lights and shadowmask, there are zero shadows in the bakes π€
it was working fine in 2020 lts
ohh okay they inexplicable made both shadowmask and distance shadowmask in the lightmapper settings just "shadowmask" and made shadowmask a discrete setting in the project graphic settings which defaulted to distance π
Hi! anyone knows how to bake shadowmaps in URP with baked directional lights? right now i have to set them to mixed for the shadow map to even be considered inside my custom shader (and the shadowmap preview mode), but I'd prefer if these lights weren't mixed, since I don't need realtime light for anything else
"Shadowmap" referring to the shadows from realtime lights cannot be baked, because they're entirely dependent on the camera's position and perspective
You'd rather use fully baked directional light, not mixed
i mean this shadowmap
shadow mask*** sorry
I would assume that shadowmask textures are tied to mixed lights in the Progressive Lightmapper
You might be able to disable the mixed light at runtime to not render the realtime part of it, but keep the shadowmask that way
i've tried, disabling the light also disables that light's shadowmask channel
The shadowmask is just a texture sampled using a mesh's lightmap UVs, so maybe you can just keep it externally after baking again using baked-only lights
is there any way of baking a shadowmask using baked lights? ive tried, but the output shadowmask is always blank, it only works with mixed lights
I expect not, as I said it's a part of how the Progressive Lightmapper decides to do things internally
You'll have to do something hacky for sure
shit, alright thanks! is there an api i could hook into to make custom bakes or something?
I don't know of one but maybe you can find something
cheers!
Hello, im not sure if this is the correct place to ask, but I have made a day night system which rotates multiple lights in a circle. But this means that the map keeps flickering, is there a way to stop the flickering?
Sounds like pixel light limits per object
So How would I fix that?
You may be able to increase the pixel light limit
But without knowing what the "flickering" looks like exactly I don't want to give precise solutions, in case the problem is not what I think it is
I figured out what it was, because i was rotating multiple directional light sources to create a light effect, i think the engine didnβt like it, as soon as i switched to a singular moving light source, it worked fine!
Thanks for trying to help though π
Directional lights don't have the light limits that people very often run into punctual lights, which I was talking about
That's why it's important to demonstrate your issue unambiguously
Is it possible to limit the fall of light sources only on the prefab?
if the light source is in the prefab, then it can only illuminate the prefab
With realtime lights only by associating prefabs by light layers that don't repeat adjacently
With baked lights you can associate lightmaps with prefabs using a script
I have a script that auto generates a city, which is not the best. It sometimes generates overlapping floor which gives a weird lighting look. Is there a way to fix that for overlapping objects??
Is it possible to have differently layers each have a different directional light, and have each one cast shadows for its own layer?
Hey people, is it possible to swap between light backs at runtime. I have a number of places where I want to be able to turn lights on and off and I feel like it would be better to use backed lighting since the lights themselves don't move. Any one know of any good tutorials or what not?
The term you're looking for is baked lights. And yes it's possible to switch lighting modes at runtime, by swapping the lightmaps in your lighting settings. So you would bake once with the lights on, save that baked map, and then do another bake with the lights off. Then you can switch between those two lightmaps
I've done this before though I used Bakery on that project https://geom.io/bakery/wiki/index.php?title=Community_extensions#Lightmap_Swapper_.26_Light_Probe_Storage
Ah yeah, sorry, I must have miss spelled bake and then chosen the wrong correction. Thanks for the tip, I didn't know you could save the light rendering out!
Would still appreciate an answer to this.
can someone help me with the shadows on this animated windmill? No matter how many times I bake the lighting, this problem remains
Is it rotating?
And you are using baked lights
So that would break it
Afaik at least im not exactly a lighting expert
Baking only works on static objects so it won't work with a rotating windmill. Or at least it won't look right anyway.
If you're shadows are odd after you bake, then it might that you have generated lightmap UVs? Select your model in the project folder and then in the Inspector, select this option and click Apply.
You need to separate the objects- the windmill building needs to be static with lightmap UVs on as @little condor mentions, and the rotors need to be a dynamic object (not static). The light producing these shadows needs to be set to mixed or realtime in order to have realtime shadows.
When using URP is there any way to control shadow distance per scene? As its all moved to the URP profiles now. And wanted to control it per scene as some of our levels a large open world and others are very small tight spaces? (we are already changing the lighting settings per device tier.. so its almost per tier per scene.. and im going to end up in combination hell π ) wasnt sure if Unity already had like a bias control per scene?
@little condor thanks yβall!!!!
hey all, is there a smart way to get rid of these (AO?) streaks inside of hollow cylinders ?
Is it possible for different layers to each have a different directional light, and have each one cast shadows for its own layer?
In Unity 2023.2 alpha the GPU Lightmapper is officially out of Preview!
Since 2023.1 Unity provides a "Baking Profile". This can be found in the Lighting window when using the GPU backend in on-demand mode, and offers you a tradeoff between performance and GPU memory usage when baking lightmaps. Since 2023.2.0a1 we have reduced the minimum VRAM requirement for the GPU Lightmapper to 2GB.
With this improvement, we have removed falling back from the GPU backend to the CPU backend. Instead of silently falling back from GPU to the CPU Lightmapper, now the bake process will stop and provide a clear Console message to explain why. However, with the lower memory consumption, we expect the number of failures to be significantly lower.
Note that for light baking some Scenes will simply not fit into GPU memory. This can become noticeable when processing large Scenes with many objects, and/or using many large textures, for instance for transparency.

I recall you mentioned that lighting auto-generation is unreliable compared to manual
Do you know if there are changes coming to that?
We are working on this and I hope to have more info to share about this soon!
How. Do i. Get this. Into my 2021 LTS version.
Ok sorry if thats maybe rude but I reallllly would like gpu lightmapping, my CPU takes so long lol
And i dont want to run into issues woth newer versions of unity that are not LTS
Im assuming its not possible because of some requirement in the gpu lightnapping code that isnt in older unity releases
Hey. SO im pretty new to lightning and stuff but I added post processing and I was trying to make nighttime and this happened
yeah, but it says preview and i think mine is erroring out and defaulting to CPU
With this improvement, we have removed falling back from the GPU backend to the CPU backend. Instead of silently falling back from GPU to the CPU Lightmapper, now the bake process will stop and provide a clear Console message to explain why.
thats why i want this
Right, if you aren't getting an error I expect you could be able to port your scene to a 2023.1. project, bake and see what the detailed error is
hmmmmmm, i think it is using the GPU? after some more tests
lemme actually ADD a baked light lmao
Usually randomly not being able to bake with GPU was solved for me by updating GPU drivers and restarting Unity
it is using the VRAM i think, like VRAM usage goes up, and it still says Baking device as my gpu, but there is no core usage
Well, maybe the 2023.1. test project will give you more accurate info
okokok i added a baked light
it did work
good, im just dum
Is ~1.5 minutes normal for baking one light, just making sure lol
1024 lightmap size, idk if any other settings are important
hm, gpu gets 480mrays/seca nd CPU gets 32, but will the results be the same?
Depends entirely on bake samples, bake resolution (texel density, rather than lightmap size), scene meshes and most importantly your hardware
GPUs are orders of magnitude faster at this task, and the result will be the same in most circumstances
There are some specific situations where GPU lightmapper may not produce perfectly accurate results but I've never spotted those myself
Messing with terrain for the first time, and peaks with heavy shadows don't get darker, but rather turn a bright glowing blue, why does this occur?
nvm, fixed it. had to set environment lighting's source to gradient, not skybox
Question - I am following various lighting tutorials to get more experienced at it, in the tutorial the Directional Light has been turned off and their meshs turn full black; in my case light off the meshes are not full black.
What could be the source of the extra lighting my scene has that theirs does not?
Hey, as Spazi very kindly answered the preview tag has been removed for 2023.2 alpha and above, although I would expect 2023.1 to be mostly comparable in terms of functionality and performance. We will not be backporting the improvements we have made to 2021/2022 releases as the improvement is a complete rewrite of the baking orchestration.
However, you can already bake using the GPU lightmapper on these earlier versions, with the caveat that if your GPU VRAM is too small, the bake will take longer as we split the lightmaps into tiles to fit it into the gpu memory (you can control this in 2023.x using the GPU Baking Profile). The number of lights isn't the only thing to affect bake time, it's mostly the size of the geometry, the size of the lightmaps, and the number of samples per texel.
If you're willing to switch to 2022.2 (soon to be LTS), we made an improvement which caches the GPU lightmapping shaders which should shave off 30s from the bake after the first bake with the GPU. Hope this helps!
Oh I see it was the skybox sorta? π€ If environment lighting is black and environment reflections are 0 then the mesh is full black
Yes, it's the environment lighting from the skybox
Yeah this is great, thanks!
Only small concern is i saw a benchmark on this server showing that 2022 has lower framerates than 2021? it was from a user and it was in URP so idk how valid these claims are, but i was hoping you could clarify on that point.
whoops meant to reply lol
No worries about the reply. I am not sure which post you are talking about and it could just be related to URP (I'm on the light baking side of things). If it's a valid concern then it's crucial that the user files a bug (if they haven't already) and if it's in my area we'll deal with it 
#archived-urp message the message in question btw
there is a few context messages above it
I wish discord would just let you link to messages in other channels without this sketchy looking nonsense lol
it might be specifically for VR since they were talking about that
What should I do with this asset since I can't push?
Yep I read some of the context above and below. Not clear what the issue here might be just by looking at the stats, but the difference seems quite large. I wouldn't recommend using the tech stream releases in production, it depends on what your project needs are. For VR, having very high framerates on something like the Quest 2 is a must-have. For desktop platforms (with much better hardware presumably) you can get away with it until this issue is resolved.
There isn't any elegant solution, I'm afraid. I'd say add it to the .gitignore and keep it locally on the machine that will build the project. The lighting data asset missing means that you won't see the lighitng on a different computer, but you can either generate again or transfer it outside of git if you need it elsewhere.
Ah so as long as I can regenerate it again then it should be fine for me. Is it as easy as just pressing regenerate lighting if I delete it?
Yep π
That is fine with me then, thanks for the help π
Would anyone who has knowledge with lighting be able to jump into a call with me and help me solve some lighting issues?
Situation : i have conference room and 100 chairs inside. 100 chairs have 1 UV map which overlapped because they are same.
Question : how can i do their lightmap UV ? They seems like points inside UV2 map.
Each of them needs their own spot in the combined lightmap UV space, which the second UV channel is used for
You can tick "auto generate lightmap UV" in mesh import settings
However that many chairs might take prohibitively much space on the lightmap, especially if they have a lot of UV islands
If that becomes an issue, you could render them as dynamic objects and light them with light probes, reflection probes and mixed lights
okey got it thanks.
another issue is about padding, on forum that i did read they refer numbers as 64 or 128 pixel padding but what is for. i mean 64 for 1024x1024 or 2048x2048 or 512x512 texture size?
i generally use 1024 uv size inside maya UV page so should i pick 32 or 64 or 128 to avoid light artifact
In what context were those numbers given, do you happen to have a link?
Usually you should be good with 2 pixels, and more than 3 is excessive in my experience
Buy the script here https://gumroad.com/malcolm341
Click here to subscribe https://www.youtube.com/c/malcolm341?sub_confirmation=1
Quickly create lightmap UVs automatically with this handy tool in Autodesk Maya. No need to waste time going through menus or creating custom UV mapping for your model, create lightmap UVs in one click.
This is a bit confusing to me because UVs aren't measured in pixels, the lightmap is
If you have hundreds of chairs with multiple UV regions, the margins will add up very quickly
If your meshes have detailed geometry and they aren't viewed up very close, baked lightmapping may not be the best option
But it depends on your specific needs and performance concerns
yea a bit confusing π
my last question, total 90mb lightmap is high or low on map size equal forexample cs dust2 map or street with 10 houses
Hefty
I believe dust2 was almost 20mb in total including baked lightmaps
Thanks lot!
I stress again that you should only bake lightmaps for meshes that really need them and are suited for it, so mainly large and blocky geometry
That is, unless you absolutely must avoid realtime lighting and have abundantly texture memory to spare
Hey, I'm making a game for VR(using XR, with android), and my lights have been weird, my lights normally work fine, but whenever I turn my camera to a certain director, both in game and in the editor, all the lights just turn off, even the ones in view. Sorry if it's a simple fix, I just haven't been able to find any
Actually, they don't turn off, they just turn white, but i'd still like to know if there is any fix
Anyone can help me understand how this is by design?
https://issuetracker.unity3d.com/issues/global-illumination-is-not-shown-when-closing-and-reopening-a-scene
Are we not supposed to be able to see GI lighting when we open/close scenes?
Reproduction steps: 1. Open βProjectBraveβ project 2. Open β_ProjectBrave/Scenes/Combat/Test Level/Combat Testβ Scene 3. In the top ...
Hello! A colleague of mine and I took a look at this case. The caveat in this particular case is that the scene geometry is rebuilt every time the scene opens. The lighting system registers references of static objects at bake time, meaning that if they are replaced (in this case re-genereated) on scene load the lighting data will be referencing the old geometry and will require a re-bake.
Baked lighting, in the form of lightmaps, is patched directly onto the geometry. If that is lost, the lighting is lost. I believe that my colleague found a function parameter in the level generation that if set to false would make the issue go away.
This looks like you're hitting the pixel light limit. Is this in URP?
If so, you'll find the setting in the URP settings, if not it's in the Quality settings https://docs.unity3d.com/Manual/class-QualitySettings.html
I see, thanks for the clarification, I was very confused by the comment on the case.
That was my bad too, I left over a piece of code that re-generate the level generation on Awake by mistake
Which wasn't supposed to happen
No worries, I hope things are working for you now π
Actually I just remembered why I have it re-generate the mesh on Awake, it was because I want it to support runtime level generation as well for user generated levels.
If this is the case, I wonder how do I support GI for runtime user generated contents?
Right now TileBuilder already supports saving grid level data to JSON, and the mesh will be generated at runtime from the JSON.
You'd most likely need to go to HDRP and try out screenspace GI
None of the precomputed options are available at runtime at the moment
I'm not sure about that, sorry. The render pipelines are on a path to being more aligned, but I don't know if SSGI is part of that plan.
How do you remove baked lighting from an fbx?
I'm using this FBX in this prefab that had baked lighting from a different scene. I don't want baked lighting on the fbx in this prefab. I can't find settings anywhere in the material on the fbx or the children on the fbx. I don't want to remove the baked lighting from the scene that this was originally in so I won't be deleting the lightmaps.
You should be able to reuse the same model / prefab in different scenes without the lightmaps carrying over π€
Can you 'Clear Baked Lighting' in your new scene if you're not using any for it?
Thanks for the reply. Right okay, I assumed that was how it should work. There isn't a "Lighting Data Asset" in the Baked Lightmaps tab > Lighting Data Asset field for this scene. I cleared the data anyway as you suggested but nothing happened. I just check the geometry normals and they are correct.
I unity FBX asset import settings window for the pumpkin asset, I turned off generate lightmap UV's and hit 'apply' but it hasn't changed anything.
This is a video of it in blender (opened from the fbx file directly from unity editor asset folder) just for context to confirm that the asset has no problems in and of itself. I also know that it did not look like this before baking in the other scene.
Is the .fbx itself set to 'Generate Lightmap UVs' in the importer?
It was. I unchecked it and applied to see what would happen. Nothing changed. Is it possible for lightmap data and lightmap generated UV to persist after unchecking the Generate Lightmap UVs option?
I think the workflow is supposed to work such that when you make a change like this you'd need to rebake. On this topic though, why use lightmaps on a small (?) object instead of having it receive GI from light probes?
Good question. I don't know. I have a bunch of static objects in the scene I baked in and didn't know any different. It is a small object, yes. Does the size make a big difference? The scene is quite large and it seems like manually placing light probes would be a lot of work throughout the whole scene
I'll look into light probes now.
It gets easier with time as you can dupe them and CTRL+drag to place them in discrete units. It will save you lots of texture memory as well which lightmaps take up π
From what I read, they also contribute lighting information to non-static objects. That sounds very useful
Yes! They can contribute GI to dynamic objects and static objects.
What are the requirements to load levels with GI Additively?
Currently I've done these 2 things.
- Same Lighting Settings on both levels.
- Used SceneManager.MergeScenes(firstScene, secondScene).
But it doesn't seem to be working on build.
Are there any settings I should be aware of?
Use SceneManager.LoadScene(<buildIndex>, LoadSceneMode.Additive)
MergeScenes is an Editor function for combining two scenes and serializing them into one, doesn't work in the Player.
But it says scene management at runtime? I only used it because I heard I need it to merge lightmaps
And yep I did use this SceneManager.LoadSceneAsync((int)sceneName, LoadSceneMode.Additive);
You don't have to merge lightmaps, but if you're using lightprobes you need to re-calculate the tetrahedral mesh.
Ah, apologies. The docs say Note: This function is destructive: The source Scene will be destroyed once the merge has been completed. so I'd advise against it unless you need it for something other than lighting.
I'm not familiar with that method but it sounds like it's not meant for runtime use, rather for authoring scene assets
Which is kinda weird in context
Oops I was scrolled up
Not sure what (int) sceneName does in this case, but make sure you're using the right numbers here. Also keep in mind that scene loading async happens in a separate thread, so you won't see the results until that process finishes.
Ah, its an Enum called SceneName which is automatically generated, so (int) refers to their build index.
To best of my knowledge, lightmaps and other lighting data are read only from the active scene, even with additive scenes
To let separate parts keep their lightmaps you'd probably have to use the PrefabLightmapping script
But I'm not entirely sure
I am trying without MergeScene on build, but build is taking long, I'll come back and report back the results
π
It depends on how you bake them. You can bake 5 different scenes separately and load them all then all of them will present lightmaps / probes. If you bake them together, then you need to set the active scene at runtime to be the active scene you used at bake-time because only one LightingDataAsset exists for the whole scene constellation.
Is there a channel where I can ask for feedback on my level lighting wise or if anyone wants to have a look, The level takes 3 mins to get through
@forest rose if you have a repository I can clone I could take a look
Sure, I will push to latest. There are rooms I haven't done lighting for yet and that's because I wanted to sort out light bleeding issues and hallway flooring not reflecting
Would you prefer a build of the level (I haven't done a build yet so things could go wrong) or just a scene? (I would have deleted lighting so I can push to github)
The Unity project, so I can take a look internally
No problem, will push and send you a link now
https://github.com/ckusellagussin/Website_Showcase
There you go
I plan for this to be built as the homepage of my website portfolio
So published with webgl, not quite finished yet and I probably should have done lighting last after I finished fleshing everything out
Website Showcase feedback
Can you show screenshots of the editor and player?
Can you show screenshots of the editor
I am using URP, thanks, but there is no setting for Pixel Light Count, and Iβm not sure if itβs the same, but in the URP settings the per object limit is at max, 8
It is the same ^^
Would anyone here happen to know if when a scene is loaded does the lightmaps associated with it all get loaded into memory, and stay there for as long as the scene is loaded?
I am thinking of having a single scene for my project, it will use baked lighting, but if all lightmaps are always loaded into memory that could be an issue.
I was hoping that as prefabs get loaded/unloaded as the player moves around (using a custom streaming system) only the necessary lightmaps would get loaded/unloaded along with them. But I cannot find any definitive information on that.
Ok, but yes the issue is still persisting
There are multiple ways to tackle it
#archived-lighting message
When loading into my scene from another scene the lighting looks a lot darker. Whereas when pressing play from the scene itself it looks a lot lighter, what is going on and how do I fix it?
Google "scene gets darker on loading" and you wil find a lot of resources
Don't you think I would have tried research first? None of the solutions provided on forums have helped much.
So what you tried? Did you Generate Lighting?
Yes, but that causes other problems, such as whenever I change anything in my scene it regenerates and I really don't want that.
I have also tried setting it as the active scene when transitioning between scenes.
Changing the lighting settings of both the scene and light etc
The only thing that fixes it is enabling auto generation of lighting, but that often takes minutes and my pc maxes out performance to do it, and it just resets every time I move or change something.
How can you make the skybox "glow" like in this pic?
Is it an hdrp only thing?
If its volumetric lighting
I dont know what the name for it would be called
It is post processing bloom
It is the solution though
What other problems precisely? You can disable auto-generate in lighting window, and you shouldn't have Baked Global Illumination checked if you only need to fix the ambient light turning dark
I have auto generate off and I have baked global illumination off but it still happens
It's definitely not supposed to
What's the editor version and does restarting it solve it
Its 2022.1.9 and I have restarted unity two or three times.
@deft fiberDo you have any suggestions on what to do?
I recall seeing this problem reported years ago somewhat commonly but I can't find much anything about it now
I would in that situation delete/regenerate the Library, and if that doesn't improve anything start googling more fervently
What do you mean by regenerate the library?
It means deleting the Library folder in your project files through windows and letting Unity regenerate it, which resets all editor's internal files
I believe it is the same option as "Assets>Reimport All", but possibly a tiny bit more nuclear when you want to be absolutely sure
Though it's an old problem, worth noting that your editor is an un-updated version of an old tech stream release so there could be assorted problems originating from that
Okay I'll do that, I just pushed to git so I can always revert back to that if it messes up my project.
What version should I move too?
The Library folder doesn't (shouldn't) be tracked by Git at all because they're all temporary files and hefty in filesize
But for backing up before upgrading editor versions Git is perfect for
2022.1.24 at very least, 2022.2.11 preferrably
Can I update my existing 2022 editor to that or do I have to install a whole new editor?
You have to install a new one, then open the project with that
Damn, it uses so much hd space
I really wish I could just update an existing version
You can uninstall the previous editor before you install the new one
That didn't fix it, I will upgrade now.
@deft fiberI have updated to the new version and nothing has changed
Here is my lighting settings if it helps
and the visual result still looks the exact same
Is Realtime Global Illumination meant to be enabled?
Yeah I have been trying with it on and off
If you really can't find anything about it or google and trial and error isn't working, then I would try to isolate the problem to a test scene or a test project
If it doesn't occur in a fresh project in a similar scene, then you know you have some way to fix it, or in worst case port all the assets over to the new project
If it occurs even in the fresh project then you could report a bug and have someone at Unity take a look at it
Okay, I think I just fixed it. By disabling every option in scene lighting, then enabling Auto Generate it seems to work. Now when loading the scene from another scene it looks the same as if I had just loaded directly into the scene.
It is all updated realtime now as well so I don't have to wait for it to bake like before with auto generate enabled.
Thanks for your help with this
You'll want to test it in build too, I don't think auto-generation has any effect there, and the problem may be altogether different
Just tested, it works in builds too.
It just took twice as long to load the scene
but thats okay as its only about 5 seconds
Guys for anyone trying to bake lights, I have found the perfect settings for a good high quality/speed ratio
Default settings
Vs these settings
Anyone know why my scene is darker on build?
It works perfectly fine on editor
Want to know if anyone else ever encountered this issue.
#1086310444668567612 message
Why do all my shadows dip to a deep black when I load a scene in URP ?
What does your Lighting > Environment settings look like. Do you have something set in the Environment Lighting section?
this is the source scene, and then it's loaded into the second one
That looks all good. I was wondering if you were using Color as the Source and it was set to black, but as long as your TestSky material is valid, then it should work. What do your TestSky material properties look like? Exposure isn't set to 0?
I also take it this is realtime lighting, and those shadows aren't baked?
no, the ones in this scene are realtime. Day/night system and all that The TestSky material is the default material with some colors changed. In editor, the shadows look fine.
it's just when I jump from one scene into this other one the shadows become pitch black
It could be a post-processing issue. Do you have a post-processing volume in the new scene and is it enabled on the camera?
not in the scene, no
When you say your TestSky is a default material, you're not using a Lit shader are you? You should be using the Skybox shader, for example the Procedural one.
Cool. Not sure what the issue could be then π€·ββοΈ
Can you click 'generate lighting' in the scene you're loading even if it's all realtime lighting?
Ah if you already had then you probably don't have to again π€
Maybe it's that env lighting is coming from the active scene?
maybe a clue is: the scene I'm coming from has no directional light, since it's an interior scene
i havent done it before on this scene, I have just done it enough to know roughly how long it takes
also I'm not loading additively
Then that's what it is. You need to bake GI for the environment lighting to be there in play mode
Okay, so I baked the GI and it works.
We're working on fixing this workflow
but what if I want the sun to move? Shouldn't the dynamic lighting have the correct shadow color?
My guess is that it will with the current setup you have
But you can also use enlighten realtime gi and you'll get the environment lighting recalculated
isn't enlighten deprecated?
Only enlighten baked gi, not realtime
So I gotta bake the scene for the realtime shadow color to work, then?
this is confusing to me, because in a previous project, it worked fine without baking GI realtime lightmaps.
The difference is that this is not shadow color, but ambient lighting that is applied over the shadow. I'd suggest trying stuff out and seeing if it works. If you're using just realtime lighting I think there's a chance it will work π Especially if it worked for you before.
the documentation isnt Completely clear on what is and isn't Enlighten and what is and isn't deprecated. Are those probe volumes with the yellow dots part of that system, and do they work still?
Light Probe Groups are a separate system but compatible with Enlighten. They can also hold baked indirect light.
I see, okay
@arctic isle Sorry to ping, but i've been trying to solve this issue for ages and as you're a developer, you may know or can point me in the right direction to solve this. do you have any idea what PrepareDrawShadowsCommandStep1 does in the URP pipeline? Whatever it's doing is causing a seg fault. I thought I was finally free of this wretched thing, but it's back. Here's the top of the stack trace:
Received signal SIGSEGV
Obtained 67 stack frames
0x00007ff71a5bc052 (Unity) PrepareDrawShadowsCommandStep1
0x00007ff71a5b33f7 (Unity) ScriptableRenderContext::ExecuteScriptableRenderLoop
0x00007ff719b0cd89 (Unity) ScriptableRenderContext_CUSTOM_Submit_Internal_Injected
0x00000175adb8bb71 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Rendering.ScriptableRenderContext:Submit_Internal_Injected (UnityEngine.Rendering.ScriptableRenderContext&)
0x00000175adb8ba13 (Mono JIT Code) UnityEngine.Rendering.ScriptableRenderContext:Submit_Internal ()
0x00000175adb8b903 (Mono JIT Code) UnityEngine.Rendering.ScriptableRenderContext:Submit ()
As it's Unity, I assume that's down in the C++ code, which isn't something I can fix myself
This has something to do with how URP is interacting with the C++ layer in the Editor. Haven't seen it before, can you submit a bug?
Meant to reply π
I'm filing a bug report as I speak. I tried before but my previous project was too big to send...
Thank you! Yes, the smaller the better otherwise it's very hard to investigate π
In my experience with this accursed bug which has been smacking me around for a week, the stack trace begins with UIElements of all things, which I don't think should be a part of this. AFAIK I didn't do anything directly to cause this, which was also the case before... Unfortunately, as I said, a few pieces of the stack trace delve into c++ territory, which is outside of my range
thank you for responding
It may be something triggered by the UI but manifesting in C++ land. Thanks for reporting the bug, I'll have a look if it ends up in my area, though I have a hunch this is more on URP to investigate.
Scene size shouldn't have any impact on the time to generate lighting
Unless you're using baked lightmapping, which is a different thing
Another way the terminology is confusing
hello, is there any way to improve these spot light shadow quality issues? its on 4096 but still looks like this
Hello there! So I managed to make night in my game, but the object does not want to get dark.
I dont know whats the problem, and what to do. :/
heyo so i was baking my lighting, and it keeps turning out like this, does anyone know good data amounts??
Possibly lightmap UV overlap, check the console for warnings about those
But also your sample counts are pretty crazy so it's possible your bake never finished fully
I recommend you don't go over direct samples 32, indirect 512 and environment 256 when testing
yeah those numbers are nuts, you should never need to go that high ever
the issue is its everywhere
Is there a way to see that in blender?
it looks like this
then after a few seconds
this:
Yes
I stand by my previous advice
cant seem what's going on
i just deleted the lightmaps and rebaked
worked like a charm
that would explain it
What's that? Visual demo?
You probably want to use shadow cascades to allocate shadow budget to be close to your camera
#archived-art-asset-showcase or #archived-works-in-progress unless you have a topic to discuss
Why the spotlight soft light is passing through the object? It shouldn't be on ground
I've played around with the cascades already and no change
have you set it, and what it's pointing at to cast shadows?
The suspended plane is set to cast shadows
the spotlight (realtime) is up on ceiling and is pointing downward
has the spotlight been set to cast shadows though?
i dont even see a shadow in your image tho
can you please make your issue more clear with some other example
Feedback Request: Global Illumination changes with the 2023.1 beta tech stream
https://forum.unity.com/threads/feedback-request-global-illumination-changes-with-the-2023-1-beta-tech-stream.1412454
We want to make sure we are providing you with the best products for your day to day experience in Unity. We want to learn from you how you are experiencing the changes related to global illumination which we delivered in the 2023.1 beta release. Please take 10 minutes to complete the following survey to help us improve your ongoing experience with Unity, and invites you to participate in user testing for Adaptive Probe Volumes.
Also see discussions in #archived-hdrp if you're interested in what's going on in the Discord side.
Yeah that's the issue, there basically isn't, but it's very broken looking around the top of the faces
There are shadows, but most of the problems stem from using a wide spot angle and too low bias values
Spot light shadow quality goes expoentially worse when you push the angle wider than 100Β°
I generally recommend keeping the bias values at defaults (not zero, nor very high value either) but you may be able to improve shadows on flat surfaces by increasing Depth bias, and on curved surfaces by increasing Normal bias in this situation
ive messed around with bias settings but ill try changing angles
they just showed up after changing the texture on my custom terrain shader
Uhhhhh? what are these bands from?
my messages sent out of order whoops
oh wait
nvm its from my normal map somehow
@deft fiber so sorry, I actually had something typed out but forgot to hit send. I wanted some feedback on this current scene. I wanted to know if anyone had any experience lighting large scenes made to look small due to perspective. Also wanted some feedback if possible.
Managed to track this down to, at least in the public Graphics repo, UniversalRenderPipeline.cs line 729, with 80% confidence. I can't investigate any further.
and, well, I can't exactly fix it, can I?
but in my version (2022), it's 657
that line goes down to c++ land
I wonder if I should try upgrading to 2023...
If you do, I recommend making a backup, and I'd recommend 2023.1 for a start if you do go that route. Thanks for investigating this, it's much more likely (I think) that it belongs to the URP team. Did you end up reporting it?
I did report it, but before I pinpointed where it was. I got that info from the stack trace and a little digging, so I think they can find it too. I just wanted to see if there was Anything I could figure out that could help me work around the error.
No dice, though.
If anything, you may get a workaround from the people working on the bug.
why is there shadow on joints and zigzag in shadow
And yeah Iβll make a backup. Iβve been hesitant to jump to 2023 because a change made toβ¦ what was it, render handles? I forget. Was going to break a lot of packages I was planning to use
The joints is SSAO (Ambient Occlusion). The jaggedness can be fixed by setting your shadows to soft shadows in your render settings, and/or in creating the shadow map resolution, also in the settings asset.
Thanks i will try.
Thanks SSAO worked. but zagged shadow is still problem and also ceiling have more light than wall, also objects kind of shinning on edge. Thanks in advance.
You'll need reflection probes in the scene to fix the shininess. Without them they're drawing reflections from the skybox
and how to solve shadow zaggedness
By decreasing shadow distance or bringing the shadow cascade Splits much closer
Hmm light mostly works the same regardless of scale, unless you go extremely small or large
One thing is that light sources would be comparatively large, so they'd result in very soft shadows
To control light source size / shadow softness you'd need HDRP or some custom lighting asset
You could add a strong depth of field though, and another thing that conveys scale beyond lighting are physics
Small physical objects have very little relative mass and inertia, and by extension are more affected by wind and air resistance
Still shadow is not good
I didn't mean to decrease number of cascades, but their distance
thanks but still same result
If you see no change at all, confirm that the URP Asset you're editing is active in Quality settings
yes its active
yes its active
How do I have a plane that can recieve shadows as if it was just white but is otherwise unrendered?
Transparent texture didn't work, unfortunately.
A shadow catcher of shadow drawer would be something to search for. It depends on your render pipeline https://github.com/keijiro/ShadowDrawer
I'll take a look, thank you for the suggestion.
how should I get my trees to render their colors? this is during noon in my game, but the light doesnt hit the leaves, rendering them as black instead
im using a directional light
You can see also on the outer edges of the leaves there is lighting and they look green
I am doing some lighting tutorials to get more familiar with unity lights - in Linear color space is that sorta yellow-ish bright sharp edge to the specularity expected?
I feel like based on this image that some setting might be wrong because it feels over-exposed
for parameter reference, the light's intensity is 1, the surface's smooth/metal are 1 and 0.77
looking at this I feel like I am getting the bottom result and should be getting the top result?
I am in linear
I tried setting up the example from this page
https://docs.unity3d.com/Manual/LinearRendering-LinearOrGammaWorkflow.html
is that the expected appearance?
removing all other sources of light and reflection, is that the expected output of linear light space? it looks wrong to me
i switched it to gamma for comparison and this looks even worse π€ so at least I know it IS in linear space when its says its in linear space
I will keep following tutorials for now, maybe one will have the answer
looks correct to me, the point of linear space is to have a natrual blend of colors, and brightness values that scale linearlly (rather than scale based on a gamma curve which skews results)
if you've been in gamma space for a long time without knowing it does take some getting used to if your switching to linear
Yeah i've definitely only been in gamma until now, trying to familiarize myself with making scenes look good instead of default
use ambient lighting
Uhhh how
I guess google it?
Im on mobile atm so its annoying to search
you can
Cool, thanks!
where is the lighting/environment data stored?
I have two scenes and environment differs between them and I would like to use the same parameters on both scenes
@night shell it seems like its really slow at updating
ive tried skybox and color
single color should also be instant
for controlling that
though I'd advise you use a gradient color rather than a single color
it'll look better
https://forum.unity.com/threads/copy-lighting-settings-from-scene-to-scene.308634/
looks like based on this it cannot be done?
Newer versions of unity has changed this so lighting data is now stored in an asset that can be used across multiple scenes
thats good to know, I am on 2020
Doesn't cover all the features though, I don't know if there's a way to sync environment values like that
im usijng gradient, it does not update instantly
it takes multiple seconds
i can record a vid if you want
in editor or in game?
What explains this shadow banding using point light in Unity?
Usually too low or high bias values
https://docs.unity3d.com/Manual/ShadowPerformance.html
Thanks!
I kept working on the shadows and the result is okay now, only one thing though, it seems as the shadows don't move smoothly but rather in small steps. As if they didn't update often enough.
Here's the movement code, that is currently called on update, it does use Lerp so I would assume that'd be smooth?
Could also be described as slighty jittery/flickery along the edges, just slight movement back and forth noticeable around the edges as it moves (on top of the normal back and forth movement).
If I understand what you're describing it's because shadow passes are limited by their pixel resolution
The way any edges rendered on the screen "shimmer" from one pixel to another when moving slowly between them, the pixels of the shadows shimmer too, though you can look at the edge much closer
Assuming that is the problem and there isn't some other jitter on top of that, there isn't exactly a solution for it
If the light is meant to be a sun, you could use a directional light instead so you can benefit from shadow cascades
But to be rid of the problem you'd probably have to use HDRP or some other system with much more sophisticated shadow filtering
The closer the objects are to the light, the less shadow aliasing there will be
@deft fiber Here, reading this right now, does this apply?
It does seems pixel like in a way
Or low resolution, the way it jumps from one pixel to the next.
Might try that too.. It's more limiting though, iirc there was a reason I moved away from it
It does look like aliasing
Something to still try is use soft shadows instead of hard shadows, and possibly increase the shadow resolution even higher if you can afford that
And since it is a spot light rather than a point light, the resolution will be spread across the angle
Over 90Β° you start losing relative resolution at an exponential pace
@deft fiber Also heard it might be a limitation of Built-In shadows, and that something like NGSS might fix it, thoughts?
[ATTACH]
[MEDIA]
[MEDIA]
[ATTACH]
[ATTACH]
[ATTACH]
[ATTACH]
Asset Store link: http://u3d.as/1qNz
The next iteration of the smoothest and...
Also resolution is maxed out, and spot is directly above
Might try to lower that
I expect it would improve things, but I have no experience with it
You could also test the scene in HDRP to see how that fares, before buying an asset
HDRP is an issue cause of all the shaders I use, but yeah, that's probably the best way of doing it
Somehow the result was worst using a spot light, or a different issue was there anyway
Shadow banding kinda
No luck with changing the angle, at 50 now
Directional light works great
But feels limited
The mix of directional light (shadows) + spot light (no shadows) seems to work pretty well though
upgrading gives me a slightly different stack trace (although in the general area still) without a SIGSEV but still crashes
Since this reproduces on 2023, the fix would go in from latest to earliest version. Make sure to add any further insights you find to the bug report, preferably by replying to the email you get once the QA team reproduces it. Again, thanks!
No problem. I havent gotten an email about it yet. Am I supposed to get a confirmation if it went through?
I think you'll get an email when it's processed
hmm okay. It's been a few days. I hope it went through...
can anybody help me with this weird baked lighting?
Too few samples, too small resolution and/or too heavy texture compression
wdym by too few samples?
how do i fix?
If the problem is samples:
https://forum.unity.com/threads/progressive-lightmapper-guide.1340936/#post-8467157
If the problem is resolution:
https://forum.unity.com/threads/progressive-lightmapper-guide.1340936/#post-8467121
If the problem is compression:
https://forum.unity.com/threads/progressive-lightmapper-guide.1340936/#post-8467247
It feasibly could also be a denoising problem:
https://forum.unity.com/threads/progressive-lightmapper-guide.1340936/#post-8467205
You'll have to test these to figure out what the culprit is
I'd start from compression
@night shell OK after some hassle figuring out why my game was crashing, I can confirm that the ambient lighting has a big delay, maybe 1-1.5 seconds before updating
do you have any ideas why
not really, perhaps its being computed on the GPU and thats why it takes a bit for it to get updated
but I would ask how fast your lighting for your scene changes
I mean your directional light
yeah
your scene is an outdoor forest scene yeah?
I'm assuming you have some kind of daynight cycle thing?
how fast is the daynight cycle
uh its 27.5 minutes total but that is extremely easy to adjust
because chances are you can live with the ambient lighting not updating immedieatly since the transitions are very gradual
Is HDRP ready for production/commerical games?
Trying to achieve this kind of graphics. Is HDRP better for it or the standard pipeline?
hdrp is good, but it is quite computationally expensive, depending on what platform you are targetting you might want to opt for URP instead, but afaik there isnt a good reason to use BiRP atm
https://streamable.com/4ev5e8 @night shell here you go
Hmm I want to target only PC/Windows maybe mac/linux but for now Im only certain about Windows
as soon as i click host, my time manager script runs
and that updates my lighting every frame
you will notice at the start it takes a second to update the ambient lighting
and then after a bit
maybe skip to like 30 seconds in, there are very obvious jumps
while my directional light very clearly updates
hmm
not sure how to make it faster, in my experience its always been instant for gradient/color specifically
anyone who might have an idea how would be much appreciated to help out
maybe my trees could cause the issue
they have been broken for a while
beacuase if you look the table updates instantly
just not the trees
that is possible
How are you updating the environment lighting exactly
RenderSettings.ambientEquatorColor = ambient_Equator;
RenderSettings.ambientSkyColor = ambient_Sky;
RenderSettings.ambientGroundColor = ambient_Ground;
not sure why you replied to my hdrp msg
Misclick
Are you also using DynamicGI.UpdateEnvironment or is it just those three
Well no, that's what I was probing for since it might've been a quick solution ^^
ill try it ig
but it updates the cube table i have
justn ot the trees
maybe just the trees do take a long computation time
is there a way to do something like shadow cascades
so i can realtime update the trees that are close, and the trees that are further away update less
Hello there, I am trying to enable the probe volumes feature, but whenever I create a probe volume, I get this. Where can I disable enlighten? probe volume feature is not supported on elighten
Just asking for some feedback, what are we thinking about the lighting here?
Supposedly changing the environment should update just one reflection probe and one ambient probe, nothing to do with any scene meshes
But the documentation is pretty vague about it
Despite there being ceiling lamps the lighting seems weirdly vague and directionless
So you mean too much light for the sources that are being shown?
Hard to say why it looks weird
It's almost as if you cranked Indirect Intensity way up
I would agree it lacks directionality
i.e. what we mean by that is there is no sharp distinct light sources in the scene that seem to contribute to the lighting
the lighting is seemingly coming from everywhere
I completely understand and agree, indirectness is pretty intense and I should add more light sources to combat this
you combat it by intensifying your light sources
generally when I light also I would avoid from taking indirect multiplier values on lights less than or greater than 1
in the lighting window I also would keep indirect intensities at 1
to essentially respect the rule of lighting in regards to energy conservation
but in your scene I can see where the lights are coming from and are placed, but the problem is that they are not bright or intense enough
<@&502884371011731486>
So what I have at the moment, is indirectness to 1 and intensity to around 3+. I do have a big range on though so it might be that being the issue
Can you show the settings you're baking with
I think the lighting is fine, issues are just the individual light sources
You shouldn't really be changing these values
In that situation I might also do a test bake without any of the artificial light sources, to make sure there's no unexplainable light coming into the room from anywhere
your indirect samples is pretty high
doesn't really affect the light in the scene but will certainly make things slower in the bake
Baking time fortunately doesn't tend to be an issue for me, I'l post my next bake
It looks better but is darker now
Still looks pretty strange
The "outside" seems pretty dark compared to how much light is flooding in from there
^^^
looks like its just an image, a disconnect between how dark it appears versus the light that is coming in behind
Is it like, a doorway or a window or a portal
I think I can see some downsampling which implies there's something in the way
The directional light is coming through the east wall so I have to use an area light for light to come in, it feels like the glass is tinted to block light
Its going to be a window, i'l be sure to add a frame around the window
Right, the earlier image showed an area light in that spot
I'd say it's still way too intense
This is my room that is only done through directional light
I think this room was why I increased the albedo and indirectness
I think there's no issue besides those two extra values and the area lights that simulate indirect light from outside being too strong
quick rough example to demonstrate why you shouldn't really try to boost albedo/indirect values
the one on the left is very uniformly lit
versus on the right when the indirect/albedo boost values are kept at 1, notice how much stronger the lighting directionality is.
I didn't make it, can't say I'm a 3d modeller or texture designer. Marble looks nice because of the reflections
https://www.artstation.com/artwork/JegJLz
( Free for personal or commercial use )
https://free-3dtextureshd.com/tiles-pbr-textures/
You did that really quick, the lighting looks much much better
its parallax corrected, he did a nice job setting up his reflection probes
what is a reflection probe
Reflection probe and box projection
to put it simply, a probe being like a point in space, and reflection obviously meaning "reflection". so its a reflection at a certain point in space
It really does feel like trial and error with the intensity values though
it is yeah, but keep as I said indirect/albedo boost values kept to 1 so you can respect the rules of light, and also maintain light directionality. If you want to brighten up your scene you should simply do it by either intensifying your current light sources, or adding more artifical lights in your scene
dont you need a TON of those then?
depends on the scene but sometimes yeah
1 per room for me
oh
what
ok i need a page on these
hold on
"A Reflection Probe is rather like a camera
that captures a spherical view of its surroundings in all directions. The captured image is then stored as a Cubemap that can be used by objects with reflective materials. Several reflection probes can be used in a given scene
and objects can be set to use the cubemap produced by the nearest probe. The result is that the reflections on the object can change convincingly according to its environment."
aha
makes a lot more sense
reflection probes are very important, especially in a PBR context
I think the only additional lights will be small lights that shine over the canvases, won't really light up the room
Still having a bit of trouble though, Not quite sure what I should increase/decrease
probably best to start with one light at a time
It might be better to add a skylight like in my other room to make it more natural?
so in that case I would mabye start with the ceiling lights and get those looking right
perhaps yeah thats one thing you could try
i think that looks a lot better tho
do reflection probes update in realtime if something like a player walks by
or is that not feasible without nomming performance
its doable, but it will eat performance if you have alot of them
does URP support it automaticlaly
yes
ok
I don't know if this is relevant here, but anyone has any ideas on why my game builded looks DEEPFRIED
very nice
I'm using urp at the moment since it's made for browser so yeah reflection probes are in urp
i meant realtime
so that players can update
like a mirror
and not just this, everyone build I did so far ends up looking like this
if you make a new project with a demo scene
does it look deepfried
let me check
Ah I get you, That might be screen space reflections youre talking about
Ah okay, stick to probes then
is this even a lighting problem or something else
I assumed so because everything else works fine
holy crap making a new project takes minutes
unity trying to encourage you to keep working on the same project :^)
error: Build path contains project built with "Create Visual Studio Solution" option, which is incompatible with current build settings. Consider building your project into an empty directory.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
well
It isn't deepfried
did you build your project into your main project directoy
do what it says
empty directory
oh
okok
I know I can solve it dude
ok cool, just making sure there are a LOT of people who dont know how lol
idk im not a lighting expert as is probably obvious by my lack of knowledge about reflections
.
if anyone coming into the channel wants to look
My guess is that your build platform doesn't support linear color space and/or uses Low Dynamic Range post processing grading
hmm
maybe
I'm using the default URP post processing
and I think it does support linear because a new project worked just fine
how do I check that?
sorry not really a graphics man
What platform are you building to
The problem occurs on all three?
I unfortunately can't test that
I'm only concerned about the specific platform where the problem occurs
Well
then Windows
I use windows
and it's not just my win version
Win 11 did the same for example
Right, there shouldn't to my knowledge be any difference between the editor's color space and the build's color space since they're both the same platform
but as you can see the images is rather different
I fixed the youget near things and it looks weird
but that's it
should I try a different Platform maybe?
Not sure what that means precisely
Anyway, in Project Settings>Quality you can see the quality levels, and you'll want to make sure the selected one (highlighted) is the same as the default one (green checkmark) for windows build
yeah it is
This will make sure you're supposed to be seeing the same thing in editor and in build
You can click through the quality levels in case you find one that exhibits that particular problem
Hmm then I don't of any more obvious things to check
Since it looks like post processing in that situation I might make a test build with all post processing disabled, or using the other quality levels to see if the problem still appears
alr
Other than that trying to port things to or from a fresh test project and hoping the problem is revealed would be my next option
@deft fiber ok after testing that function you sent does not fix anything
it runs exactly like before
let me reduce tree count maybe
It's just as deepfried
Ah, I meant to make sure you were not using it
Since it'd be heavy
oh
yeah those three are the only thing i have
after reducing tree count
it still runs EXACTLY the same
That's expected, I think!
so why do my trees keep destroying my game
i would just use another tree asset but i cant find one that looks good with wind support etc that looks this good for free
for obvious reasons
Based on what I know about the environment lighting system, changing the values would force the spherical harmonics and reflection probe to update, which are required to render the lighting on lit shaders
Though I have no idea why updating just one SH and one cubemap would be so slow
Anything you can rule out helps in a small way in process of elimination!
I'll try in a new scene
its specifically the trees tho
looks fine
okay it's fine if I turn off everything except a cam, light and a model
That probably makes the post processing volume the likely culprit, I assume
Though it may be early to say
can too much lights cause that?
it's not that
enabled everything with gameplay
and it did it
Not that I know of
Getting closer though, it sounds like!
I mean
they are disabled unless the player gets 60m close
so a few of them can be active at each time
like 2-3
I turned off all of them
and still happens
god damn
I'm getting
Shader warning in 'Shader Graphs/RocketPlume': implicit truncation of vector type at line 1527 (on d3d11)
Compiling Subshader: 0, Pass: DepthNormals, Vertex program with <no keywords>
Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
Disabled keywords: DOTS_INSTANCING_ON INSTANCING_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING
theese kinds of errors
so like
could that be it
if my damn rocket plume shader was doing that
I'm going insane
it's not that
I'm not even getting warnings now
it's
my
player
there is something on my damn player
that causes this
post processing mabye
as in the camera settings
it
it was that
what the fuck
shader compilation is so weird
so
@deft fiber do you know if there is a way i can check what the ufkc the GI updater is doing
so i can figure out why its taking so long
Nope I don't!
I've read the docs but that didn't help me understand much
And I haven't really had a chance to test it or try to track down and study the source
Might be beyond me
"Realtime global illumination" means you may be using Enlighten's precomputed realtime GI in addition to scene's own environment lighting
intersting, would that cause the lag?
lemme run rq without
well now none of my lights work
tf
ok i fixed that
some other weird setting
but nope
still delay
maybe less tho
Enlighten should definitely be suited for the task of changing environment lights at runtime, but have to work with its workflow and be tweaking its settings in that case
(Please condense messages into longer paragraphs also)
sorry my brain is slow and often i feel the need to get my message out quickly, no clue why
where are its settings?
Iirc it's the "realtime lightmaps" tab of Lighting window
https://docs.unity3d.com/Manual/realtime-gi-using-enlighten.html
Here's the docs, may be helpful to look up tutorials also
But note that you might not need this and I'm not totally sure what the advantages are in this kind of situation when you're only trying to change the probes
I recommend you choose to disable it for now, or to work with it and figure out how that changes things
"you're only trying to change the probes"
Are the ambient lighting things controlled by probes?
Yes, as I mentioned the environmental lighting settings generate an SH/ambient probe, as well as a cubemap/reflection probe
(Or rather that's what DynamicGI.UpdateEnvironment does so I assume changing the settings must be doing something similar)
These are then used by lit shaders to render the lighting on meshes
I see
If you schedule updates in incremements more frequent than Unity can perform the readback, Unity silently ignores the request.
If the current system does not support asynchronous readbacks, environment cubemap readback stalls the current thread, and Unity reads and processes each face of the cubemap one by one.
If changing the values also regenerates the dynamic GI environment, it probably follows these rules likewise
Which is a potential explanation for the delay
Interesting, but why does my cube table update instantly then? Thats interesting
I think that "shouldn't be possible"
But it's hard to say
It's a clue of some kind at least
Why is the door so dark and how can i fix this?
looks like no indirect lighting
maybe
@deft fiber is it normal that i have 24 RT lightmaps
"RT"?
Realtime?
yes
I don't recall how many lightmaps Enlighten produces normally
I recommend doing some tests scenes with it to get a grasp of the ins and outs
If they're dynamic and they're supposed to be static, that would explain it
If they are static, they might not have valid lightmap UVs
If they are dynamic and meant to be dynamic, you need reflection and ambient probes to light dynamic objects with baked lighting
Hey, I have a problem with the unity lighting
Okay thanks
on the scene editor, the lighting is normal, but in the build, it becomes dull and darker
scene editor:
that is the build editor
Generate lighting from Lighting window with realtime and baked lightmapping disabled (unless you are using them) and with auto-generate disabled as well
ok this is weird, only my main scene is having realtime lightmaps. On my test scene with realtime global illumination on, it does not work
whoops I meant there are no lightmaps
not it does not work
I want to create a placeholder for a night time festival and want to put something on this capsule and not sure what light options there are?
Some examples
I tried some method of creating a lantern but the main issue is the scene itself feels way too dark. I can try placing some directional light. I am going for a "festival at night" sort of scene.
The building placeholders are barely visible besides just the shape.
in the video you sent it looks like there is extra lighting on the buildings
but also you can increase the range
@deft fiber I think it might just be recalculation times, looking at the lighting settings while the game is running, it updates the color displays when the trees update
not sure if there is a solution though
man this is pain
You need to use a directional light for sure for brightening your scene a bit, you will also need the bloom post process effect to get that nice extra glow effect on your camera
Hello there, I've some lights that are going through the seams of my mesh. After few researches, a solution was modifying the bias of the light could be a solution (If you have another one, i'll take it ! :d), it helps a bit but still have some weird light where I shouldn't have... Also, my shadow are modified when I'm rotating my camera. Did I miss something ? I am currently on the 2021.3 version ! Thanks in advance :)
@arctic isle I forgot to ask something yesterday during the live session =]
Right now we have 4 types of lights (directional, point, spot, area), area light is baked only, it'll be really helpful if you guys make it realtime, I know calculating shadows for area light isn't as simple as point/spot/directional, but it'll enable us to create so many things, like neon lights over a shop's logo, or long strip lights...
In BiRP and URP the shadow casting, shadow filtering and shader specularity all take shortcuts and use approximations that fundamentally don't support area lights, as far as I understand
Although it'd be nice, all three would have to be rewritten or expanded heavily to make it possible so don't hold your breath for it
You still have the option to let baked area lights illuminate dynamic meshes via reflection and light probes
And you've also got HDRP which does support them in realtime thanks to its more complex lighting
Oh yeah, I plan on trying to make it myself as I need it for a short term project, it'll just be awesome if Unity added real-time support to Area light someday, I don't know about HDRP, I mainly use URP
That's right Spazi, thank you! It's unlikely we'll add it in BiRP so it will depend on when URP will completely detaches itself from built-in for this to happen. It's not going to be soon though as we have a lot of other things cooking. As Spazi mentioned, you can "fake" the indirect lighting somewhat with reflections and light probes, but you'll have to work around the limitations of the engine.
It's a double-edged sword having such wide platform reach with Unity as we need to make sure we can support all of them, which is why the render pipelines help segregate the target specs for features like this.
Yeah, I'm aware the Built-in RP will be deprecated at some point, I've been using URP since the LWRP rebrand. Thankfully we have SRP so we can add functionality ourselves so I'll definitely give it a try
@deft fiber AHA i figured out the issue, each lightmap was one terrain, so when i deleted my extraneous terrains it fixed the slow updates. Its still not perfect but with my slow time cycle it is MUCH less noticable
Lightmap meaning Enlighten lightmap?
realtime lightmaps tab
NOTHING else adds a lightmap
just the terrains
its weird but
meh
That is Enlighten, so if you disable Enlighten entirely the scene lighting should update globally rather than per-object
yeah thats what i thought
but turning off enlighten
makes everything slow
maybe now that i removed the terrains
"Everything"?
The trees updating
I would presume ambient lighting without Enlighten is a global variable all lit shaders refer, and that it shouldn't be possible that they don't update in sync, even if they update at a delay
But I think it may be pointless for me to repeat the same speculation before I have a chance to prod at it
Is there a way to put a directional light in the scene for only part of the scene? The directional light seems to illuminate the entire world. I am trying to get something like it for only a rectangular section.
Area light afaik
Area light comes out to look like this:
Directional looks like this: (Will light up everything)
Am hoping to have directional only in a small section
area is baked only so you won't see any effect in the editor until you bake
(turn off "Show Halo" by the way to get rid of that orb look
Is there a way to bake in editor?
In gameplay the area light is still not showing anything
Yes, Window > Rendering > Lighting then press "Generate Lighting"
However-- this requires some extra setup which I assume you haven't done so I'd say maybe use a spotlight and trim it with some cubes / a custom mesh / a cookie to mask the light if you don't want to get into the weeds of baking lighting
Yes, that's expected
Am trying to replicate something like this. I realize the lanterns are not lighting the scene, they are just glowing so that would just be emissives.
I guess I can use spotlights. I am new to lighting and not sure of styles possible
If you want to get as close to this as possible I would advise that you look into baked lighting as it will provide the best results.
Why does the light go through objects?
I plan on trying to make it so the light only renders on the area with assets for "Level" this may require new terrain or spotlight for terrain.
Although I may completely remove terrain. I found "Culling Mask" lets me do some stuff.
Not sure what lighting would be used for these? I imagine the first scene in the game to show the lights of the festival lanterns turning on as the buildings get drawn in; as if the world is being drawn in detail as you enter it. One method would be Culling Mask for each building perhaps. So "Building 1" appears, then "Building 2".
I am not the best with complex. Am looking for simple things to drop in that I may have overlooked. I have Spotlights, Emissives, and Directional Light (most likely with a lot of Culling Mask).
What you're asking for is pretty complex
Baking is the best tool for area lights and emissive materials, but that results in static lights with static geometry
You can get a dynamic fading effect with dynamic point lights but then you'll probably need to work to optimize their number and ranges
HDRP on the other hand supports many types of dynamic lights in great numbers, but is heavier and more complicated to work with
Most of lighting knowledge is knowing the tools and how to navigate around their limitations
What about use of just emissive and spotlight and tons of Culling Mask? Is that maybe work?
How to do a scene where as the player enters a trigger, an area lights up in real time?
(It should probably just be a trigger that spawns the light game object.)
I am just wondering if there are other options I am not aware of that do not require the rendering window or more complex systems.
What are we thinking about the lighting now?
lookin a little better, still lots of random light in the room
I'm assuming those are ceiling lights on the top left right?
are they on or off?
They are on, I'm probably going to put an emmissive material so it shows light coming from it
I would make them much stronger if they are meant to be on
but honestly if we step back and be less pedantic, the lighting is still plenty passable
I still need to put a metallic texture on the lights but Iβm trying to get it as natural as possible since this will be frontpage of my website as a portfolio
It will represent me so naturally looking for quality
What would be the prefered way, or multiple ways, to prevent an object from receiving any light (and be completely dark)?
Cast shadows off?
That will just prevent it from casting shadows, but not from receiving lights
In my case it becomes brighter doing that
Material with unlit material and black color
But if you need it to be a part of shadow calculations it might be good enough to use a lit material with black color, zero smoothness and full metallic
Thanks will try both, if I don't need it to be part of calculation, could it still be darker if it was?
Either ways will mostly likely see by testing it
Generally nothing can be darker than an unlit black material, unless you render it on top of everything separately
A lit dark material is useful for also casting shadows, but there could be some ways it might reflect some light
Is there a way to make the back of quads also block lights, I guess it would make more sense to use another quad or a plane rather in that case?
That's what I mean by lit material casting shadows
If you want the unlit material and shadows, you can also duplicate the mesh gameobject in the hierarchy and set it to "shadows only"
The shadows only mesh does need a lit material, but it doesn't matter what kind since the surface won't be rendered anyway
im kinda stuck with my lighting. trying to go through that lightmapping troubleshooting guide but I cant figure out whats causing this
this is before i bake. if i keep it like this it doesnt look too good and the light can go through some walls at the top/bottom. ive even tried making the walls go higher than the ceiling and lower than the floor. with shadow maps, I gotta put it to "on enable" because on every frame i get like 20 fps atm
this is ideally what i want. Just with a bit better performance and the shadows to look a bit better (because in some areas it doesnt look too good)
but when i BAKE it I get this and I cant figure out how to fix it
im using hdrp and my skybox is on none. every light I have is a point with a mixed mode
incorrect lightmap UVs
or could also be that you haven't marked the correct amount of objects as static
i have marked the whole map as static apart from 2 small doors
then its likely your lightmap UVs
thanks for the help
you can enable lightmap UV generation on your meshes
which can be found in the mesh import settings when you select a mesh in the project view
Does anyone know how I can have ambient lighting affect my terrains? There is realtime lightmaps created for each of my terrains, not sure if thats affecting how ambient lighting is being applied
<@&502884371011731486> @timber lichen
Any of you lighting geniuses know why this is happening with point & spot lights?
moving around/moving the camera causes them to flicker on and off
im not sure if this is the case but have you checked their importance mode?
yeah, putting them on important sadly does not seem to fix it π¦
ah well that's not dandy, try resetting the lights. Maybe they just got bugged?
idk man I'm here fighting with HDRP so I'm not in the greatest of moods hehπ
ahh that's fair man, thanks for trying. I'm trying to bake the lightmap now but that is going to take 3 hours apparently? Does it usually take that long?
Depends on your hardware, map size and quality. It looks like a big scene but you can toy around with samples/resolution and bring it down a good amount.
having some trouble with lighting atm and its really bugging me. This is what I'm trying to get atm but this is realtime on "every frame" update mode for shadows and of course it gives a low performance
if i go to on demand or on enable update then the light will bleedthrough
which render pipeline are you using?
but if I bake everything the this happens and it gets like this. Cant see it in the screenshot but at the bottom of the wall the light comes under and UP the wall and the ceiling tiles are different colors
is each of the ceiling tiles an individual mesh?
Are you using just lightmaps? What are your lighting settings?
ceiling is all one thing
it looks like it has submeshes
URP
you can increase the max pixel light count in your render pipeline asset
so far ive just baked lighting. im using point lights for all the lights that are on. skybox is off
okay
that fixed it with some of the sources but not all of them unfortunately
Do u have a bunch of point lights?
Theres a max limit of lights u can have i think
meant to reply π
yeah I do have a lot of point lights aha - woudld th ere be a way to prioritize the closest ones to the camera?
where are these settings? sorry
you could also try not to have that many point lights π
here @boreal iris
nvm, found those settings - I don't have either on
unfortunately they're somewhat necessary for the vibe I'm going for. I guess I could have it so they are disasbled if they aren't in <range> from the player, but I'd prefer if there were a nicer solution than that
it'd be nice at the very least if there was a way to have it so that it prioritized the closer ones, rather than at random or however it does it now
hmm maybe you should set them back to Auto prioritization
since you increased the light count-- that way you won't have any manual overrides
that's how I have them
This one looks like it's turned off (on purpose I assume)
yeah that one is off on purpse, my bad - but assume it wasn't as none of the others are, they are all setup like that this one is just turned off, chose a bad one to screenshot π
hmmm... not sure what URP-specific magic is going on here then
ok super interesting development that might provide insight - recording now
the light flickering seems to only happen on the terrain - I placed some random cube below it & it looks like the light is working fine on the cube, but flickering onthe terrain
@arctic isle meant to ping π
Even if you bake lights, all mixed and realtime lights are subject to the light limit per mesh
Since terrains are big singular meshes, you can't have more than the max 8 lights per terrain in forward rendering path
ahh that makes sense. Is there a way to have it so that only the closest 8 are active on one mesh then?
Basically what I'm trying to do is set up a forest with glowing mushrooms in it
they are sparse, but there will be ~100 per terrain
Not that I know of
ah so what I have described is impossible in your mind?
Perhaps I can shrink the terrain
Usually you would have environments in smaller chunks, but for some reason Terrain doesn't do that automatically (or at all)
Not totally impossible
Baked lights are not limited per mesh, but will be entirely static and limited by lightmap resolution
Instead of forward rendering path, you could consider deferred or forward+ rendering paths
Instead of lights, particles can also be used for a "glow" effect to avoid the limit
interesting. I know nothing of forward or deferred rendering paths, I will have to do some googling
thanks for the ideas
Forward is the default, in which each mesh is rendered again for each light affecting it, hence the cost of lights and the limit
In deferred rendering path lights are rendered only for each pixel on screen affected by them, which makes shadowless lights incredibly cheap
There's a lot of render pipeline specific drawbacks though, namely no hardware AA and no deferred rendering for transparent materials
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@12.1/manual/rendering/deferred-rendering-path.html more about that here
Forward+ is a brand new thing which as I understand works as the old forward but slices the screen to tiles, so the light limit is per mesh per tile
It's basically the best of both worlds, but still new and may act unpredictably so some things like shaders with custom lighting may bug out
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@14.0/manual/rendering/forward-plus-rendering-path.html
right that's interesting. It sounds like deferred would work for the point lights, but not great for the overall directional "sun" light. Could I choose to have the point lights be deferred but keep the main light pipeline as forward?
The choice affects all lights
Deferred looks decent - but I can't help but notice forward+ isn't there for me. I am on unity 2021.3.18f1. Is that a more recent thing?
It was added in 2022.2, URP 14, so it may not be as preferable to use in production as the LTS editor
oh gotcha - is that release stable/easy to upgrade to? When I started working on this a couple months ago, the website mentioned that this version is the most stable release
I wouldn't give any guarantees since it's not an LTS version like 2021.3. but if you've got version control or back-ups then it's probably not a big risk
I recall hearing that 2022.3. LTS might be coming out soon so that at least should be good to upgrade to
Yeah I'm using github for everything so conceivably I could but I may as well just wait - thanks for the tips!
Deferred seems like a good quickfix for now anyway
my lighting is almost done to how i need it but I've just got these few problems. Any thoughts?
samples are 32, 512, 1 and bounces are 6 min, 10 max now which fixed LOTS of areas but its just these that are left all over the map. After baking some walls are just black, some of the ceiling tiles are a different color or arent meant to be lit up like the second screenshot etc.
did you do the lightmap UV fix I proposed?
yep
yeah
i got this on the material for the ceiling and point lights
show us what your scene looks like in the baked lightmap view
with the lightmap resolution checkerboarding enabled
okay
like this?
not sure why that far wall there hasnt got anything wth
spots like this light here on the left is lit up by a light but it shouldnt be. And also at the bottom of the walls as you see are getting lit up.
those ceiling UVs are completely messed up
should not look like that
you can see how the cherkboard pattern is not consistent with the walls or even the floor
You'd have to UV unwrap the mesh in your modelling program
Okay
For the noisy areas you should increase the indirect samples and the noise should go away
next step from 512 is 1024
This is for the first screenshot right?
(in recent versions we're more explicit that samples are only in powers of 2)
yes
Nice okay thanks
Since you have few lights to light this entire area, you need many bounces and indirect samples to have the light reach the farther areas. If you turn off filtering temporarily you'll be able to see the exact samples taken.
In fact, to get a better image I'd switch the Filtering to Advanced and choose OpenImageDenoise for indirect
Hmm I think I was gonna try that until it said something about it not being supported or something. Will have to recheck in the morning but I'll run through everything and post some results. Thanks again for your help! π
guys how can i disable all shadows on my scene
i selected no shadows but it didnt works
I believe that's not the cause of shadows, but just certain areas being differently lit due to you having a directional light, if you delete the light and instead use environment light from the lighting settings everything will be equally lit
thanks it workss :)))
Lit materials calculate light and shadow on materials based on lighting information
If you want none of that, you can use unlit shaders for the materials
ok, how should I go about making this look more realistic? I think that the light shouldnt be so sharply blocked by the hill, but I cant get my terrain to be affected my ambient lighting, and im not even sure if that would look good
Is it even worth baking if the only static object in a massive scene is the terrain?
Could use a second light with a much much lower setting than the main light.
Are you using a directional light?
yep
I dont know the answer to your question, but using a second dirrxtional light facing the opposite direction at 1/10 the overall scene would light the hill enough to make it believable.
Is your terrain static?
yep
what about other hills at other angles
i dont just want to add 253485 directional lights
Two-three should get you the desired effect, once you bake the lighting it won't affect performance.