#Thread
1 messages ยท Page 1 of 1 (latest)
yeah
Then I guess I'd make a new light next to it to see if that works
Reasonable to assume that the problem is either the light or the meshes, if it's not their placement relative to each other
Were the lights mixed the whole time?
no, i tried to set them to mixed after baked didnt work properly
only some of them work on mixed, and none worked on baked
i have no idea what this means...
That's a bit of a mistake at this point, like I cautioned
Mixed lights use both baked and realtime lighting, but in a more complex way than either baked or realtime
So you get problems of both and then some more if your settings aren't right or if there's bugs around
ah i see sorry for the confusion
Because mixed lights have the realtime part to them, you might assume they "work" once you see the realtime light
but the ones that dont work AND the ones that do work are both mixed, and the debug draw mode supports that
But then you'll likely start running into realtime light issues, like pixel light limits
But that should be worried about only after you get purely Baked lights working
why would some work and some not
First you should make the choice whether you're troubleshooting baked or realtime lights
Not get mixed up with Mixed
baked, i was always troubleshooting baked
i only switched to mixed because baked wasnt working at all
and it works a little better than baked so i stuck with it
Are you sticking with Baked for now, though?
yeah thats the goal
It better be the practical reality too
Anyway, it should be reasonable to assume the issue is either the lights, the meshes or their placement relative to each other
Since moving the problematic lights around had no impact, I'd try creating a new light next to the problematic light
With a different color to differentiate it
That would rule out if something's messed up about the light component itself somehow
And do restart the editor if you haven't already after the issues began
It could be a hiccup since there seems to be no obvious cause
Presuming you've triple checked the light types, meshes and Contribute GI flags of both
i had to restart when upgrading versions
i'll try this
so i put a new green baked light next to the lantern and it half works?
i can see the green but its super blotchy
The GI debug views have modes for UV overlap and Texel Validity
Looks like there could be issues with either or both
Invalid texels and UV overlaps are both big issues
how do i fix that ๐
Since the lantern shows up in those debug views, it seems it is GI static and thus blocking any light from getting out from within it
Which could explain why that particular light is not working, but not if the same light also doesn't work outside of the lantern
but i tried toggling gi static on other ones that werent working and they still didnt work
It might be the right thing to do even if it fails to produce results, as it's possible you have more than one issue at once there
As you do in form of texel invalidity and UV overlap
But there could be something else as well
What really helps me and probably would help you is to get baking working first in a smaller test environment
Some default cubes (since those always have good lightmap UVs), a small patch of the level containing a lantern and only a couple of other things, and some test lights separate from them
Usually once you get that kind of setup working and move to the full scene proper, you may find that it introduces new issues that stop the baking from working
Which now are much easier to solve as you aren't tackling the whole sandwich of problems at once
so i got rid of the green light and toggled static gi on the lantern post and it looks the same way the green light looked
i'll try setting up a smaller scene
That's important progress
Proves that disabling GI contribution of the lantern did prevent the light form being absorbed
While it's helpful for your learning that you get lightmapping working as-is in the test scene for now, I'd caution that the kind of curved and detailed meshes you have are very inefficient to lightmap and to lightmap UV-unwrap
but im still stuck on why it didnt work when i tried toggling static gi on other lanterns?
We can still assume it's something to do with the meshes, the lights or their relative placement
If the light works when moved out of the lantern, it's possible you have multiple stacked lanterns some of which are static
ok heres a smaller scene
As you recall if a mesh shows up in texel validity or UV overlap views, they are GI static
the lanterns are the only source of light (no directional light)
the tree looks super wierd
the lantern post seems to work somewhat but the small lantern isnt working at all
and the plane isnt recieving any light?
why do the cube and plane not show up?
Well, are they GI static and receiving GI from lightmaps in the mesh renderer?
Most problems in this field are oversights of something that may seem obvious, and the solutions often are just triple checking such obvious things
ok heres the new bake
Even for me!
cube and plane and props look good, tree looks trash
Much improved
UV overlap debug view should reveal problems still, but I'd also check texel validity again
I would check the Baked Lightmaps from lighting window here as well
Since the lighting artifacts are repeated identically, that strongly suggests the UV areas should be overlapping which as with all UV mapping causes geometry to share texture space
Possibly it could be due to overlapping geometry
Maybe objects or in the mesh itself
i cant really make out anything because of the size ๐
ill try a rebake with smaller size
You can hit "View" to look closer
I'd zoom in on the tree leaves
And compare it to the tree's geometry
Every individual side and layer of the tree should have its own UV space
so this is all that correlates to the tree
wait this too
is it supposed to look like this?
Probably
the props look a lot clearer
However this looks suspicious to me
The tree's inside and outside are obviously overlapping
I don't know the geometry well enough to gauge it by eye, but it looks like the "front" and "back" of the tree are likewise overlapping there
this pic if from the inside of the leaves and i think youre right
If a conical, let alone a layered conical shape was properly unwrapped it'd have to form multiple separate triangular shapes, or one or more circular shapes
So, make sure that mesh also has lightmap UV generation enabled
where do i find that setting?
That's what chapter 9 of the guide is for
No, sure you baked again?
oh, no i havent baked again
All the friction you're experiencing now goes away with just practicing this process by repeating it and upping the complexity gradually
Yes
Your models have a lot of curves and tapers, whereas lightmapping really only works with boxy meshes due to UV difficulty
So it's possible that's the best result you can expect with your meshes
(As long as you iron out other issues like artifacts stemming from texel invalidity)
You will also need Light Probe Groups for lighting anything that's not lightmapped
i have 0 modeling experience so i wasnt aware of any of this before now ๐
There is another way but I'm hesitant to recommend it
PLEASE I'LL DO ANYTHING
Ordinarily baked lighting means lightmaps and light probe groups working together
That's the first half of what we've been battling with so far
rebaked scene looks almost perfect!
The lanterns can be lit up by the light probe groups once you have them
They store light at arbitrary points during baking, then interpolate the light to objects close to those points
mhm makes sense so far
But as long as you use lightmaps you'll be stuck with those seams
You can set GI static objects to use probes instead of lightmaps
Which is definitely worth doing for any small and detailed objects like the fruit baskets
Or any baskets really
Because with lightmaps every square inch requires space on the lightmap, and every corner and curve splits the lightmap UV region and every region needs its own margin/padding
So you end up with a lot of seams and a lot of wasted texture memory
so what are you implying exactly?
An alternative to lightmaps and light probe groups are adaptive probe volumes
They're automatically placed probes which can be sampled per-pixel rather than per-object
Which means none of the work or limitations involved with lightmapping come into play
Or with ordinary light probe groups
The downside is that the system is just as complex to set up as the two others combined, as far as steps and boxes to tick and odd rendering errors are considered
This session will showcase the advantages of adaptive probe volumes over legacy light probes (automated placement, per-pixel lighting, reflection probe normalization, and lighting scenarios). How to set up the system and how to fix light leaking (tools for debugging and tuning APV) with multiple scene examples.
#unity #unity3d #lighting
But maybe you want to take the time to study it and to test it
In all honesty, this is for a game jam so I'm super happy with my current result. All I wanted was for it to look nice without tanking my fps
Oh and also it only works on compute-capable devices
So most mobile and web platforms are out
I will definitely take a look!
I'm building for web ๐
(although some mobile devices are compute-capable, and while webGL isn't, the experimental webGPU is)
Isn't everything webgl related experimental? ๐
Not in the sense that it's new, at any rate!
WebGL is ancient and pretty much unchanged for years
WebGPU however is the new replacement
Still in testing phase but apparently not too tricky to get working
Going with APVs and WebGPU certainly would mean a lot of study, practice and testing in your current situation though
And the current lighting looks just fine ^^
Truly. Thank you for all of the help! And if you don't mind me asking, how have you come to be so knowledgeable in this genre of gamdev?
Is it study or experience or backend dev experience or...?
"All it takes" is taking too much ๐
Oh one more thing you might want to know
Mixed lights forgo any performance benefit you will get from baking lighting
Since they combine realtime for direct lighting and baked for indirect, via various modes
Baked is cheap because it's stored in textures / probes
Realtime can look sharper and consumes only runtime vram
Mixed has the visual quality of both, but the expense of both
And the limitations of both
Since they can't be moved but are subject to realtime light limits, among others
So if you were using Baked, you weren't imagining the performance
But if Mixed, then yes!
So how would I go about simulating lighting on moving objects without tanking performance?
I thought that's what mixed was for
Light probes apply baked light to moving / non-static objects
But there's no realtime shadows, which is one thing Mixed lights are used to help with
(But shadows are expensive)
So how do AAA games do it while also allowing you to get 200+ fps?
Mostly they limit the number of lights and shadows per scene / screen
There's optimization techniques for almost everything of course
The cost of lights and shadows is dependent on many things, such as the polycount of objects in their range
Though that varies by rendering path
Optimization is a complex topic
A few lights aren't that tough for modern machines, anyhow
Triple A devs tend to have source code access, a whole team of graphics engineers specifically for the task and they know precisely what needs to be shown on screen whereas with us indies it's a bit more up in the air what shows up
And I know few triple-A games that target any FPS above 60 or 100
ah this makes sense. i was always marveled by elden ring's graphics and performance but i recall that it was made in a custom engine
Building high fidelity games for maximum performance kinda clamps down a lot on what assets and effects you can use at any given time
Couldn't be me!
Lofi styles give you headroom to worry less about that
not being a game dev at all also gives you less headroom to worry less about that ๐
Quite so !
Before I disappear I note that I forgot to mention light probes
https://docs.unity3d.com/Manual/UsingReflectionProbes.html
They're kinda the third but a less significant part of baking
To get specular reflections you'll likely want one in your scene
Generally anything that's not moving should be set as reflection probe static, even the lanterns since they should show up in reflections
oh one last thing
i dont think this is a huge problem, but whenever i press "generate lighting", i get this error in my console
any idea what it means?
No clue, probably not related to what you're doing and probably not problematic
Usually those disappear on a restart
hmm this was happening before and after a restart but i cant identify any issues that this might be causing
