projects
/
demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added IBR lighting from irradiance maps
[demo]
/
src
/
meshgen.cc
diff --git
a/src/meshgen.cc
b/src/meshgen.cc
index
c6a4f48
..
ddcd571
100644
(file)
--- a/
src/meshgen.cc
+++ b/
src/meshgen.cc
@@
-179,7
+179,7
@@
void gen_heightfield(Mesh *mesh, float xsz, float ysz, float height, int usub,
Vec3 bitangent = hfield_vertex(u, v + dv, calc_height(u, v + dv, ptr),
xsz, ysz, height) - vtx;
Vec3 bitangent = hfield_vertex(u, v + dv, calc_height(u, v + dv, ptr),
xsz, ysz, height) - vtx;
- Vec3 normal = normalize(cross(tangent, bitangent));
+ Vec3 normal = normalize(cross(bitangent, tangent));
mesh->vertices[vidx] = vtx;
mesh->normals[vidx] = normal;
mesh->vertices[vidx] = vtx;
mesh->normals[vidx] = normal;