Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smooth lighting #73

Closed
bfops opened this issue Oct 28, 2014 · 8 comments

Comments

@bfops bfops added the aesthetic label Oct 28, 2014

@bfops

This comment has been minimized.

Copy link
Owner Author

commented Dec 8, 2014

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 bfops self-assigned this Dec 10, 2014

@bfops bfops assigned bfops and unassigned bfops Dec 23, 2014

@bfops

This comment has been minimized.

Copy link
Owner Author

commented Dec 25, 2014

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.

@bfops

This comment has been minimized.

Copy link
Owner Author

commented Dec 25, 2014

It seems kind of difficult for a vertex in a block to figure out it "corresponds" to vertex from a neighboring block.

@bfops

This comment has been minimized.

Copy link
Owner Author

commented Dec 27, 2014

normals per-vertex instead of per-triangle 7098580

@bfops

This comment has been minimized.

Copy link
Owner Author

commented Dec 27, 2014

calculate averaged vertex normals within each tile 607aeb9

@bfops

This comment has been minimized.

Copy link
Owner Author

commented Dec 27, 2014

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.

@bfops

This comment has been minimized.

Copy link
Owner Author

commented Dec 27, 2014

per-block smoothing 23257c4

@bfops

This comment has been minimized.

Copy link
Owner Author

commented Dec 29, 2014

Generate normals locally by sampling the noise function for an approximate derivative 9328f4c

@bfops bfops closed this Dec 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.