Fix heightmap shadow rt and draw the light pos
This commit is contained in:
@@ -286,7 +286,6 @@ bool HeightmapPlane::create(float w, float h, const Image& img, float scale, flo
|
||||
}
|
||||
|
||||
// generate indices
|
||||
const glm::vec3 yscale(1, height, 1);
|
||||
for (int y = 0; y < div; y++)
|
||||
{
|
||||
int i = y * (div + 1);
|
||||
@@ -298,8 +297,8 @@ bool HeightmapPlane::create(float w, float h, const Image& img, float scale, flo
|
||||
*pi++ = i;
|
||||
*pi++ = i + div + 2;
|
||||
*pi++ = i + 1;
|
||||
auto n = glm::triangleNormal(xyz(vertices[i].pos) * yscale,
|
||||
xyz(vertices[i + div + 1].pos) * yscale, xyz(vertices[i + 1].pos) * yscale);
|
||||
auto n = glm::triangleNormal(xyz(vertices[i].pos),
|
||||
xyz(vertices[i + div + 1].pos), xyz(vertices[i + 1].pos));
|
||||
vertices[i].nor += n;
|
||||
vertices[i + 1].nor += n;
|
||||
vertices[i + div + 1].nor += n;
|
||||
|
||||
Reference in New Issue
Block a user