#Thread

1 messages ยท Page 1 of 1 (latest)

solemn acorn
#

This is baked again, right?

icy stag
#

yeah

solemn acorn
#

Then I guess I'd make a new light next to it to see if that works

icy stag
#

wait it works now...

#

i changed it from mixed to baked and rebaked and it works...

solemn acorn
#

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?

icy stag
#

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

solemn acorn
#

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

icy stag
#

ah i see sorry for the confusion

solemn acorn
#

Because mixed lights have the realtime part to them, you might assume they "work" once you see the realtime light

icy stag
solemn acorn
#

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

icy stag
solemn acorn
#

First you should make the choice whether you're troubleshooting baked or realtime lights

#

Not get mixed up with Mixed

icy stag
#

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

solemn acorn
#

Are you sticking with Baked for now, though?

icy stag
#

yeah thats the goal

solemn acorn
#

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

icy stag
icy stag
#

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

solemn acorn
#

The GI debug views have modes for UV overlap and Texel Validity

#

Looks like there could be issues with either or both

icy stag
#

the overlap draw mode seems to be consistent with the blotches

#

actually not really?

solemn acorn
#

Invalid texels and UV overlaps are both big issues

icy stag
#

how do i fix that ๐Ÿ˜”

solemn acorn
#

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

icy stag
solemn acorn
#

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

icy stag
#

i'll try setting up a smaller scene

solemn acorn
#

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

icy stag
solemn acorn
#

If the light works when moved out of the lantern, it's possible you have multiple stacked lanterns some of which are static

icy stag
#

ok heres a smaller scene

solemn acorn
#

As you recall if a mesh shows up in texel validity or UV overlap views, they are GI static

icy stag
#

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?

solemn acorn
#

Well, are they GI static and receiving GI from lightmaps in the mesh renderer?

icy stag
#

oh whoops i thought they did with default settings

#

i'll try a rebake

solemn acorn
#

Most problems in this field are oversights of something that may seem obvious, and the solutions often are just triple checking such obvious things

icy stag
#

ok heres the new bake

solemn acorn
#

Even for me!

icy stag
solemn acorn
#

Much improved
UV overlap debug view should reveal problems still, but I'd also check texel validity again

icy stag
#

they both look fine on the tree...

#

what could this mean?

solemn acorn
#

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

icy stag
#

i cant really make out anything because of the size ๐Ÿ˜…

#

ill try a rebake with smaller size

solemn acorn
#

You can hit "View" to look closer

icy stag
#

oh

#

so what exactly am i looking for?

solemn acorn
#

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

icy stag
#

so this is all that correlates to the tree

#

wait this too

#

is it supposed to look like this?

solemn acorn
#

Probably

icy stag
#

the props look a lot clearer

solemn acorn
#

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

icy stag
#

this pic if from the inside of the leaves and i think youre right

solemn acorn
#

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

icy stag
solemn acorn
icy stag
#

oh whoops

#

i ticked it and now it looks like this

solemn acorn
#

Well it's trying

#

I'd like to see the Lightmap again zoomed in on the tree

icy stag
#

is it supposed to overlap with other objects?

solemn acorn
#

No, sure you baked again?

icy stag
#

oh, no i havent baked again

solemn acorn
#

All the friction you're experiencing now goes away with just practicing this process by repeating it and upping the complexity gradually

icy stag
#

rebake yields this UnityChanCelebrate

#

so do i just have to do this for all of my models?

solemn acorn
#

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

icy stag
#

i have 0 modeling experience so i wasnt aware of any of this before now ๐Ÿ˜…

solemn acorn
#

There is another way but I'm hesitant to recommend it

icy stag
#

PLEASE I'LL DO ANYTHING

solemn acorn
#

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

icy stag
solemn acorn
#

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

icy stag
#

mhm makes sense so far

solemn acorn
#

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

icy stag
#

so what are you implying exactly?

solemn acorn
#

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

#

But maybe you want to take the time to study it and to test it

icy stag
#

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

solemn acorn
#

Oh and also it only works on compute-capable devices
So most mobile and web platforms are out

icy stag
solemn acorn
#

(although some mobile devices are compute-capable, and while webGL isn't, the experimental webGPU is)

icy stag
#

Isn't everything webgl related experimental? ๐Ÿ˜†

solemn acorn
#

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

icy stag
#

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

solemn acorn
#

Just a lot of bakes in my test scene!

#

All it takes really ^^

icy stag
#

"All it takes" is taking too much ๐Ÿ˜

solemn acorn
#

Oh one more thing you might want to know
Mixed lights forgo any performance benefit you will get from baking lighting

icy stag
#

WHAT

#

So I was imaging my fps boost...

#

How delusional I am

solemn acorn
#

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!

icy stag
#

So how would I go about simulating lighting on moving objects without tanking performance?

#

I thought that's what mixed was for

solemn acorn
#

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)

icy stag
#

So how do AAA games do it while also allowing you to get 200+ fps?

solemn acorn
#

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

icy stag
solemn acorn
#

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

icy stag
solemn acorn
#

Quite so !

#

Generally anything that's not moving should be set as reflection probe static, even the lanterns since they should show up in reflections

icy stag
#

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?

solemn acorn
#

No clue, probably not related to what you're doing and probably not problematic
Usually those disappear on a restart

icy stag
#

hmm this was happening before and after a restart but i cant identify any issues that this might be causing