#archived-lighting

1 messages ยท Page 8 of 1

winged tangle
#

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?

winged tangle
#

yes

#

ok i see, fixed ๐Ÿ™‚

#

but now it's no longer shiny..

#

i dont get reflections?

night shell
# winged tangle so if I have a realtime time, there is only direct lighting from the light sourc...
  1. realtime only affects direct lighting on objects, so your correct
  2. 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)
  3. 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)
  4. 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 ๐Ÿ˜›
night shell
# winged tangle but now it's no longer shiny..

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

winged tangle
# night shell this is also another problem with the current built in stuff that unity has when...

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

night shell
#

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

winged tangle
#

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

night shell
#

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

winged tangle
#

ok, ill set it up real quick ๐Ÿ™‚

winged tangle
#

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

night shell
#

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

winged tangle
#

ok i will look for that now

night shell
#

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

deft fiber
#

Despite that I'm used to seeing better shadows when baking than ones in your example

winged tangle
#

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

deft fiber
#

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

winged tangle
#

hmm :9

#

i dont think i can find the soft shadow radius

#

in HDRP at least

deft fiber
winged tangle
#

ohh ok

#

i didnt see that! i was messing with the point light range thinking it was same as radius

#

thank you

deft fiber
#

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

tame walrus
#

how do i add 2 light flares to a light

marble compass
#

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.

winged tangle
#

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

whole bramble
#

i fell into problem

#

after baking

#

before baking

#

does anyone know about the issue?

#

im using legacy diffuse shader

deft fiber
whole bramble
#

why does the light go that much dark?

#

after the bake

deft fiber
#

Light source could be inside the lampshade as well

whole bramble
#

cast shadows off on the bulb

#

but yeah , GI static

#

turned it off...lets see the result

#

still doesnt work

deft fiber
whole bramble
#

yes

#

it bakes correctly

deft fiber
#

Then it confirms you are solving the correct issue which is good ^^

whole bramble
#

this time

#

i took the light middle of the room ...and outside the bulb

#

lets see if it works or not

deft fiber
#

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

whole bramble
#

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

proud wyvern
#

why is my shadow so pixelated?

deft fiber
#

Large spot angle is generally the hardest thing for shadow casting

still bobcat
#

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?

deft fiber
proud wyvern
deft fiber
still bobcat
deft fiber
# still bobcat 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

still bobcat
#

ah alright thank you!

neat sparrow
#

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.

quartz jetty
unkempt warren
unique vortex
#

Hey does anyone knows of to fix this kind of issue (the non light square boxes)
:

deft fiber
unkempt warren
deft fiber
deft fiber
winged tangle
#

@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!

unkempt warren
#

either I'm blind or I don't know what it's called

#

also dont see anything in the render pipeline

unkempt warren
#

oh yep thanks

#

ouch there goes my aesthetic

#

seemed to increase the brightness if everything

deft fiber
unkempt warren
#

Everything is "dark" but changing it seemed to almost triple everything's intensity

#

just did /3 and it looks the same again

deft fiber
unkempt warren
#

and then this was after

deft fiber
deft fiber
# unkempt warren and then this was after

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

swift shore
#

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? ๐Ÿ™‚

deft fiber
swift shore
#

Thanks, appreciate the answer. So a fix could be that I just give the walls some depth with a flat surface backwall for shadows.

deft fiber
#

Exterior wall too close

#

proper padding

#

Two-sided walls only, for comparison

swift shore
fading aurora
#

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

deft fiber
# fading aurora

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

blazing tusk
#

why is it like this when i play my game?

deft fiber
fading aurora
#

tyy

fading aurora
#

what is the best way to diminize that flare at the wall

manic prawn
#

how i can blend the light maps to get rid of seams?

timber lichen
#

Hello guys

#

How is this scene in terms of lighting ?

swift shadow
#

pretty spectacular

timber lichen
swift shadow
timber lichen
night shell
#

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
#

How could I block the light from overlapping from the bathroom to this room?

manic prawn
#

@timber lichen Enable shadows to each light

manic prawn
manic prawn
#

Can you give me the model? i want to try bake the light

timber lichen
#

well its an entire cabin...

night shell
# timber lichen

switch the mode to realtime, enable shadows on the realtime light, then switch back to baked

deft fiber
#

I'm curious to see what kind of lightmap layout those resolution and padding settings generate in a very modular scene like yours

pure ruin
#

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

void tusk
#

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

void tusk
#

I only have one quality setting so its not a discrepancy between editor quality setting and build quality setting

#

Same area in the editor

timber lichen
#

Does anyone know how can I fix this issue

night shell
#

whats the issue? the bright lighting?

#

just simply reduce the brightness of the light

timber lichen
night shell
#

just reduce the brightness of the lights, there is too much light in that area

#

you could also get around it by using tonemapping

timber lichen
night shell
#

and tonemapping could help keep brightness values within an acceptable range so it doesn't blow out so quickly

night shell
timber lichen
#

those are my settings

night shell
#

your settings are fine, its the lights that you have in the scene

timber lichen
#

oh tonemapping I never heard of that Ill look into that

#

ty

vital jacinth
#

Hello @turbid eagle spot lights are not working properly. please give me any solutions.....

night shell
vital jacinth
timber lichen
#

How can I fix this ?

little condor
#

I assume you mean the missing geometry in the reflection? You weren't specific with "this".

Is that model marked as Static?

vital jacinth
night shell
# vital jacinth

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

timber lichen
night shell
# night shell

you'll find this on the URP settings asset in your project

vital jacinth
night shell
#

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

vital jacinth
night shell
#

oh you already increased it, then yeah you've probably hit the limit of realtime lights]

#

per object

#

how to fix it?

vital jacinth
#

please

night shell
#

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

vital jacinth
#

I tried backed lighting. But after backed, black spots are coming like this

night shell
#

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

little condor
night shell
#

^^^

#

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

timber lichen
night shell
#

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

vital jacinth
#

After baking, look like this.
Still some spotlight is not working after the baking

night shell
#

and also are you sure that all of the lights are infact set to baked?

vital jacinth
night shell
#

ok so what about my next question @

#

whoops sent to early

vital jacinth
#

Yes

night shell
#

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

vital jacinth
#

Which lighting mode should be used during baking?

night shell
#

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

night shell
#

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

vital jacinth
night shell
#

looks to be working

vital jacinth
night shell
#

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

vital jacinth
#

Also post processing is not working

night shell
#

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

vital jacinth
#

Here is the camera setting

vital jacinth
night shell
#

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

vital jacinth
#

still not working

night shell
#

hmm not sure what it could be then

#

since you are using URP

vital jacinth
timber lichen
#

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

night shell
#

the problem there looks to be more of a reflection issue than a lighting issue

#

but I would suggest looking into lightprobes @timber lichen

neat sparrow
#

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)

#

I messed with the settings of the rt for a while and eventually found this. Now it works. Not sure why.

buoyant tartan
#

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)

gloomy ember
#

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

modern mauve
#

How do i make textured objects be effected by light?

deft fiber
#

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

modern mauve
deft fiber
modern mauve
#

The texture is not effected by light

deft fiber
# modern mauve 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

timber lichen
#

dman

#

its been stuck like this

#

for 40 minutes while baking

earnest sluice
#

how can i make lightining like this

deft fiber
dapper badger
#

I have a issue with lighting being "darker" in build than in editor. How can I fix this? It's URP

night shell
night shell
dapper badger
deft fiber
night shell
#

true

night shell
#

from the outset it looks like a linear/gamma color space issue

maiden lynx
#

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

deft fiber
maiden lynx
#

got it thanks

brittle geyser
#

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

deft fiber
fringe notch
#

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.

lavish perch
#

yeah hmmm

fringe notch
#

black spots

lavish perch
#

quite peculiar

fringe notch
deft fiber
# fringe notch

Check UV overlap and texel invalidity in scene window debug views as the first thing

night shell
#

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

brittle geyser
#

@deft fiber Fantastic, thank you for the help

little mason
#

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

night shell
little mason
night shell
#

no

#

LightingData stores lightprobe and other misc data I believe, but that will be regenerated

little mason
little mason
#

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.

night shell
#

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

little mason
#

just wanna ask before it bakes for 45 minutes

timber lichen
#

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

little condor
timber lichen
#

Oh thatโ€™s interesting

#

I may try that

#

I use HDRP also

little condor
# timber lichen I use HDRP also

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.

manic prawn
#

Does the low poly + reflections looks good?

civic viper
lost granite
#

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

deft fiber
timber lichen
#

why is my wall green?
This happened after i baked my light
for the 3rd time now

night shell
# timber lichen

could be alot of things, either

  1. your material for the wall is actually green,
  2. you have green lights in your scene, or it could be a mixture of yellow/blue lights that amount to a green light
  3. 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

timber lichen
#

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

timber lichen
#

and still have the same issues

timber lichen
#

@night shell

night shell
#

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

timber lichen
#

like this?

night shell
#

yep

#

I can see some issues right away

#

disable the lightmap checkerborading

timber lichen
night shell
#

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

timber lichen
#

well I create the lightmaps for the ceilling on maya but I guess that messed up

night shell
#

have unity do it for you

#

generally in my experience it tends to do a good job

timber lichen
#

so only contribute GI should be checked

night shell
#

no, just saying that make sure it is infact checked

#

for the objects that you do want to be baked with lightmaps

lost granite
#

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

brittle geyser
#

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

cursive quartz
#

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?

cursive quartz
brittle geyser
#

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.

night shell
# cursive quartz i know but why is not possible?

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 ๐Ÿ˜›

cursive quartz
#

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

cursive quartz
brittle geyser
# cursive quartz 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

cursive quartz
#

Yes i got it i just didnt know about this unpack complettly thank you ๐Ÿ™‚ both

pliant gazelle
#

how to make lightmapping also work on all the LODs?

deft fiber
#

Otherwise verts will be split

brittle geyser
#

Ah this makes perfect sense, thanks @deft fiber

#

I was really confused when unity imported a cube with 20 verts

deft fiber
#

Normals, UVs, vertex groups, vertex colors and tangents are all the same vector data to the format I believe

timber lichen
#

Does anyone know how to fix these shadows artifacts?

timber lichen
timber lichen
#

@night shell sup

night shell
#

which are caused typically by backfaces

#

switch your scene to Texel Validity view

timber lichen
#

oh damn

#

this looks bad

night shell
#

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

timber lichen
#

You know how I could fix this

night shell
#

yes

#

but im asking for more information so we see exactly what needs to be done to fix it

timber lichen
#

oh sry did not see your other message

night shell
#

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

timber lichen
night shell
#

ahhhh I think I see it

timber lichen
#

oh

night shell
#

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?

timber lichen
#

ya

#

look at my UV's

#

all overlapping

brittle geyser
#

Anybody knows how unity generates lightmap uvs under the hood?

timber lichen
#

well

#

I just fixed the uv

#

so ima do other bake to see

night shell
#

you could also have unity generate the lightmap UVs for you

timber lichen
#

are these settings good?

timber lichen
night shell
#

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

night shell
#

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

  1. 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)
  2. 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
night shell
# timber lichen

also as a note to help speed up your lightmapping process and testing you can drop the sample counts even more

  1. Direct Samples = 32
  2. Indirect Samples = 32
  3. Enviorment Samples = 32
timber lichen
#

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

night shell
#

what UV channel

timber lichen
#

normal

night shell
#

channel 0 or 1

#

lightmap UVs for unity are on uv channel 1

timber lichen
#

how do i check that

night shell
#

no idea I'm not that experienced with UV mapping in maya

timber lichen
#

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

night shell
#

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

timber lichen
#

ok well no idea why it says its overlapping when its clearly not

#

damn

#

brb

night shell
#

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

night shell
#

you have smooth normals on

timber lichen
brittle geyser
#

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)?

night shell
#

think of it as a coordinate plane

#

actually it is a coordinate plane

deft fiber
brittle geyser
#

@deft fiber Aye
@night shell Appreciate the clarifications, thanks

timber lichen
#

so apparantly I have to make my normal UV's bigger

#

and the lightmap UV's smaller

night shell
timber lichen
#

my friend

night shell
#

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

timber lichen
#

I still get the same issue

night shell
#

did you screenshot it?

#

because then we can diagnois eit

timber lichen
night shell
#

not the UV chart

timber lichen
night shell
#

but of how the final scene looks even with the unity generated lightmap UVs

timber lichen
#

he said lightmaps uv on unity crushes the normal uvs

night shell
#

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

night shell
deft fiber
#

But it doesn't seem Bat is following either step UnityChanThink

#

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

timber lichen
#

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?

deft fiber
timber lichen
timber lichen
#

should i set it to double sided? or that doesnt matter?

deft fiber
timber lichen
deft fiber
timber lichen
#

thanks tho

deft fiber
#

If you find the matching problem, then you'd read about the potential causes and fixes

timber lichen
#

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

deft fiber
timber lichen
#

so they arent much the same in lightning

deft fiber
#

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

tawdry birch
#

Has anyone hacked a point light to emit shadows instead? Where the pixels are darkened instead, such as using a multiply filter

deft fiber
timber lichen
#

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..

timber lichen
#

nvm, Ambient Color does the job

deft fiber
# timber lichen 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

timber lichen
#

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?

deft fiber
timber lichen
#

huh,i do have realtime and baked lights,imma test this

deft fiber
#

The limit of 8 is specific to URP, but so is forward+ rendering path

timber lichen
#

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 ^^

eager coyote
#

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.

obtuse nest
timber lichen
fierce lynx
#

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

jaunty abyss
#

How can i make my Custom ShaderGraph work with 2d lighting in URP?

fierce lynx
#

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

vocal haven
#

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 ๐Ÿฅน

fierce lynx
#

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

deft fiber
# fierce lynx Issue is a lot of its probuilder

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

weak jolt
#

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

edgy aurora
#

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

hot path
#

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

toxic eagle
#

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?

mellow sierra
#

Don't crosspost please. @toxic eagle

deft fiber
night shell
eager coyote
#

i'm feeling like the ground there consists of multiple objects and i suspect those lights aren't baked

night shell
eager coyote
#

yeah mb, I'm just musing because I have nothing better to do lmao

night shell
#

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

eager coyote
#

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

deft fiber
#

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

deft fiber
# eager coyote like I have several copies of a material with different tiling because I'm using...

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

eager coyote
#

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

deft fiber
eager coyote
#

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

deft fiber
eager coyote
#

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

deft fiber
#

Guaranteed payroll for coders UnityChanLOL

#

There's also GPU instancing for rendering a lot of the same thing, and SRP batching with URP/HDRP that's quite magical

eager coyote
eager coyote
deft fiber
#

From my perspective that too is just one checkbox

eager coyote
#

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

deft fiber
eager coyote
#

I am very inexperienced with how Unity handles lighting

eager coyote
#

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

eager coyote
# eager coyote also going to repost a question I never got a response to: is there some kind of...

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

deft fiber
eager coyote
#

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

spark pawn
#

Hallo! With baked lighting, does the Progressive lightmapper take alpha clip into consideration? Like tree branch and grass cards?

spark pawn
# night shell 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?

night shell
#

meta pass

#

meta pass is used by lightmapper to pull data about the material

spark pawn
#

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?

tiny aspen
#

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?

icy tundra
deft fiber
#

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

tiny aspen
#

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.

deft fiber
#

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

deft fiber
#

And I forgot about jump flood algorithms, which can be really versatile and efficient

uncut coral
#

Is negative scale bad for lightmap baking?

timber lichen
#

damn yo

#

I tried everything and there's a glitch with light baking

deft fiber
deft fiber
#

Iirc last time you didn't confirm if you had done the suggested steps to solve those two problems or not

timber lichen
#

I tried everything bro

deft fiber
#

I guess it can't be helped then

timber lichen
#

the devil is working overtime

deft fiber
#

Very few options left after "everything" ๐Ÿ˜„

hot path
#

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

deft fiber
#

The fixes I saw you trying seemed kind of esoteric and not exactly in line with our advice

timber lichen
#

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

night shell
#

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

night shell
uncut coral
night shell
night shell
#

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

timber lichen
#

im doing an other bake atm

#

12 min left

night shell
#

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

deft fiber
#

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

timber lichen
night shell
#

WOAH

#

those are some LARGE sample counts

deft fiber
#

If you have a dedicated GPU then it's usually faster to bake on that too

night shell
#

^^^

#

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

deft fiber
#

I keep samples at the defaults (32 - 512 - 256) but decrease bake resolution when I want to speed things up
Either or both work

night shell
#

^^^

#

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

timber lichen
#

omg it worked

night shell
#

what did

#

let me geuss, enabling double sided global illumination on the materials?

timber lichen
#

no I have no idea

#

honestly

night shell
#

I'm seeing black borders on the geometry intersection

#

and you didn't have ambient occlusion enabled

timber lichen
#

that's the shadows I think

night shell
#

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

timber lichen
night shell
#

urp lit shader, render face set to both

#

doesn't that enable double sided GI @arctic isle ?

arctic isle
# night shell I would go for both just to speed things up so we can trouble shoot more quickly

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.

timber lichen
#

lol wtf

night shell
#

so that answers that then

#

it was double sided GI

night shell
timber lichen
night shell
timber lichen
night shell
#

oof thats bad

#

I see some geometry also that isn't included in the bake

timber lichen
#

I might be cuz of the low settings

night shell
#

not necessarily

timber lichen
#

Direct Samples - 32
Indirect Samples - 32
Enviorment Samples - 32

#

thats bad

arctic isle
timber lichen
night shell
#

can you send a comparison of your regular scene view, with the baked lightmap view

timber lichen
#

the ceilling is a plane btw

night shell
#

because it looks like you have large portions of geometry not included in the bake

timber lichen
#

that makes no sense

night shell
#

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

timber lichen
night shell
#

I'm certain that there is geometry that you are still not including and marking as ContributeGI static

timber lichen
night shell
#

yep

#

that entire left wall is not included and marked as Contribute GI static

timber lichen
night shell
#

same with the back front wall

night shell
#

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

timber lichen
#

OH FK

night shell
#

do you understand?

timber lichen
#

so it damages the ceilling even tho its not part of it

#

wtf

night shell
arctic isle
# timber lichen wtf

the lightmapper is bouncing rays off of the backfaces and into the walls causing those artifacts

night shell
#

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

velvet pulsar
#

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

velvet pulsar
#

Any ideas?

chilly kettle
velvet pulsar
#

I bake them

#

The center probe is big enough to cover all the mesh, the other probes are partials

chilly kettle
velvet pulsar
#

mesh are static

chilly kettle
#

i think baked reflectionprobes only care for static objects?

#

hm weird ๐Ÿ˜„

velvet pulsar
#

yup

#

@chilly kettle want me to share the project?

#

its just a test for lighting with the sponza model

chilly kettle
#

Nah, sry, dont have the time dig that deep

velvet pulsar
#

NP

chilly kettle
#

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?

native locust
#

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)

chilly kettle
native locust
#

oh.. MANY

#

like.. 40-50 maybe

#

I have basically a variation of a minecraft looking setup.. with lots of cubes

chilly kettle
#

and how big is every part of the texture atlas you are offsetting now?

#

like 64x64 px?

#

or something?

native locust
#

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 ๐Ÿ™‚

velvet pulsar
#

@chilly kettle I forgot to mention that this happen when I have multiple probes inside the main one

#

like more than 1

chilly kettle
velvet pulsar
#

Is this supported in URP?

#

Maybe is a bug in my unity version?

chilly kettle
#

it should, i am on URP also

velvet pulsar
#

Im running out of ideas too haha

#

I will update my version

#

just in case

chilly kettle
#

i would create new scene, just with one big probe and a small inside of it and have a look if its working there

timber lichen
#

so seems like for now

#

the only issues left

#

and this was baked with 32 direct - indirect samples and environment samples

chilly kettle
#

but i think you have another problem there

timber lichen
#

scale to what size?

chilly kettle
#

how big is your lightmap btw?

#

in pixels

timber lichen
#

1024 x 1024 ? right

#

@chilly kettle

chilly kettle
#

How does it look if you increase the size to 2048? ^^

timber lichen
#

nothing changes

chilly kettle
#

did you rebake it?

timber lichen
#

oh

#

forgot

#

could it be because the windows are opens

chilly kettle
#

in your room? ๐Ÿ˜„

timber lichen
#

no because I heard I could create problems

#

idk

chilly kettle
#

not really ^^

timber lichen
#

ok well ima rebake and see if anything changes

#

thanks for the tip

chilly kettle
#

did you watch any lightmapping tutorials?
I think you need the fundamentals of how lighting and lightmaps work in unity.

timber lichen
timber lichen
#

but learning as I go along

chilly kettle
#

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...

โ–ถ Play video

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...

โ–ถ Play video
chilly kettle
# timber lichen

yes, you MUST click that checkbox for every mesh you import and want to bake the light on.

timber lichen
#

are these settings good?

chilly kettle
#

change it to GPU not CPU, or you wait for ages

timber lichen
#

mmh

#

im also doing editing on premiere pro

#

so idk if that will destroy my workflow

chilly kettle
#

well, its baked in 1-2 minutes, so it shouldnt ๐Ÿ˜„

velvet pulsar
#

@chilly kettle wanna hear something funny?

#

I updated the unity version. Problem solved

chilly kettle
#

lel

#

which version did you use?

velvet pulsar
#

2021.3.1f1

#

updated to 2022.2.7f1

chilly kettle
#

thats a huge step ^^

velvet pulsar
#

much faster btw

night shell
# timber lichen

the settings there have nothing to do with that, not sure why you keep reverting to even higher and higher sample counts

night shell
# timber lichen

the low sample counts don't contribute to these kinds of artifacts

#

the only artifacts that low sample counts introduce is noise

#

thats it

night shell
# timber lichen

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

night shell
#

changing the resolution also won't really affect it or fix it

night shell
#

sorry, repeating info here but just making sure everything is answered

night shell
night shell
# timber lichen

looking at some of these images your walls are not purely one sided meshes right?

timber lichen
#

I dont think so

#

@night shell

night shell
#

your material on the walls is set to render both faces

#

set it to render the front face only

#

@timber lichen

timber lichen
#

it disappears when I do that

night shell
#

show me

timber lichen
night shell
#

yep then that makes a ton of sense

#

the meshes are modeled incorrectly

timber lichen
#

I knew it...

night shell
#

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

ember tide
#

How can i avoid this? Could this effect only be achieved by lowering intensity of the light gradually?

arctic isle
chilly kettle
dense mural
#

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

night shell
night shell
dense mural
dense mural
night shell
dense mural
night shell
#

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

dense mural
#

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?

night shell
#

the meshes have to actually be combined

#

and connected

#

I'll try my best to explain it since its tough

dense mural
#

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

night shell
#

yes basically

#

it also helps alot with optimization

dense mural
#

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

night shell
#

and segment the house by rooms

night shell
#

I'll provide some visuals examples to help explain

deft fiber
dense mural
night shell
#

putting together some visual examples real quick to illustrate the drawbacks

deft fiber
night shell
dense mural
night shell
#

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

dense mural
night shell
#

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