Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upsmooth lighting #73
Comments
bfops
added
the
aesthetic
label
Oct 28, 2014
This comment has been minimized.
This comment has been minimized.
|
This should hold off until #84 is done; lazy terrain generation will add some wrinkles into calculation of per-vertex normals, since they might need to be updated as more terrain is generated. |
bfops
self-assigned this
Dec 10, 2014
bfops
assigned
bfops and unassigned
bfops
Dec 23, 2014
This comment has been minimized.
This comment has been minimized.
|
When a new block is generated, normals should be calculated for every triangle. Per-vertex normals will be created by averaging out the normals for the triangles that touch each vertex. For vertices that lie on the edge of the block, this means that we'll have to look at adjacent blocks to get all the triangles. If those blocks don't exist, then we'll calculate the vertex normals from the available information, and update the averages when those blocks are generated. |
This comment has been minimized.
This comment has been minimized.
|
It seems kind of difficult for a vertex in a block to figure out it "corresponds" to vertex from a neighboring block. |
This comment has been minimized.
This comment has been minimized.
|
normals per-vertex instead of per-triangle 7098580 |
This comment has been minimized.
This comment has been minimized.
|
calculate averaged vertex normals within each tile 607aeb9 |
This comment has been minimized.
This comment has been minimized.
|
Next step is to have vertex normals be the average of all the triangle normals they touch, including across tile boundaries (but not across block boundaries). The final part is smoothing across block boundaries too, detailed a little above. |
This comment has been minimized.
This comment has been minimized.
|
per-block smoothing 23257c4 |
This comment has been minimized.
This comment has been minimized.
|
Generate normals locally by sampling the noise function for an approximate derivative 9328f4c |
bfops commentedOct 28, 2014
http://www.reddit.com/r/rust_gamedev/comments/2k66gy/playform_a_progress_report/cllza4f