allow lightmap coords to be modified by SetupMaterial
This commit is contained in:
parent
57f4fb1d37
commit
3ae7bf3911
2 changed files with 4 additions and 1 deletions
|
|
@ -63,7 +63,7 @@ vec4 getLightColor(Material material)
|
|||
//
|
||||
if (vLightmap.z >= 0.0)
|
||||
{
|
||||
color.rgb += texture(LightMap, vLightmap).rgb;
|
||||
color.rgb += texture(LightMap, vec3(material.LightmapCoord.xy, vLightmap.z)).rgb;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ struct Material
|
|||
float Metallic;
|
||||
float Roughness;
|
||||
float AO;
|
||||
vec2 LightmapCoord;
|
||||
};
|
||||
|
||||
vec4 Process(vec4 color);
|
||||
|
|
@ -51,6 +52,8 @@ void SetMaterialProps(inout Material material, vec2 texCoord)
|
|||
material.Base = getTexel(texCoord.st);
|
||||
material.Normal = ApplyNormalMap(texCoord.st);
|
||||
|
||||
material.LightmapCoord = vLightmap.xy;
|
||||
|
||||
// OpenGL doesn't care, but Vulkan pukes all over the place if these texture samplings are included in no-texture shaders, even though never called.
|
||||
#ifndef NO_LAYERS
|
||||
#if defined(TEXF_Brightmap)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue