mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
Merge branch 'main' into visuals-restoration
This commit is contained in:
commit
17ff87e458
1 changed files with 5 additions and 3 deletions
|
|
@ -340,10 +340,12 @@ void BlocksRenderer::blockCustomModel(
|
||||||
glm::vec4 aoColor {1.0f, 1.0f, 1.0f, 1.0f};
|
glm::vec4 aoColor {1.0f, 1.0f, 1.0f, 1.0f};
|
||||||
if (mesh.shading && ao) {
|
if (mesh.shading && ao) {
|
||||||
const float eps = 0.05f;
|
const float eps = 0.05f;
|
||||||
auto p = vcoord.x * X + vcoord.y * Y + vcoord.z * Z +
|
auto p = coord + vcoord.x * X + vcoord.y * Y + vcoord.z * Z +
|
||||||
r * 0.5f + t * 0.5f + n * eps;
|
r * 0.5f + t * 0.5f + n * eps;
|
||||||
p = coord + p;
|
auto p1 = p + n * eps;
|
||||||
aoColor = pickSoftLight(p.x, p.y, p.z, glm::ivec3(r), glm::ivec3(t));
|
auto p2 = p + n * 0.5f;
|
||||||
|
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)));
|
||||||
}
|
}
|
||||||
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