#material slots?

1 messages · Page 1 of 1 (latest)

thin raft
#

What program are you using to make the torches?

wide brook
#

blender

thin raft
#

Then yes, "material slots"

#

There's two concerns to consider
If your lightmap resolution is 10, that means 10 lightmap texels (texture pixels) per unit
If your torch is shorter than one unit, or close to that size in world space, then one lightmap texel may cover entire parts of the torch

#

Which causes light leaking

wide brook
#

So then do I just like make it bigger in blender and then apply the scale and shrink it in unity?

thin raft
#

The second concern is that lightmapping really works with continuous geometry, not separate overlapping bits of geometry, so if the pieces of the torch are kinda inside each other there isn't much of a way to generate lightmap UVs for them that'd "make sense"

thin raft
#

It could work, but with this kind of mesh it would be an inefficient brute-force solution

#

Most of your level's lightmap space would be spent on individual prongs of each torch

wide brook
#

Ok so, just combine all the parts, texture it like I would any other object whilst its unwrapped, and then adjust the scale inside the lightmap to ensure that everything fits?

#

Also, where is the Size in Lightmap setting

#

Is that just what this is?

thin raft
#

But before you adjust it, I'd use the UV charts view, or any view that lets you see the lightmap resolution per baked object

#

And just to check are your lights baked or mixed, and are you also baking Realtime GI?

wide brook
#

No realtime GI, lights are all baked, and this is what the UV charts looks like

#

Ok holy crap that was definitely the problem

thin raft
#

So, lightmap texels are extremely big relative to the mesh size
Likely due to wrong import size

#

If you don't export correctly, object size will be off by a factor of 100

#

As we see here

#

Best not to crop screenshots unnecessarily so details like these can be spotted

wide brook
#

there are things about the project I don't want to be public knowledge but sure

#

how do I fix this 100 scale thing in the future, it has happened to me several times

#

adjusting the scale properly I get this

thin raft
#

Or you can later apply a scale multiplier in import settings, and scale down your objects in prefab/scene

wide brook
#

alright

thin raft
#

The wall's lightmap UV is pretty terrible also

wide brook
#

yeah but that doesn't use UVs so it doesn't matter

thin raft
#

Doesn't use them?

thin raft
# wide brook

Also, here you have warnings that your Max Lightmap Size is too low, in lighting settings

#

Max Lightmap Size only determines when a lightmap is split into another texture, not how much lightmap space will be used

wide brook
thin raft
wide brook
#

clearly not because they work fine with the baked lighting as is

#

and I implemented triplanar mapping so that I didn't have to do exactly what you're saying I have to

thin raft
#

With the current lighting conditions it will not reveal an issue

#

Triplanar mapping is a separate thing, it cannot be used for lightmapping at all

wide brook
#

why does the light on the wall look completely fine then

thin raft
#

The issue is that the horizontal resolution is way too low, so it's stretched out
And the vertical resolution is way too high, so it wastes lightmap space

#

The light of the torches is smooth enough that the horizontal stepping won't appear

#

That means the excess vertical resolution is not necessary
Or it means that as soon as you have light or shadow that isn't so smooth, the stepping appears

wide brook
#

I'll cross that bridge when I come to it, it would take so long to fix the UVs of this level that I'd prefer not to

#

fixing the torch is fine for now

thin raft
wide brook
#

fair enough

#

also this is taking like 45 minutes just to render one torch on the wall, is that because of the segmented torch or is it always this slow?

thin raft
#

The torches now have much more lightmap texels to render
It doesn't look excessive, but it's possible that one of the pieces had the right (or maybe too big) size, lots of lightmap texels and now has more than a hundreds times of that

#

But from what I see the wall is the bigger culprit

#

It's lightmap resolution vertically is absurd, and it's big

wide brook
#

Should I turn down the scale on it or something?

thin raft
#

You could split it into smaller segments that are less stretched, and then decrease the scale in lightmap a lot

#

I assume they're just cubes you are stretching about

wide brook
#

yes

wide brook
#

and changing the scale made it worse, as soon as I made the scale smaller the time it took to bake jumped to tens of days

thin raft
#

Scale of what in this case?

wide brook
#

scale of lightmap on the walls

thin raft
#

Doesn't make a lot of sense to me
Smaller scale on lightmap means less texels to bake

wide brook
#

thats what I thought too but if I set it to 0.1 the ETA for baking starts at a month and gets bigger rapidly

thin raft
#

I still recommend a more limited test scene

wide brook
#

what would that fix lol

#

it would be the same objects

#

just in a different scene

thin raft
#

Where you're not baking the whole level each time, and can scale the wall and floor however needed
Or better yet substitute then with some unity primitive quads for the test

#

It would let you test baking the torch without also getting potential issues from the walls while at it

#

And then it lets you troubleshoot the walls without taking 45 minutes to do so, or at least by process of elimination telling you exactly what mesh and what setting really is ballooning the bake time

wide brook
#

ok the sun rises in about 20 minutes for me, so I'll whip it up really quick and then I'll be back tomorrow

thin raft
#

Eliminating unaccounted influences is crucial for effectively analysing issues

#

Also, occasionally do "clear lighting cache" between bakes and even restart the editor

#

When things happen that don't seem to make sense to us, they should be tested empirically

#

Otherwise it's easy to waste time due to dismissing potential causes on a hunch, and to not learn what the issue was or how to solve it later if solving it accidentally while trying out multiple things
Or causing more conflated issues while at it

wide brook
#

much nicer baked lighting