Difference between revisions of "Vertex Lightmaps"
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
* Normal texture compression techniques do not apply. | * Normal texture compression techniques do not apply. | ||
* Modified shader needed ([[Manual#Bakery_shaders|Bakery includes such shaders]]). | * Modified shader needed ([[Manual#Bakery_shaders|Bakery includes such shaders]]). | ||
− | * Denoising is not applied. | + | * Denoising is not applied. [EDIT] The new [[Github_access|patched version]] adds support for multiple samples per triangle, effectively denoising and anti-aliasing the values. |
The data is stored in following vertex attributes: | The data is stored in following vertex attributes: | ||
* Mesh.colors stores the color lightmap (or first coefficient of the SH lightmap). | * Mesh.colors stores the color lightmap (or first coefficient of the SH lightmap). | ||
− | * Mesh.uv2 can store packed dominant direction, shadowmask and part of SH data. | + | * Mesh.uv2 can store packed dominant direction, MonoSH, shadowmask and a part of full SH data. |
* Mesh.uv3 can store additional SH data. | * Mesh.uv3 can store additional SH data. |
Latest revision as of 16:53, 21 April 2024
Objects can be baked on per-vertex level instead of having textures, if they or their parent have a Lightmap Group Selector component with a Lightmap Group asset set to Vertex mode.
Vertex lightmaps are compatible with shadowmasks, as well as Dominant Direction and SH modes.
There are pros and cons using vertex baking.
Pros:
- No UVs needed. Suitable for complex geometry that is impossible to unwrap well.
- No space wasted - padding and empty spaces in the lightmap are not a problem.
Cons:
- Obviously vertex interpolation is less subtle than texel interpolation.
- Normal texture compression techniques do not apply.
- Modified shader needed (Bakery includes such shaders).
- Denoising is not applied. [EDIT] The new patched version adds support for multiple samples per triangle, effectively denoising and anti-aliasing the values.
The data is stored in following vertex attributes:
- Mesh.colors stores the color lightmap (or first coefficient of the SH lightmap).
- Mesh.uv2 can store packed dominant direction, MonoSH, shadowmask and a part of full SH data.
- Mesh.uv3 can store additional SH data.