so if I have a realtime time, there is only direct lighting from the light source to the objects.
I can only get indirect lighting if I bake the lighting, right?
but shouldnt baked lighting also capture direct lighting as well? why is it that when I move my lightsource after baking, the light still affects the brightness of the objects?
#archived-lighting
1 messages ยท Page 8 of 1
Maybe you use mixed lighting?
yes
ok i see, fixed ๐
but now it's no longer shiny..
i dont get reflections?
- realtime only affects direct lighting on objects, so your correct
- you are also correct in that you can only get indirect/bounced lighting if you bake lighting (however if you are lucky, depending on what render pipeline you are using unity has a system called "Enlighten" which allows you to get realtime indirect bounce lighting. though not as high quality as pure baking)
- bake lighting does infact capture direct lighting as well (depending on how you have it setup, for instance if all of your lights are set to "Baked" then it will do direct lighting, but if its set to realtime it won't be included, but if its set to mixed then it will only compute the bounced lighting from that light source, and the direct lighting will be handled by the realtime light)
- you've run into a core problem of lightmaps in that making any changes to baked lights, the results will stay the exact same unless you REBAKE the lighting again. inherently with baked lighting its all about basically computing the lighting and saving it to a texture to save on a ton of performance. If your lighting is going to stay the same in your game/level, why bother recalculating the light every frame with realtime when you can save on performance and bake it into a texture with higher quality results ๐
this is also another problem with the current built in stuff that unity has when it comes to purely baking your lighting. is that you will lose out on some of that specular highlights and shine that you get easily with realtime lighting. There are ways to bring it back of course even if your lights are fully baked
tldr; baked lighting is all about saving performance, and usually is much higher quality than realtime lighting, but it does not change unless you rebake
thank you for your indepth answer! it cleared up a lot of my misconceptions ๐
would you be able to tell me how I can get back my specular highlights while also using fully baked lighting? right now I have it set to mixed: indirect baked + realtime for the specular.
i've been trying for a week to get my Unity scene to match my Blender Cycles version, but it's so difficult. Blender just looks so good out of the box, I'm not sure what I'm doing wrong in Unity
well I can tell you right off the bat the way in which both blender and unity render is VERY different
espeically with blender cycles, cycles it a proper physically based raytracerd renderer its very easy to make things look good because it models how light actually works IRL
but its WAY too slow for games, so unity and namely other game engines employ a "realtime renderer" that is essentially to put it plainly, just a bunch of hacks and tricks to emulate how say "blender cycles" works but it does it in a SUPER fast way... the problem with that is inherently with what I said regarding it being a bunch of hacks and tricks so it doesn't behave and do things how you'd expect
you get me? @winged tangle
as for getting back those specular highlights I'll let you know in a bit, in the middle of something but i'll get back to you
i understand. I kind of meant it in the way of unity's baked lighting though. like unity's baked lighting also doesnt seem as good as Blender's
I've tried both Unity Lightmapper and Bakery addon, both just fall short of Blender Cycles. I'm sure there must be something I am missing because Unity is able to pull off those incredible realtime HDRP demos
would be easier to see if we had visuals on what your getting, and what your trying to match
because there is a plethora of reasons why what your getting may not be matching the level of quality you'd expect
so seeing what results your getting, and what your trying to match would help narrow things down
ok, ill set it up real quick ๐
i think Unity might have messed up my UVs after I tried using auto-lightmap uv generation:
but there is Cycles vs Unity HDRP baked
cycles looks a lot smoother
you have a pretty large point light in the cycles scene contributing to very soft shadows, and in the unity scene you have harsh shadows for the point light
there is an option to get soft shadows in the unity bake
ok i will look for that now
should be a field in the unity baked light settings for setting the shadow angle
or if it isn't there, probably a field for where you can set the size of the point light radius for shadow softness
A lot of lighting is dependent on view direction, that's something you can't represent with baking which is why specularity is difficult at best
Unlike ray-tracing, baking is also limited by the resolution of asset you bake the lighting to
Despite that I'm used to seeing better shadows when baking than ones in your example
maybe it's my UV lightmaps messed up. i had good uv unwraps, then checked auto lightmaps to compare. maybe it overwrote the lightmaps. im gonna try URP and see if i can get a soft shadow
Baking is the same across render pipelines
URP has only somewhat better realtime shadow filtering than BiRP
You'll need HDRP to get true light diameter and shadow filtering
The only significant error I see in the picture are the wobbly soft shadows
Assuming they're baked in there probably isn't enough samples
iirc it's "diameter" for punctual lights and "size" for directional lights
"radius" for punctual lights, "angular diameter" for directional and "size" for area lights
ohh ok
i didnt see that! i was messing with the point light range thinking it was same as radius
thank you
Range is just for limiting how far it can reach
Not a physically accurate variable but important for performance or artistic reasons
The progressive lightmapper respects HDRP light source size variables when baking, but since other render pipelines don't have that I'm not sure how that can be controlled
how do i add 2 light flares to a light
Hello, I am having a spot of trouble with using BakeryGPU, I have over 100 Point Lights and I am not sure if I should bake without the scripts attached to the light or should I bake without the scripts at all.
You need to attach the Bakery Point Light script to the Unity Point Light. Alternatively, you can also just add in a Bakery Point Light object from the Bakery menu
But the Bakery Point Light added from the Bakery Menu does not have a realtime light preview or anything like that. So it's kind of guess and check if you do it that way
i fell into problem
after baking
before baking
does anyone know about the issue?
im using legacy diffuse shader
Can you describe the specific problem
If your light bulb is GI static and casts shadows and the light source is inside of it, no light can escape
Light source could be inside the lampshade as well
cast shadows off on the bulb
but yeah , GI static
turned it off...lets see the result
still doesnt work
If you move the light to the middle of the room away from all geometry, then bake, do you see any improvement
Then it confirms you are solving the correct issue which is good ^^
this time
i took the light middle of the room ...and outside the bulb
lets see if it works or not
Not just overlapping but geometry extremely close to lights can be problematic for the baker
That's why in that situation I would instead use a spot light just a shy distance below the light fixture, and a GI static emissive material for the light bulb for illuminating the shade
in the picture
all mesh are combined
into a single mesh
huff..thanks a lot
its working correctly now
actually you are right
light should be kept far from geometry
why is my shadow so pixelated?
Large spot angle, large distance from the light source and small relative size of shadow casting object
Large spot angle is generally the hardest thing for shadow casting
I'm having and issue where only half of my terrain is being lit up? I'm using the same three textures throughout my terrain. Weird thing is its only the ground not lighting up. All the props are effected by light but only half the ground? using URP any one have any idea?
Looks like pixel light limits per object
but what is the best way to make a room bright?
There's no best way, as it depends on the scene and what tools you can use
A point light fares better than a spot light specifically for shadow casting in this particular case
How would i increase that? and thanks for helping us both at the same time lol
You can increase it in quality settings but only up to 8
It's a complex issue
In forward rendering path each mesh is rendered again for each light, which is why there's a limit
Games usually deal with this by partitioning meshes into smaller slices and avoiding bundled up lights, but it's not easy to do for a Terrain asset
Baked/mixed lights work fine to solve it, but it's a whole workflow with specific costs and limitations
Deferred rendering path is an option, but that also comes with costs and limitations
Newest versions of URP have forward+ rendering path that solves the problem with effectively no drawbacks by slicing the screen into tiles instead, but it may be undercooked yet
ah alright thank you!
Why does my scene look fine from the scene view, but horrible when put through a camera and then a render texture?
Too much color banding.
It looks fine from the game view too, actually. The camera previews look fine.
Well, I found a solution embarrassingly quickly after asking, I changed the color format to 16 bits and now it looks fine.
It is weird, though. I thought monitors only display 8 bits so I don't get why putting it to 16 bits would make it better.
Hey im trying to use bakery and its just stuck in preparing for a long time and doesnt change
https://gyazo.com/858e1c051df469f7e5ac5b0d79d3eed7
https://gyazo.com/ac381531937703e7426b23e917aee56c
anyone knows what could've caused this?
Hey does anyone knows of to fix this kind of issue (the non light square boxes)
:
Check if you have too many lights affecting the mesh at once
URP's default limit is 4
Is there a way to check that that doesnt involve manually going to each light and seeing if it shines on the Mesh?
You could multi-select the lights and the mesh in hierarchy to have the mesh and light ranges visualized together to see how close they get
muchas gracais
You can also reduce or add the number of light sources in that area to see if the problem gets better or worse, to confirm that it's a light limit problem
If it is, refer to these notes about how to solve it
<#archived-lighting message>
@deft fiber @night shell thank you both!
I finally got unity to look almost like blender cycles ๐
unfortunately i had to fake it by using one baked light for GI, and a cloned light but in realtime for the specularity. looks good tho!
how do I increase the max amount to 8? I confirmed that that's the issue but I only have 7 lights in my scene anyways
either I'm blind or I don't know what it's called
also dont see anything in the render pipeline
oh yep thanks
ouch there goes my aesthetic
seemed to increase the brightness if everything
Aesthetic? The only change should be that now more lights can affect a surface
Everything is "dark" but changing it seemed to almost triple everything's intensity
just did /3 and it looks the same again
Can you show a picture of how it changed?
well this is what it looked like before
and then this was after
Mixing baked and realtime lights is perfectly fine, and the light type "mixed" lets you do that according to specific shadowmasking rules so you don't get diffuse lighting rendered multiple times
I've ever seen light limit only add or remove existing lights, so something weird is up unless you have some very strong lights that have been culled up until now
Hey guys, for my school project within unity. My walls appear like this They are planes with two sided shadows enabled. Looks like light is passing through when directional lighting is enabled. Also I get weird light pixles everywhere. I've used the same workflow for unreal for several years. But I'm new to unity. Could anyone help me out? ๐
Shadow casting in sharp corners and details is rarely fully leak-free, even with two-sided shadow casting
It's better to pad the walls with shadows-only blocks or planes from the outside
Thanks, appreciate the answer. So a fix could be that I just give the walls some depth with a flat surface backwall for shadows.
That's right
Note that if the external plane is too close to the internal wall, it might let some light through, and the sharp corners of the external wall are also seen as gaps by the shadow caster meaning at specific light angles where two interior and exterior corners line up there can still be leakage
Exterior wall too close
proper padding
Two-sided walls only, for comparison
that's super helpful thanks!
Where does the global illumination coming from
I disabled them
even when I remove the metallic effect from materials, it is still not pitch black
Try Environment Lighting Source: color with a black color instead of skybox
You may need to set Environment Reflections Intensity Multiplier to 0 as well
why is it like this when i play my game?
I guess you did something to make it "like this"
I did
ah this did the job
tyy
what is the best way to diminize that flare at the wall
how i can blend the light maps to get rid of seams?
pretty spectacular
in what way?
Just the way you have arranged the lights
What wrong with them
way too dark for what it should be
the fact that its also just realtime lighting doesn't help it neither
I would expect some skylighting to come in and illuminate the bathroom through the window
and those spotlights to be bright but also providing bounce light and making the bathroom look pretty luminous (since its realtime there is zero bounce)
the reflections also are wrong and I can tell are just sampling reflections from the sky only, not the enviorment
@timber lichen Enable shadows to each light
I pretty much fix that, btw it's a big map for mobile, i need to keep size small, I add some extra indirect samples and disable the Direct filter, denoiser and indirect filter
Can you give me the model? i want to try bake the light
well its an entire cabin...
switch the mode to realtime, enable shadows on the realtime light, then switch back to baked
can you show the baked lightmap asset preview from here?
I'm curious to see what kind of lightmap layout those resolution and padding settings generate in a very modular scene like yours
Hello guys, I'm working on a low poly game for mobile but I'm having some problems with the baking phase.
The shadows results very pixelated and blocking on certaing areas, and I can't figure out how to solve this problem.
Can anyone give me some tips to fix those issues? I set everything on static and watched multiple documentation about some lightmap issues but didn't got the right solution for my problem. I'm using the URP in Unity version 2019.4.40f1
Could someone tell me how to fix the shadow cascades reversing the shadows at their intersection? I've tried googling but can't seem to find similar cases though I am certain someone else must have had the same issue.
This only happens in the build, not the editor
I only have one quality setting so its not a discrepancy between editor quality setting and build quality setting
Same area in the editor
Does anyone know how can I fix this issue
whats the issue? the bright lighting?
just simply reduce the brightness of the light
ya in the middle
just reduce the brightness of the lights, there is too much light in that area
you could also get around it by using tonemapping
and tonemapping could help keep brightness values within an acceptable range so it doesn't blow out so quickly
hmm?
those are my settings
your settings are fine, its the lights that you have in the scene
Hello @turbid eagle spot lights are not working properly. please give me any solutions.....
are you using forward or deffered rendering?
I assume you mean the missing geometry in the reflection? You weren't specific with "this".
Is that model marked as Static?
Hey, I am new with unity. How to check this?
I didn't get render path option in unity 19 version.
well I can tell that your using URP, my geuss as to why your spot lights are not working is probably because your in forward rendering by default, and the problem with forward rendering is that you can only have a certain amount of realtime lights per object
ya sorry well you can see that the whole class is reflection into the window
you'll find this on the URP settings asset in your project
You mean, Forward render means HDRP ?
nope
HDRP is a completely different rendering pipeline, you are currently on the URP rendering pipeline
the URP pipeline within it (depending on what version of unity/URP you currently have) has options for deffered or forward rendering
I know about this
Already I tried this URP setting... please check it
oh you already increased it, then yeah you've probably hit the limit of realtime lights]
per object
how to fix it?
well either 1. you can split up your meshes into different objects, but that can be a pain
or the classic way 2. is use baked lighting
easiest way to fix I'd say is using baked lighting
but that also depends on your project and if you require realtime lighting
I tried backed lighting. But after backed, black spots are coming like this
because of improper lightmap UVs
those are usually easy to fix, within unity for your model import settings you can enable lightmap UV generation
make sure its baked
not mixed
mixed still has a realtime component to the lighting
and therefore is still tied to that per object light limit
So are you saying the missing reflections aren't the problem? You will have to be more specific to what the issue is then.
^^^
not to dogpile but its tough to figure out what you are seeing as an issue in that example, if you mean that you don't like the reflections on the glass reflecting the classroom you can either get rid of the reflection probe, or you can make it so the glass meshes on those windows are sampling reflections just from the sky only
if your meaning that you don't like the reflection because it doesn't look right then enable box projection on the reflection probe and position it best to fit the bounds of the room
ya the reflection is just too much
too much as in too bright?
the reflection probe has an intensity field on it for reducing the brightness of the reflection, but you can also reduce it in a way by making the glass more transparent
After baking, look like this.
Still some spotlight is not working after the baking
can you turn on the gizmos so I can see where you've placed your lights?
and also are you sure that all of the lights are infact set to baked?
You can check the placements of the lights.
this one
Yes
Baked, not mixed/realtime
just double checking
and if they are, the next thing is to switch your scene to baked lightmap view, and see if those lights are showing up
if your lights are all infact set to baked, and the light is not showing up in the baked lightmap view then its possible that some of the lights that you placed are inside geometry and are being occluded
this isn't really an easy thing to spot especially if you stuck with realtime lighting up to this point, since realtime lighting is imperfect and leaks through stuff all the time so make sure that all of your lights are not inside geometry
Which lighting mode should be used during baking?
I recomend subtractive
its the cheapest
for your lightmapping settings also
to make it go faster
you can drop your sample counts quite a bit
okk... Will check
i.e.
Direct Samples (you had 32) - you can drop it to 16 but 32 is fine
Indirect Samples (you had 512) - drop to 64 (or 32 for faster)
Enviorment Samples (you had 256) - drop to 64 (or 32 for faster)
when you dial in your lighting you can always bump up those numbers for better quality
Hey, Still working. Check it
How is it?
looks to be working
But it is possible to make a spot light work without baking?
yes, by splitting up the amount of objects that are intersecting with the light
remember, the limit is the amount of lights PER object
but I would honestly avoid that, as the reason that limit is put into place is that having that amount of realtime lights can be really really expensive
ohhh ok
Also post processing is not working
you have to enable it on your camera in the scene
and make sure that the volume trigger for it is also set to post processing layer
Yes, I did
Here is the camera setting
yes. It's on post processing layer
why is your camera game object layer set to post process?
also your volume mask is still set to default
not to the post process layer
still not working
hmm not sure what it could be then
I would ask in the URP #archived-urp thread
since you are using URP
@night shell Thank you so much for helping me ๐
Hello guys
Do you think these cones need lightmaps ?
they are much brighter in reality and the light is not hitting them
so im just wondering since im not sure, I am new to lighting in Unity
the problem there looks to be more of a reflection issue than a lighting issue
but I would suggest looking into lightprobes @timber lichen
My guy over here looks fully white from the secondary camera. In the bottom left, you can see him as fully black with no shading (intended). Why is it showing up weirdly here, through the render texture?
Camera
Render texture (which i just noticed is showing the correct image)
UI
I messed with the settings of the rt for a while and eventually found this. Now it works. Not sure why.
Hello! Deferred rendering is causing light to bleed through surfaces it should not, but forward rendering does not have this issue. Is there a way to force forward rendering on shaders/materials/mesh renderers? (I cannot use custom scripts)
^Deferred (light bleeds through)
^Forward (How I want it to look)
im making a 2d game where you have to navigate in the dark with a torch, how do i make my scene really dark?
i tried making the ambient colour dark and reducing the intensity multiplier but it doesnt seem to work
im mainly using 2d sprites in my scene
How do i make textured objects be effected by light?
This depends if you're working in 2D or 3D and what shaders your materials are using
Normally you don't need to "do" anything
Even in a blank project you can just make a new material, assign a texture, throw it on a mesh and it'll be affected by lights in the scene
3D and when i add it the texture is fully light no matter how little or how much light i shine on it
This really doesn't help me help you
The texture is not effected by light
Okay, but you haven't shown the materials or shaders or lights or scene or render pipeline or any other relevant info
And it sounds like you haven't tried if the lights fail in a blank scene using default assets
how can i make lightining like this
Not sure precisely but to the best of my knowledge that's not "lighting" at all, rather they're projected shadows using decals or shaders with the help of specialized RT cameras
I have a issue with lighting being "darker" in build than in editor. How can I fix this? It's URP
orrrr, just do 4 point/spot lights that cast shadows
looks like a linear/gamma space issue?
How could I fix this?
That's another option but if you've got a whole stadium to light they're going to struggle
true
I would ask in the URP forum I'm not to familiar with URP myself
from the outset it looks like a linear/gamma color space issue
guys how do i make an object being illuminated by itself too? I want to make basically a sun, but since the light is inside it, its model doesn't get illuminated
You'd rather use an emissive material for that
got it thanks
How does the angle weighted normals mode work on the mesh importer? I'm trying to figure out if I can get flat shading on a dynamically generated mesh w/o duplicating the verts
Normals: Calculate with smoothing angle 0 gives you a flat shaded mesh, but it still duplicates verts as you'd expect
You can use a shader such as this
https://hextantstudios.com/unity-flat-low-poly-shader/
to render smooth shaded meshes with flat normals
Does anyone know what's wrong with my lighting? It creates weird, pixelated shadows despite nothing actually casting the shadows. Looks almost like an artifact.
yeah hmmm
Can't see them on the screenshot but description sounds like texel invalidity
https://forum.unity.com/threads/faq-blocky-artifacts-appear-when-i-bake-a-scene-how-can-i-fix-them.951444/
look at the drawer
black spots
quite peculiar
Check UV overlap and texel invalidity in scene window debug views as the first thing
if your using baked lighting then generate lightmap UVs on that mesh
if it isn't then its likely just improper normals on the mesh itself, or improper normal maps
@deft fiber Fantastic, thank you for the help
if i delete everything in this folder manually, and then rebake, will everything work as intended or by deleting stuff, will i jack something up
it will work as intended and rebake those assets
and deleting the top left LightingData.asset file wont cause any issue either?
no
LightingData stores lightprobe and other misc data I believe, but that will be regenerated
wonderful. worst case i can delete changes since im using source control but i wanted to ask before I spent the whole time baking
so i have one more question. Here is my scenes baked lighting with the lights on. The lights then turn off after a tv commercial plays and then they are off for the rest of the game. is there a way that I can have the lights on baked lighting swap out for a lights off baked lighting? I can't do realtime as this is a vr game and oculus is very strict about performance.
yes there is a way, I wouldn't know how to do it because I've never had to do it myself but it shouldn't be hard in theory
you bake a set of lightmaps for when the lights are on, and then bake another set of lightmaps (not overriding the current ones) for when the lights are off. And you simply just swap the lightmap textures whenever you need to
if I drag the lightmap files out of the default folder and then bake again, will it override?
just wanna ask before it bakes for 45 minutes
no
Any good ideas to making places dark with baked lights. Like being able to turn lamps on and off, with baked lights?
Or thats completely impossible
You can bake your scene just using your ambient light, for example a gradient or HDRI sky, to get a dark ambient bake. Then you use real-time lights to add brightness where you need it. When you turn those lights off the ambient/dark bake will remain. Adding light-probes to scene can help too.
Cool. If you use HDRP, try adding the Indirect Lighting Controller as an override to your Volume and play with the settings to adjust the exposure level of the lightmap. It's really handy for tuning the amount of amount of baked light being show.
Does the low poly + reflections looks good?
it looks like the wheels have more detail then the rest of thr car lol
anybody know what's going on here? not even baked or mixed works when I bake the lighting, i checked and everything looks in order, and even with the pixel light count at absurd numbers its still not casting any light whatsoever. restarting did nothing, this is unity 2020.3.35f1 on the built-in render pipeline targeting android
no weird business with layers either cos the directional light in the scene works as expected
turning off the direction light reveals that the light seems to have been getting into the baked lightmap data on the object around it but the bilboard its facing isnt lighting up at all
this is the mesh renderer component for the object
oh huh
i guess the value was so high it just wasnt showing up?
alright problem solved dont worry lmao
What was it?
could be alot of things, either
- your material for the wall is actually green,
- you have green lights in your scene, or it could be a mixture of yellow/blue lights that amount to a green light
- it looks like it could also be green bounce lighting that is actually supposed to be elsewhere in the map and the reason its showing up is because of improper lightmap UVs
I would ask if you could show us how your scene looks in the baked lightmap view
damn I just cleared the baking
Im doing an other one
just realised the wall doesnt have lightmap UV's
rebaking now to see if it fixed the issues
ok I just finished my baking
and still have the same issues
.
thats a singular lightmap
I'm asking to switch your scene mode to the baked lightmap view mode
so it just shows the scene with the lightmaps
yeah so I'm seeing alot of issues, some objects look ok but there are a ton that have issues
worst of all your walls and ceiling are not even baked
one thing I would do before moving forward
on all of your mesh files @timber lichen
enable lightmap UV generation
and make sure that all the objects that you want included in the bake are infact marked static/contribute GI
then bake again
should help fix most of your issues
well I create the lightmaps for the ceilling on maya but I guess that messed up
no, just saying that make sure it is infact checked
for the objects that you do want to be baked with lightmaps
got literally zero clue, I just turned things off and on and rebaked a bunch until it fixed itself
my guess was that the light intensity was so high that it wasnโt showing up
but iโm pretty sure I tried low intensities too
Can someone explain to me what I am not understanding below?
If a mesh's verts are reused across multiple faces, the normals will be smooth (unless mesh is modified by the importer).
Now, say we have a cube, it's possible in a 3D software to have the front face's uvs to basically be from (0, 0) to (1, 1) with top right vertex being (1, 1).
Simultaneously, it is possible for the right face's top left corner/vertex to be something other than (1, 1). It could be anything based on how the mesh is unwrapped.
Now if uvs are per vertex, and the mesh is smooth so (afaik) vertices are reused across faces, how is the above scenario possible?
e.g. top right vertex of front face is (1, 1), how is it possible for the right face's top left vertex to have a different value if they reuse verts?
Ah, it says blender's uvs are per "face vertex", so each face has a definition for its own vertices. I don't think unity has a concept of that, so it's my understanding that unity duplicates the vertices by default(regardless of smooth normals or not) in order to replicate that behaviour.
Unless this is horribly wrong, safe to ignore the above
Hello Guys got a problem why i cant apply ovverride to a prefab??? even in prefab i cant uncheck the checkbox its all gray why?
i know but why is not possible?
It is a prefab generated by unity mesh importer. Right click -> prefab -> unpack completely, then drag it back into your project to create a new one.
not sure, but if I had to geuss its probably due to the fact that you'd have to modify the asset itself which is something that mabye unity avoids doing?
either way, a way around it is to just unpack the model prefab completely, and make a new prefab of it
looks like @brittle geyser beat me too it ๐
its very annoying that all of my trees have recrieved shadows i will use them many so and then 1 by 1 uncheck is time consuming
ill give a try
i cant find this Unpack Completely , or should i do it outside unity?
Take the prefab generated by unity from the project window and drag it into the hierarchy. An instance will appear in your scene which I assume you are familiar with.
In the hierarchy, right click that instance, go to prefab and then unpack completely. This basically says : This precise instance will no longer be considered a prefab.
Then, grab that object, from the hierarchy again, and drag it into your project window to create a new prefab
Project window is where your assets are displayed, hierarchy window is where your scene's content is displayed
Yes i got it i just didnt know about this unpack complettly thank you ๐ both
how to make lightmapping also work on all the LODs?
Afaik the polygons will share vertices if they share all attributes
Otherwise verts will be split
Ah this makes perfect sense, thanks @deft fiber
I was really confused when unity imported a cube with 20 verts
Normals, UVs, vertex groups, vertex colors and tangents are all the same vector data to the format I believe
@night shell sup
looks like in here its texel validity artifacts
which are caused typically by backfaces
switch your scene to Texel Validity view
oh damn
this looks bad
you have alot of backfaces in that area leading to those artifacts it looks like
so to fix it
I would first like to see a screenshot of your scene both in the regular scene view and in the baked lightmap view
You know how I could fix this
yes
but im asking for more information so we see exactly what needs to be done to fix it
can you get a wider view?
again with both modes
from what I can see there, its hard to tell but your ceiling is not lightmapped which can certainly be causing alot of that, but hard to tell since I don't know what other meshes are around
ahhhh I think I see it
your ceiling is not lightmapped which can certainly be causing that, but also most likely you have backfaces around the intersection of the column with the windows
backfaces for the record is basically geometry that is culled from behind
but when you look at those backfaces in the scene view straight on the geometry is seethrough
make sense?
Anybody knows how unity generates lightmap uvs under the hood?
mhh
well
I just fixed the uv
so ima do other bake to see
you could also have unity generate the lightmap UVs for you
I know it was the base UV's that were messed up
well what I'm saying is to have unity generate those lightmap UVs, do a test bake and if those problems don't arise anymore then its just a matter of fixing your lightmap UVs
but in the examples that you just provided
its not a lightmap UV issue
its a mesh backface issue
when lightmapping, when there are rays that hit backfaces they will be terminated because backfaces are usually always culled. Its the "backside" of geometry that you don't render so to speak
thats what the texel validity view also shows
around the column and windows you have backfaces on your geometry that are causing those issues
granted... there is a possibility I am wrong, but to save yourself some time I suggest going through a checklist like so
- let unity generate lightmap UVs for your geometry, then do a bake (if no problems arise and it all looks realtively good and clean then its your lightmap UVs that need fixing)
- if those problems are still there even after having unity generate lightmap UVs then its most likely a mesh backface issue that needs to be solved there. This can either be solved by fixing the normals and plugging any holes in that geometry that would contribute to those artifacts, OR you could in the unity material settings you can enable double sided global illumination
also as a note to help speed up your lightmapping process and testing you can drop the sample counts even more
- Direct Samples = 32
- Indirect Samples = 32
- Enviorment Samples = 32
oh damn that's bad
even in Maya its black
btw it says my UV,s are still overlapping even I fixed it on maya @night shell
what UV channel
normal
how do i check that
no idea I'm not that experienced with UV mapping in maya
oh i tought you meant Unity
well its on channel 0
there's only 1 channel
I tought that Unity creates channel 1 for the light uv's
it does when you generate a lightmap UV
or
if you enable lightmap UV generation
but you can also make your own
and it'll use that
honestly I tend to ignore it since UV overlaps in my experience never really seem to cause any massive issues
unity complains about it alot but when I go through lightmapping on my own projects the results I get are always fine
if the baked lightmap looks good and acceptable that is what matters
Can someone explain to me what this line means :
A good UV set for lightmaps should adhere to the following rules:It should be within the [0,1] x [0,1] UV space.
0,1 x 0,1 specifically - So not (0,0) - (1, 1)?
within the 0..1 space, so they mean that for the max X (horizontal) position should be from 0 to 1. for the max Y (vertical) position it should be from 0 to 1
think of it as a coordinate plane
actually it is a coordinate plane
I think you had the right idea to start with but were thrown off by the wording
@deft fiber Aye
@night shell Appreciate the clarifications, thanks
says who?
my friend
I know I keep pushing it but why not again just have unity generate those lightmap UVs for you and just call it a day
I still get the same issue
not the UV chart
but of how the final scene looks even with the unity generated lightmap UVs
he said lightmaps uv on unity crushes the normal uvs
not sure what he means there but if you still had the same issues even with the unity generated UVs it sounds like its not a UV issue
and from what you showed it looks to be a backfaces issue, which the texel validity screenshot you sent prior also confirms
@deft fiber am I wrong? correct me pls if I am I don't want to accidentally be spewing misinformation
these were his results
I would've given this advice as well
But it doesn't seem Bat is following either step 
In a nutshell let Unity generate lightmaps automatically by enabling it in mesh import settings, instead of fumbling with them manually
And then fix the texel invalidity by making sure there's no exposed backfaces
Normals don't have to be great as long as they're pointing outwards and there's no gaps in geometry
hey guys im really newbie in baked lightning usually i just bake it and it works for me so im cool with it, but now im in HDRP and trying to bake lights give me no results it goes black, it does apply lightmaps to my static objects around it but it doesnt glow at all, does anyone know why could that be?
I would suggest asking in #archived-hdrp
The progressive lightmapper works almost exactly the same way across render pipelines
The problem may be with some other HDRP setting
Either way most baking problems are solved by doing very small and simple test scene bakes, starting with default settings, until you get the process ironed out
i managed to get lightning somewhat going now, but what im having issues now is my ceiling doesnt light up and other parts of scene do, im not sure why is that
could it be because my ceiling is a plane?
should i set it to double sided? or that doesnt matter?
I can't say anything for sure by this description alone, but backfaces should not be exposed to reflected light rays when baking
yeah but setting some other objects to double sided really changed how lightning went so il try doing that before anything else
I'd have to see what "changed how lighting went" looks like actually to give more feedback
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/ There's over twenty potential issues, by symptom, so not much point guessing
bro no chance in the world I am reading that, lol but il keep trying till it works
thanks tho
Though this is a minuscule fraction of the amount of knowledge you need in game dev, it's often enough in this case that you skim the problem titles and example pictures to spot the same issues your scene could be suffering from
If you find the matching problem, then you'd read about the potential causes and fixes
i mean i honestly think its because its planes and not 3d object, i can not see other reason why would something like this occur, so untill i clear my doubts i wont be reading that , but might use it later who knows thanks for informing me there is such guide though
i found the issue
it was due to my material metallic on the ceiling was 1, imagine dropping it to 0.99 alone solved the issue
almost done
Planes are 3D geometry just as much as cubes, quads and spheres
yes but they only block light from one side if not set to double sided in material properties
so they arent much the same in lightning
Meshes with exposed backfaces are a type of non-manifold geometry
Normally realtime lights pass through, but baked light rays become entirely terminated causing texel invalidity
Has anyone hacked a point light to emit shadows instead? Where the pixels are darkened instead, such as using a multiply filter
The editor interface doesn't allow negative colors values, but you can assign them to lights with a script
how can you make the inside of a room darker? but at the same time keep the outside a sunny day?
the interior of the house is underground but it still looks bright..
nvm, Ambient Color does the job
Yes, but it means you can't have ambient lighting inside of the house
Separating ambient lights from different areas is tricky, as realtime lighting doesn't really have a way to know what's indoors and what's outdoors
Precomputed and baked lighting aims to solve that
yeah,but now i have this problem,i wanna have the light to flash from white to red but it makes the walls to look like this,any ideas?
Probably hitting realtime light limit for those meshes so the light is ignored for them
huh,i do have realtime and baked lights,imma test this
is there a way to fix it?
<#archived-lighting message> here's some notes about it
The limit of 8 is specific to URP, but so is forward+ rendering path
thats a whole area i dont know about ๐ฅฒ
this is such a pain
imma just do with what i have
thank you sm for the help ^^
Question: not sure what Unity would refer to this as, but is there a way to create multiple baked indirect lightmaps for the same geometry? Basically just looking to avoid using realtime lighting for lights that don't move but that can be switched on and off independently of one another. Not too familiar with Unity's lighting, sorry.
that is total realism๐ ๐
its not done yet lol
wasn't getting this issue before, but now when I bake my lighting it applies the lightmap completely wrong
basically errors like this all over the scene.
Started happening after I just added more objects to another section of the scene
How can i make my Custom ShaderGraph work with 2d lighting in URP?
Overlapping lightmap UVs, probably because meshes don't have generate lightmap UVs options enabled, and texel invalidity
Went through and enabled it on a load of things
Issue is a lot of its probuilder
Is there a way to fix it for that?
It's just strange, since I never had the issue before. Even with the overlap messages
Loading scene with editor -> Ambient lighting fine
Loading scene with script additively runtime / build / editor -> Ambient lighting stays same as before
New scene IS set to the be the active scene
Tried doing DynamicGI.UpdateEnvironment();
what am I missing?
seems like a Unity bug that has persisted since Unity 5 all the way to Unity 2020 with a wall of questions on the forums and no proper answer
there are NO lightmaps, it's all dynamic objects
light baking Auto Generate is turned OFF
just nothing works...
help please ๐ฅน
I'm now getting a weird issue where sometimes after baking, if I try to go into UV overlap view it runs at like 1 fps
this issue
WOW restarting unity made the lightmap actually map properly
xD
what a strange bug
ProBuilder meshes have a lot of potential issues and weirdness when used for light baking or other such purposes, up until you export them out of it
They're largely procedural meshes with their data controlled by ProBuilder so other features can run into errors when attempting to modify them or utilize their temporary mesh data
I'm having trouble with lighting.. I'm doing it in a 2D project, I've got my Sprite-Lit-Default material on everything, and I've got a URP 2D light asset active, but nothing is going black like it should be
Looking for anything I should double check since this is my first time working with 2D lighting
Hi, are there any common practices for optimising a scene with a wide array of realtime lights? I'm having an issue where my lights/materials show up perfectly in the editor, but loses its material whenever I build for anything, whether that'd be Desktop or WebGL
Im trying to make a snowy forest level for my game, and im having a weird issue where I have a minimap light, and it renders like this in the editor (expected) and I have a script to disable the light for the main camera, in OnPreCull(). This works if I build and run in the editor, however If I build the game and run it from disk, the trees will be lit up by the minimap camera (the ground is still dark).
maybe this is a similar issue to above?
im on 2021.3.9f1 btw
Hey super confused here, the lamps are all the same prefab, im using an emission glow on the bulb and and spot light to give it the light effect on the floor, why are some spotlights working and anothers not?
Don't crosspost please. @toxic eagle
Looks like pixel light limits per object
<#archived-lighting message>
you know when raytracing becomes the norm these problems and questions won't really be a thing anymore ๐
don't really need raytracing to resolve this though
i'm feeling like the ground there consists of multiple objects and i suspect those lights aren't baked
not saying he should switch, but just making an irrelevant note
yeah mb, I'm just musing because I have nothing better to do lmao
but yeah those are for certain realtime lights, and the ground is split up into multiple meshes. so per pixel light limit is definetly the problem there
honestly wish there were a slightly less clunky solution to UV tiling than making multiple materials
because it inevitably leads new users to the mesh tiling issue
like I have several copies of a material with different tiling because I'm using it on planes of varying sizes, but years ago I'd have definitely went "well I guess I should just duplicate the mesh over and over
In the more immediate future this problem should be history when forward+ rendering path becomes the norm
The problem isn't really a lack of technology, but where people's knowledge and the tools available fail to connect
If the exact same question pops up multiple times a week I think that's a sign that the tools are not doing enough to guide users away from that kind of pitfall
Adding a little notification on the light component when it's getting culled which links to a light troubleshooting guide with each option summarized would be a trivial effort
Even if the user figures out what the problem is, the knowledge of all the solutions is completely scattered
Forward+ isn't mentioned in almost any thread because it's a new system
Duplicating planes and creating new material instances for each works but has the elegance of duct tape
A better and more performant solution is to make all geometry as meshes with one material, but a different UV map
On average renderers handle multiple meshes with different UVs better than one type of mesh with many materials
An better and quicker solution is to use a triplanar mapping shader
I mean yes the most performant solution is to just turn your entire level geometry into one mesh with one texture and UV map it lmao
but that's something I have to write a tool for at some point
shouldn't be hard, just finnicky
unless probuilder or something can do this already; I've never actually used it lmao
Not always, but it's one of the viable options
well in my case all the prefabs i have planned out are small enough to where it's definitely the most effective
if you're working in an "open world" scenario, then not so much
This tick here already does that, and it supports occlusion and frustum culling too
hmm
well that's handy, I don't use unity much so I wasn't aware of it
everything where I work is custom lmao
which also leads to an incredible amount of tech debt
Guaranteed payroll for coders 
There's also GPU instancing for rendering a lot of the same thing, and SRP batching with URP/HDRP that's quite magical
honestly we need more programmers just to clean this shit up without losing steam on actual development...but I digress lmao
not sure how Unity handles either of these. i wrote a custom mesh batcher for an internship last summer and it worked but fml directx12 instancing is a PITA
From my perspective that too is just one checkbox
i'm sure they've had a ton of work put into them, but now I want to read the docs because I like to know how things are working under the hood
it's less that I don't trust the tool and more that I feel like a skid if I just use tools other people make without understanding how they work
by skid i mean script kiddie
uncertain how widespread that slang is but I don't wanna get warned for something I didn't intend lmao
also going to repost a question I never got a response to: is there some kind of multi lightmapping tool in Unity already? Asking since each light in these prefabs should be able to be on/off or flicker, and I would like direct shadowing in most cases
I'm not a coder so I'm completely unburdened by worries like that
Though in turn I suffer insisting to not use any art assets from others
I am very inexperienced with how Unity handles lighting
i had to bite the bullet on not using external assets when it comes to textures sadly
and tbh I'll probably have to do it again if/when I add NPCs lmao
using external models/etc. is always awkward because they're often set up differently from how I set things up and how other external models are set up, but that's neither here nor there
additionally: thinking that I want fully baked lighting for hallways/rooms the player isn't in and to just enable/disable realtime lighting accordingly, since typically the player's only view into other rooms will be through doorways and there won't generally be dynamic entities around
so basically I want to store separate lightmaps for baked direct and indirect lighting and have no idea if this is feasible through Unity
I think it is with some jury rigging, but what problem is it to solve
trying to avoid too much realtime lighting, basically
generally you shouldn't over-optimize before something becomes an issue, but imo it's best to at least keep in mind what performance issues you might run into
Hallo! With baked lighting, does the Progressive lightmapper take alpha clip into consideration? Like tree branch and grass cards?
yes
Thanks, I was testing a custom amplify shader with the shadow clip not working for baked lighting. Using Unity's default shaders seems to work tho. Would you have any idea as to what I could be missing? A pass or tag potentially?
Ah okay thanks! The meta pass is included by default so it's curious why it's not working by then.
As a standin for my lack of knowledge it might be better to bake the shadows with a shader that works and then switch it out for the custom shader that I wanted?
I'm trying to implement Terraria-like lightning system. Brightness of whole sprite is the same, but decreases with distance from light source. I'm currently using URP. I've made a few attempts, but none of them was really successful. Can anyone suggest which way I should research? Stick to the materials with custom shaders and change brightness of individual tiles? Second tilemap with "shadows" to cover bright tiles? Play with light cookies? Or there is awesome tool I've overlooked?
Could just be using vertex colors updated on the cpu
You'd start by outlining what your lighting system needs to do
Should it be dynamic per-tile, or per object?
Should solid blocks occlude light or reduce its intensity?
Should multiple lights stack?
Should there be differently colored lights?
What's the largest distance a light source could be visible off screen?
Do tiles or gameobjects often need to evaluate their brightness?
These are pretty complicated systems, mostly due to the sheer number of tiles there are to update
If the light sources don't need to move much, you might be able to get away with looping tiles or vertices in an increasing radius around the light and add brightness to their vertex color, or to just update "light tiles" on another overlapping tilemap
The way terraria does it, I think, is to have another tilemap which runs a naive outline algorithm around every light emitting tile
Most 2D tile games have something like that, usually fancier algorithms so lights can be circular falloff and be occluded or even cast directional shadows
Most of them would require using a compute shader or the job system to produce anything performant enough for realtime use, I assume
You might be able to get a similar effect using urp's 2D lights if you pixelate their values in a tilemap shader, which would be incredibly fast for a limited number of lights
Reverse engineering integrated shaders is incredibly tedious though
Thanks for all the advice. Currently Tile values are stored in Dictionary<int y, Dictionary<int x, int tileValue>> and placed on tile map only on demand. I'm worried that second tilemap will hit performance hard, what also makes idea of dynamic shadows an overkill. I'll look into it after job, thank you.
Gaussian blur algorithms may work also in addition to outline algorithms, like the type used in bloom post processing
I think that one uses a compute shader internally
CPUs are terrible at repetitive tasks like spreading pixel color, especially if you aren't making use of multiple cores
And I forgot about jump flood algorithms, which can be really versatile and efficient
Is negative scale bad for lightmap baking?
I expect so, especially if combined with batching static
Looks like the same texel invalidity and possible UV overlap problem from before
Iirc last time you didn't confirm if you had done the suggested steps to solve those two problems or not
I tried everything bro
I guess it can't be helped then
the devil is working overtime
Very few options left after "everything" ๐
saying you tried everything is a great way to get yourself stuck in a very negative mindset for finishing what you are trying to do
The fixes I saw you trying seemed kind of esoteric and not exactly in line with our advice
I even tried to bake it in a different scene and there are no issues
so I feel like its an issue with the environment itself
I was also told to make the UV's of the first uv bigger than lightmap UV in maya
idk if you were there when I said that but I got that suggestion from my friend
and I always tought that UV's were supposed to say in the square , so that was kinda weird
the problem is not a lightmap UV issue
its a texel validity issue
we've talked about this before
you keep messing with the UVs when according to your information you were sitll getting issues even when you had unity generate lightmap UVs for your model
which means that its a texel validity issue
its a very different thing than UVs
texel validity
you have holes and backfaces in your geometry causing those artifacts to appear
@timber lichen
talk to me so we can work through this again
we're here to help
your friend is wrong, you should always ALWAYS try to keep or UVs within the square
Well...have to make more objects I guess. Tnx
and this has no bearing because UVs are on seperate channels
exactly
your first UVs (texcoord0) are always your model texture coordinates, the second UVs (texcoord1) are your lightmap UVs, they need to stay within the square.
granted for other applications the texcoords might have different uses but in unity from my experience it has always been texcoord0 - your main model texture, texcoord1 - your lightmap UVs
so first things first lets go through this again
show me your scene view in baked lightmap view mode @timber lichen
what are your settings for the bake
lighting settings
I've suggested previously to make things go faster to reduce sample counts atleast for iteration/testing so you don't have to wait so long
I advised to put UVs to auto generate in Unity so there are no overlap issues and that you can reliably find out where the texel invalidity is actually originating from
I don't know why you keep trying to make them manually
If you have a dedicated GPU then it's usually faster to bake on that too
^^^
I recomend for the sample counts...
Direct Samples - 32
Indirect Samples - 32
Enviorment Samples - 32
that should speed things up, and you shouldn't see a giant difference since unity always denoises the lightmap results
but that depends on how your scene is setup of course
I would also drop the resolution as well, that would make it go faster
I keep samples at the defaults (32 - 512 - 256) but decrease bake resolution when I want to speed things up
Either or both work
^^^
I would go for both just to speed things up so we can trouble shoot more quickly
send us a screenshot of the settings once you've applied them
||so we can confirm that you actually did it ๐ ||
also disabling progressive updates makes things go little faster as well
I'm seeing black borders on the geometry intersection
and you didn't have ambient occlusion enabled
that's the shadows I think
can you send a screenshot of the material that you use for the column?
its good its fixed, but not good that you don't know what it was that fixed it
but I'm pretty certain that double sided GI was enabled on the materials, it would produce that kind of effect
but it could also be that you added geometry to the inside of the walls/columns in an attempt to fix that texel validity issue
urp lit shader, render face set to both
doesn't that enable double sided GI @arctic isle ?
Keeping two different LightingSettingsAssets is the intended workflow for this, and swapping them based on need for speed โก or if you're baking a scene for "production".
Things that increase bake times: sample counts, resolution, anti-aliasing samples, CPU Lightmapper, denoising, high res reflection probes, large number of light probes, max bounces + complex geometry. Also, in 2021+ using a high resolution with GPU Lightmapper can lead to higher bake times because of tiling for low-memory GPUs.
and there are still some artifacts
switch your scene view to texel validity
I might be cuz of the low settings
not necessarily
nope, you have backfaces in your scene
can you send a comparison of your regular scene view, with the baked lightmap view
the ceilling is a plane btw
because it looks like you have large portions of geometry not included in the bake
that makes no sense
which normally I suppose would be fine... except that this looks to be a primarily interior scene which means you would get alot of leakage
yep and show us your regular scene view of this exact angle
I'm certain that there is geometry that you are still not including and marking as ContributeGI static
ya the ceilling is staic and contributeGI
same with the back front wall
not the ceiling
your not reading what I'm saying
the left wall is not in the bake
you have the other side marked as contribute GI static
but not the left side in that classroom
so there is a bunch of backfaces
contributing to all of those artifacts
because that gap wasn't closed
OH FK
do you understand?
think of it like your plugging holes in your lightmap
the lightmapper is bouncing rays off of the backfaces and into the walls causing those artifacts
if you have holes, you'll have issues/leakage
hence the issues you were running into
thats also why I asked you show us a comparison with your regular scene view with the baked lightmap view so we can see what chunks of objects/meshes are missing from the lightmap
and as we saw, large portions of geometry were not included, and with how your meshes were modeled there were LARGE portions of backfaces exposed to areas, contributing to those artifacts that you've been struggling with
so mark all of those objects ContributeGI static, plug those holes. Then those issues should dissipate
One thing I do to make sure I avoid issues like this is whenever I create and light a scene is I ALWAYS mark ALL of my objects as ContributeGI static, then I go through and unmark objects that I don't need in the lightmap
its easier to exclude what you don't need, then include what you do need
@timber lichen
Guys, quick question about reflection probes
I have one big central reflection probes and some nested ones
in URP
when I enabled the nested ones, suddendly the sky is reflected in all the mesh
and idea why?
before
Any ideas?
Did you bake them? Are the "hitboxes" of your new probes big enough to cover the whole mesh?
I bake them
The center probe is big enough to cover all the mesh, the other probes are partials
Hm, should work imo.
Did you try to figure out which of the new probes is the problem?
Are the meshs / lights set to static?
mesh are static
yup
@chilly kettle want me to share the project?
its just a test for lighting with the sponza model
Nah, sry, dont have the time dig that deep
NP
i would recommend trying a new scene, or try to find out which probes causes the problem there.
Does a new 3d mesh like a standard unity cube has the same problem?
I got a question regarding the new material variants, I would be glad if someone could shed some light on this...
I want to be able to offset my UVs uniquely for any rendered mesh in my scene. First I was using unique meshes with the UVs baked into the mesh, all objects sharing the same material (an atlas). Now i've switched to 2022 and thought I could pull off the same thing with material variants. Instead of having a bunch of identical meshes only with different UVs I could have a single mesh and multiple material variants, each with a different UV offset.
Is there any down side to use material variants like this? I was thinking in relation to set pass calls.
from reading the docs Ive found this
Material Variants are not designed to address optimization and scalability concerns. In addition, it is not possible to use Material Variants to alter Materials at runtime in the Player.
To me it sounds like a solution to organise materials and would not necessarily preserve performance (comparing with my older unique mesh solution). However... I've done small test.. and have not been able to find any setpass increase (yet)
Material variants are, as far as i know still increasing the drawcalls.
How many different offsets do you need? ^^
oh.. MANY
like.. 40-50 maybe
I have basically a variation of a minecraft looking setup.. with lots of cubes
and how big is every part of the texture atlas you are offsetting now?
like 64x64 px?
or something?
Im using a small atlas right now, 256x256.. but this will increase in size over time.. right now each cube occupies around 16x16 pixels.. and I sample this kind of square all over the atlas. Some objects are larger though
Thats what we are talking about :I
In hind sight... I maybe shouldn't have jumped on the material variants wagon.. but it was new and shiny ๐
@chilly kettle I forgot to mention that this happen when I have multiple probes inside the main one
like more than 1
sadly im out of ideas ๐
I used them often as you did, without a problem
it should, i am on URP also
i would create new scene, just with one big probe and a small inside of it and have a look if its working there
so seems like for now
the only issues left
and this was baked with 32 direct - indirect samples and environment samples
did you try to increase the scale in lightmap there?
but i think you have another problem there
scale to what size?
How does it look if you increase the size to 2048? ^^
nothing changes
did you rebake it?
in your room? ๐
not really ^^
did you watch any lightmapping tutorials?
I think you need the fundamentals of how lighting and lightmaps work in unity.
I have quite the basics
but learning as I go along
https://www.youtube.com/watch?v=KJ4fl-KBDR8
https://www.youtube.com/watch?v=hMnetI4-dNY
there are great infos
In this video, we are going to take a look at Lightmapping in Unity 2020.1 to help you create fast and beautiful lighting in your scene.
Learn more about Lightmapping in 2020.1 from our Docs!
https://on.unity.com/2U7VQIX
Interested in the newest Graphics Features we added in 2020.1? Click here!
https://on.unity.com/2GHYGkR
Download the Spaces...
In this video, you'll gain an understanding of how lights and shadows work in the Universal Render Pipeline, as well as how to set up a scenario with a mix of real-time shadows, Light Probes, and baked GI.
Speaker:
Ciro Continisio
Ask your questions here: https://on.unity.com/2UmP9TE
Did you find this video useful? Room for improvement? Let us...
yes, you MUST click that checkbox for every mesh you import and want to bake the light on.
already did
are these settings good?
change it to GPU not CPU, or you wait for ages
mmh
im also doing editing on premiere pro
so idk if that will destroy my workflow
well, its baked in 1-2 minutes, so it shouldnt ๐
@chilly kettle wanna hear something funny?
I updated the unity version. Problem solved
thats a huge step ^^
much faster btw
the settings there have nothing to do with that, not sure why you keep reverting to even higher and higher sample counts
the low sample counts don't contribute to these kinds of artifacts
the only artifacts that low sample counts introduce is noise
thats it
in these examples its not noise, it looks like once again texel validity issues
show us how it looks in the lightmap texel validity view
if it looks fine
then its your UVs that are wrong
this is an example of low sample counts and the artifacts it introduces
from their offical lightmapping troubleshooting guide
texel validity artifacts that you were running into
and improper UVs
@timber lichen
the source also for this, which might be of use is here -https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/#post-8466917
changing the lightmap scale won't fix his issue in that example, its a texel validity artifact
changing the resolution also won't really affect it or fix it
sorry, repeating info here but just making sure everything is answered
I'm inclined to agree but unless if you know what you are doing and the model itself has authored lightmap UVs then it isn't always necessary to do this
looking at some of these images your walls are not purely one sided meshes right?
your material on the walls is set to render both faces
set it to render the front face only
@timber lichen
it disappears when I do that
show me
I knew it...
the normals are wrong
so correct them in a modeling package that you have which was maya if I recall
when the meshes are corrected
the walls shouldn't dissapear now
atleast not unless you go onto the other side of it
and if you want to still see a wall even on the other side of it
then the wall needs to have a thickness to it
wall meshes can NOT be one sided if the intent is to have a wall that can be seen from both sides
that will lead to the many many issues that you've been running into
How can i avoid this? Could this effect only be achieved by lowering intensity of the light gradually?
You can also animate the color of the Light to go darker and darker. I wouldn't recommend having the Light on if it's not supposed to be lighting anything
Well, i think that the people who are asking what lightmaps are, do not prepare their UV channels for this ^^
I'm making my game using modular building pieces from Blender, where I line up the edges perfectly. My problem is that directional light seeps through the edges, because they are lined up perfectly. Is there a way to prevent this from happening?
I've tried scaling up my wall pieces so they overlap and this still happens
changing the bias to 0 somewhat fixes the problem, but there are still areas where the light appears and it shouldn't
think your running into a problem on why you should avoid making enviorments with modular meshes. it typically doesn't play well with how realtime rendering works
can you provide some visual examples so we can see whats going on and help you to fix it?
How else would you recommend doing it? I'm reusing a lot of assets so doing it in a non-modular way seems very tedious
I'm going to be away from my pc for a little while but I'll send some pictures in a few hours
during asset creation building from modular assets is a fine idea, but when it comes to integrating it into an actual game enviorment its best to combine all of those meshes properly in your modeling package before bringing it in to a game enviorment
So you would recommend using modular assets within blender but then to make an entire room for example I should combine all the meshes and then export it for Unity?
yes
<@&502884371011731486> @worn snow another bot
now its just a suggestion
you don't have to abide by it if you don't want to but generally form my experience when it comes to building enviorments from many modular meshes. You can run into alot of issues when it comes to light leaking, and especially when lightmapping some of those issues multiply and introduce other problems like random dark spots at intersection points or whatnot and more
Gotcha. My original plan was to put all the modular pieces together to make a room, and then make that room a prefab, and then connect all the rooms of my house together. If I made a single FBX file for each room, this would still cause light bleed when I combine them though, right? So wouldn't I need to make my entire house a single file?
even if its a single FBX file there can still be issues
the meshes have to actually be combined
and connected
I'll try my best to explain it since its tough
Yeah I think I get what you mean, like I'd actually be combining all the walls and floors and ceilings into a single correctly combined mesh in blender
But that would mean my entire house would need to be correctly combined in blender, so I'd just have one massive file for my whole house right? My entire game takes place in this house, so wouldn't this cause problems either with optimization or workflow?
I've heard people say that I can make an invisible cage that blocks shadows into my house, but that seems like a pain in the ass and I'd rather just let the pieces do this shadow blocking if it can
That would require me to make cutouts and stuff for windows too, so again, this is a last resort
I would combine the mesh for each single room though
and segment the house by rooms
this is a viable way to do it and sometimes is the right way to do it
I'll provide some visuals examples to help explain
It's what I would do
One smooth shaded shadows-only cube that hangs just behind each edge where the mesh is meant to connect to the next
I don't see how that's a lot of extra effort
You'd naturally include them in prefabs or the fbx itself instead of adding them to every seam manually
Yeah but then it would create this issue every time I combine the rooms, sure, now it won't be as big of an issue because it's only where rooms meet and not on each wall of each room, but I'll still have the problem if I move them against each other
putting together some visual examples real quick to illustrate the drawbacks
I think modular meshes in engine are totally fine, as long as you watch out for the specific drawbacks
they are and I was a bit hesitant because often times we've seen people use them and run into lighting issues and wonder why they are getting those issues
So you would make a cube that covers each seam? When I get back to my pc I can try to recreate what I think you mean
and most of the time it stems from the enviorment being built from many different little peices that aren't perfectly aligned that would cuase those issues
Well that's not my case, my pieces are perfectly aligned and I've tried also scaling them a little so they overlap and I still have the same issue
heres an example I quickly setup
a room modeled from cubes (that are perfectly aligned)
emulating an enviorment that is modeled from many different peices
you can see the issues that prop up especially when I bake it
if your using realtime lighting, because of its inprecision usually it isn't too much of a problem but it still comes with its issues
looks fine in here, except notice here
random little lines at intersection points
from the realtime shadows