Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function render() {
  2. if(has_children()) {
  3. for(child in children) {
  4. if(child.bounds.intersect(viewing_frustum)) {
  5. if(lod_threshold_reached) {
  6. draw_terrain_mesh();
  7. } else {
  8. child.render();
  9. }
  10. }
  11. }
  12. } else {
  13. draw_terrain_mesh();
  14. }
  15. }
  16.  
  17. function calc_cells_in_quadrilateral(frustum_projection_onto_2d_terrain_grid) {
  18. //calculate cells in the resulting quadrilateral projection of the frustum onto the grid without having to bounds test every cell
  19. //at some point based on distance from camera, assign lod
  20. }
  21. retrieve lod for each cell in the calculated set from lod grids
  22. have multiple (array2 or intmap) containing the terrain data at every lod for O(1) retrieval
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement