#Whats the right order to bake?

1 messages · Page 1 of 1 (latest)

minor seal
#

Whats the right order to make a scene in light & reflection matter?

First GI bake, then APV bake and finally reflection probe? Firstly bake APV, then bake reflections and then bake GI?

signal pebble
#

APV and reflections rely on GI so GI first

fair glacier
#

APV is baked GI.

minor seal
#

Also, can I bake the shadows of the static objects in order to reduce shadow casters? I couldnt make it with the values I thought it should work

oblique aurora
minor seal
#

@oblique aurora there is any documentation or tutorial teaching how to bake the shadows in order to reduce shadowcasters ? I tried directional mixed + mode shadowmask + static objects, it didnt baked the static objects shadows

#

My purpose is to have dynamic objects casting realtime shadows and static objects having their shadows baked, so they dont need to cast real-time shadows

oblique aurora
minor seal
oblique aurora
#

Does it mean the baking failed with an error
Or the lighting became visually artifacted
Or the result was just not what you expect
Or something else

minor seal
#

The static objects keep casting realtime shadows and their shadows on baking process didnt get baked on scenario

#

I thought the static objects would get their shadows recorded in scenario and this would prevent they cast shadows dynamically

minor seal
oblique aurora
#

Distance shadowmask renders realtime shadows from static objects up to shadow distance and baked shadows beyond that
Shadowmask always renders baked shadows only for static objects

#

So distance shadowmask is more expensive
Both mix realtime and baked shadows seamlessly though

#

It also seems to fail to demonstrate subtractive mode or to explain it properly

#

Which can be seen here
https://youtu.be/hMnetI4-dNY?t=2317
Which unfortunately only shows subtractive mode in action
Though notes that mixed lighting must not be disabled in settings for it to be rendered

minor seal
minor seal
#

I watched and it didnt clear my doubts. Cant I paint the shadows of a static object in textures and let the realtime lights only affect dynamic objects?

I thought that would be the approach everybody uses, because it makes no sense you make static objects reproduce shadows in realtime, since they wont move

oblique aurora
oblique aurora
#

Realtime shadows can be of significantly higher quality than baked direct shadows, because direct shadows can be rendered relative to camera position while baked shadows are hard limited by your lightmap size

#

Typically lightmap resolution becomes too big to be practical before you're at half of the resolution you can easily achieve with realtime shadows, so distance shadowmasking is the best option for quality

#

Shadowmask and subtractive on the other hand achieve the same result each but using different means, with subtractive using a cheaper, simpler method for blending

#

Baked indirect renders realtime shadows for static objects too, but doesn't do any blending
That means it can look as good as distance shadowmasking, but only at short ranges below the shadow distance
It can also be cheap because it doesn't do any shadow masking or blending operations, and while it does render static objects again for shadow casting passes, the expense of that depends on the complexity and number of those meshes

#

Typically the costly part of realtime shadows is the overhead of the pass and added shader complexity of using the produced realtime shadowmap, not the shadow casting geometry itself

minor seal
#

Oh, It was all good, the whole problem was that the option to swap shadowmask and distance shadowmask was in quality setting as you mentioned (and the video aswell).

Now all seems perfect! Thank you so much @fair glacier and @oblique aurora

minor seal
#

Oh one last question @oblique aurora, when adding reflection probe inside rooms, the probe should exceed the room space, like a room 5x5x5 → ref probe 6x6x6 or just covering the room interior, like a room 5x5x5 → ref probe 4.9x4.9x4.9 ? Im asking cause I used the last option and I got this result (lights on character body inside the dark room → sealed + no lights)

oblique aurora
minor seal
oblique aurora
#

But first of all things you should determine what exactly the objects are lit by
A light component or probes from whichever system you are using
And if there are reflections in that area as well

minor seal
#
  • I have 1 directional light - mixed (sun) → attatched img 1.
  • I baked GI with shadowmask → attatched img 2.
  • I have an APV for the entire scene → attatched img 3 & 4.
  • The dark room is made by primitives cubes as walls and roof. Those primitives are static shadowcasters and GI contributors → attatched img 5.
  • I have a reflection probe inside the dark room → attatched img 6.
oblique aurora
#

This indicates that the room's walls are baked using lightmaps and APVs provide GI for dynamic objects, so it's conceivable that they receive different lighting so you can't draw conclusions based on either one
If the walls and floors also used APVs, they would be the same

#

Reflection probes you can just select and look at directly, but to see what their result is at a specific point the most convenient way is probably to make a Lit material that's fully metallic and fully smooth and apply it to a default sphere moved to the point you want to examine
Rendering debugger does have a debug mode for reflections, which could be more helpful here as it'd override all renderers and provide information over a larger area

minor seal
#

I finished rebaking GI, now Im rebaking APV, and I will look de debugs

oblique aurora
minor seal
#

Oh, so I dont need to go into the apv components and press bake there after bake GI? Good to know

minor seal
#

Shadowmask:

  • img 1 → scene.
  • img 2 → dark room.
oblique aurora
#

These aren't exactly the debug views I suggested you use

#
  1. Debug draw modes for visualizing baked lightmaps, to confirm that lightmapped surfaces do show illumination where they are in light, and only darkness where they're not
  2. Rendering debugger for visualizing APVs, to examine where the probes are placed by the APV and what lighting they show in the dark room
  3. Rendering debugger or a chrome material to examine reflection probes and reflections in general, to rule out them reaching the dark room
#

It's good to become familiar with all the debugging options, but in this case your main goal is to find out where the light is coming from and what type it is that affects the dynamic objects in occluded areas

minor seal
#

img 1 → the drop menu from rendering debugger > lighting

I can select some features to show. When I select GI, the character inside dark room is not illuminated. While keeping the GI selected, if I select Main Light aswell, the character inside the dark room is illuminated

oblique aurora
#

That does indicate that it's your directional light that is getting into the dark room the most, specifically its realtime part

#

That's why I think you should examine APVs and reflections specifically

minor seal
#

Also, if I change a small thing on scene, like move an object for 0.1 unit, the baking process, if I rebake GI, still taking a long time?

oblique aurora
oblique aurora
minor seal
#

Im finishing rebaking and I will follow steps 1, 2, 3 that you mentioned

oblique aurora
#

It's basically a simulation from millions of raycasts to determine how light travels and bounces between each texel/probe and light source
It'd be practically impossible to determine how to do that only partially and still get correct results

minor seal
#

It makes sense, I thought the system might keep the data about what changed from the last bake in comparison with the current solicitation, in terms of objects position/rotation in scene, and only focused in those changes, but that would generate many possible erros

minor seal
#

Ok, lets start for the 3 step:

2 points:

  1. selecting by probe shading mode "Validity" it shows this red spheres (img 1), and they are crossing the entire scene, passing through the dark room.

  2. When I debug selecting the pixel, it clears shows that the char is being affected by probes outside the dark room (img 2).

My conclusion: the blending area between the dark room APV (it has its own) and the scene general APV is making the character get the outside probe values.

My questions:

  • Should I increase the size of the dark room APV ?
  • Why there is those red probes (probably not valid ones) ?
oblique aurora
#

But also based on earlier most of the light is probably from your directional light
You can double check that by disabling the light
And triple check with Light Explorer to verify there are no rogue light components around

minor seal
#
  • img 1 → light on.
  • img 2 → light off.
  • img 3 → light explorer = just one light.
oblique aurora
#

0.12345 on all axes is quite good because it's not a value you're ever likely to hit with any division of a grid

#

For the light leaking in second image you likely need smaller probe minimum distance
Either for the whole scene or in and around the house
Normally APVs add more density automatically where it's neaded

#

But your probes are very sparse

#

So virtual offsets would not be enough to fix it, even though those are usually the most useful tool for it

minor seal
#
  • The house apv should exceed his size or not transpassing its internals walls?
oblique aurora
#

Exceed a little, if the minimum distance is smaller so you get more probes outside the walls too and the darkness doesn't leak out from inside either

#

But generally you don't need multiple APVs at all, as the system can allocate blocks of different densities in these situations automatically

#

For the directional light the mystery remains why the realtime shadowing seems to fail to occlude the room

#

While baked shadowing succeeds

minor seal
oblique aurora
oblique aurora
minor seal
oblique aurora
minor seal
#

Ok, I kept the subdiv from scene apv on 1.5 ~ 13.5 and changed the house apv subdiv to 0.5 ~ 1.5 and now the dark room if completely dark, the char dont get illuminated by nothing and all is working as intended

#

Last question (I guess ^^): should I use skybox reflection for the general scene or to have a central refl probe placed or multiple refl probes?

oblique aurora
oblique aurora
#

The only limits to how many reflection probes you can have is practicality of setting up a lot of them, and transitions between them becoming noticeable if too frequent

minor seal
oblique aurora
#

Max is a balancing act
Max closer to Min means empty space is likely to filled with unnecessary probes
But further from Min requires more Bricks, meaning chunks of different resolution

#

Bricks require memory to be allocated per each size of Brick

#

And they (maybe still) cannot be blended together at transition areas

minor seal
#

Humm, I got the principles! You help me a LOT!! Thanks so MUCH!

#

May I ask why do you help me?

oblique aurora
# minor seal May I ask why do you help me?

Nothing personal really
But many reasons to, as it tests my knowledge, practices my communication technique, helps the community and collectively reduces time lost on trial and error
And lighting is an engaging topic in general

minor seal
#

I really appreciate!

minor seal
#

@oblique aurora I read and play around with APV and I could solve almost all problems, but this one:

Dynamic objects (the cube in this case) dont get the right shadow/light probe sampling in the shadow border.

The problem is that the object get sampling from a probe outside the shadows. I could apply offset, but it would make probes that are correctly positioned in the opposite side get an offset aswell and bring light from outside or invalidity from inside geometry.

Do you have any sugestion?

minor seal
#

Applying an 0.12345 offset on all axis fix that shadow problem, but as I said it creates new ones:

  • inside the dark room the illuminated probes from outside went inside.
  • invalid probes from below the ground (plane) went up and didnt generate lighting on objects base.
oblique aurora
#

Usually the thickness of walls is enough to conceal the transition, which can be aided by probe adjustment volumes

minor seal
minor seal
#

Also, with the Y offset, the base of objects loses the probe and gets an invalid one from below the floor

oblique aurora
minor seal
oblique aurora
#

And neither side will see leaking

minor seal
oblique aurora
#

If it must be really really thin, there's also the option to separate the outer half and inner side of the wall as well as the floor and use light layers to isolate the inner and outer lighting totally

#

The tent part of this video shows how that can be done