mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
improve soft lights calculation for blocks with custom model
This commit is contained in:
parent
6608163e55
commit
5dd2a700cd
1 changed files with 8 additions and 1 deletions
|
|
@ -349,7 +349,14 @@ void BlocksRenderer::blockCustomModel(
|
||||||
auto p1 = p + n * eps;
|
auto p1 = p + n * eps;
|
||||||
auto p2 = p + n * 0.5f;
|
auto p2 = p + n * 0.5f;
|
||||||
aoColor = pickSoftLight(p1.x, p1.y, p1.z, glm::ivec3(r), glm::ivec3(t));
|
aoColor = pickSoftLight(p1.x, p1.y, p1.z, glm::ivec3(r), glm::ivec3(t));
|
||||||
aoColor = glm::max(aoColor, pickSoftLight(p2.x, p2.y, p2.z, glm::ivec3(r), glm::ivec3(t)));
|
if (!block.lightPassing) {
|
||||||
|
aoColor = glm::max(
|
||||||
|
aoColor,
|
||||||
|
pickSoftLight(
|
||||||
|
p2.x, p2.y, p2.z, glm::ivec3(r), glm::ivec3(t)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this->vertex(
|
this->vertex(
|
||||||
coord + vcoord.x * X + vcoord.y * Y + vcoord.z * Z,
|
coord + vcoord.x * X + vcoord.y * Y + vcoord.z * Z,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue