Template:Archived Page History/Warning model lightmaps: Difference between revisions
SirYodaJedi (talk | contribs) mNo edit summary |
ShiroDkxtro2 (talk | contribs) m (Added $Bumpmap caveat, and explained why and how to fix) |
||
Line 5: | Line 5: | ||
-->{{workaround|Define a pre-baked {{ent|$lightmap}} in the [[VMT]] of the [[VertexLitGeneric]] material.}}<!-- | -->{{workaround|Define a pre-baked {{ent|$lightmap}} in the [[VMT]] of the [[VertexLitGeneric]] material.}}<!-- | ||
-->}}<!-- | -->}}<!-- | ||
-->{{warning|Model lightmaps generated with [[VRAD]] are compiled as | -->{{warning|Model lightmaps generated with [[VRAD]] are compiled as RGBA8888, which can result in noticeable color banding when brightly lit in HDR mode.<!-- | ||
-->{{workaround|<ul><li>Define a pre-baked{{how}} RGBA16f {{ent|$lightmap}} in the [[VMT]] of the [[VertexLitGeneric]] material.<li>Increase lightmap resolution (results may vary).</ul>}}<!-- | -->{{workaround|<ul><li>Define a pre-baked{{how}} RGBA16f {{ent|$lightmap}} in the [[VMT]] of the [[VertexLitGeneric]] material.<li>Increase lightmap resolution (results may vary).</ul>}}<!-- | ||
-->{{note|<ul><li>This issue may also appear when placing any light source too close to a surface.</ul>}}<!-- | |||
-->}}<!-- | |||
-->{{warning|Models using [[$bumpmap]] cannot receive lightmaps, they will fall back to vertex-lighting.<!-- | |||
-->{{note|<ul> | |||
There is an in-engine check that confirms whether or not the $bumpmap parameter is defined for a material, a custom shader cannot simply use both as there are a dozen technicalities that have to be overcome.<br> | |||
If $bumpmap or $phong is defined, the engine will not send the lightmap data to the shader.<br> | |||
For $bumpmap, a workaround for this is to use a differently named parameter. ( $NormalTexture ) to get the normal map and undefining $bumpmap.<br> | |||
However no static lighting data can be received by the shader, if the $bumpmap parameter is not set to anything. This refers to lights that are not named and are not inherently dynamic.<br> | |||
This may be prefered as the static light information is ALREADY prebaked in the lightmap, however it means you cannot receive direction information from the lights.<br> | |||
No light direction means no bumped lighting from the lightmap. Aka no specular highlights.<br> | |||
A fix for this would be modifying VRAD to spit out a lightmap that is *2 the size on the U axis and then storing an average light direction there or doing some other smart technique to 'memorize' light directions.<br> | |||
<br> | |||
This in-engine check also exists for $phong, however getting around the issue is more tricky. The default value of the integer parameter will be 0 even if not set in the vmt. Thus making $phong always be defined in a way.<br> | |||
</ul>}}<!-- | |||
-->}}<!-- | -->}}<!-- | ||
--></onlyinclude> | --></onlyinclude> |
Revision as of 15:00, 31 July 2023
Shows the following warnings:





- Define a pre-baked[How?] RGBA16f $lightmap in the VMT of the VertexLitGeneric material.
- Increase lightmap resolution (results may vary).

- This issue may also appear when placing any light source too close to a surface.


There is an in-engine check that confirms whether or not the $bumpmap parameter is defined for a material, a custom shader cannot simply use both as there are a dozen technicalities that have to be overcome.
If $bumpmap or $phong is defined, the engine will not send the lightmap data to the shader.
For $bumpmap, a workaround for this is to use a differently named parameter. ( $NormalTexture ) to get the normal map and undefining $bumpmap.
However no static lighting data can be received by the shader, if the $bumpmap parameter is not set to anything. This refers to lights that are not named and are not inherently dynamic.
This may be prefered as the static light information is ALREADY prebaked in the lightmap, however it means you cannot receive direction information from the lights.
No light direction means no bumped lighting from the lightmap. Aka no specular highlights.
A fix for this would be modifying VRAD to spit out a lightmap that is *2 the size on the U axis and then storing an average light direction there or doing some other smart technique to 'memorize' light directions.
This in-engine check also exists for $phong, however getting around the issue is more tricky. The default value of the integer parameter will be 0 even if not set in the vmt. Thus making $phong always be defined in a way.