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

Modernized ray-tracing #62

Merged
merged 18 commits into from Jan 4, 2019

Conversation

@kvark
Copy link
Owner

commented Jan 1, 2019

Algorithm is based on Maximum Mipmaps for Fast, Accurate, and Scalable Dynamic Height Field Rendering.

  • update glutin and configuration
  • generate the max mipmap chain

vangers-maxmip

  • actually rewrite the raytracing algorithm
  • support dual layer
  • make it portable
@kvark

This comment has been minimized.

Copy link
Owner Author

commented Jan 2, 2019

Positive direction rays are almost perfect now:
vangers-raymax0-forward

@kvark kvark force-pushed the mipmap branch from 741c37a to 772b457 Jan 2, 2019

@kvark

This comment has been minimized.

Copy link
Owner Author

commented Jan 3, 2019

Debug mode matrix:
vangers-raymax-underworld

@kvark kvark changed the title [WIP] Modernized ray-tracing Modernized ray-tracing Jan 4, 2019

@kvark

This comment has been minimized.

Copy link
Owner Author

commented Jan 4, 2019

Dual layer is here 🎉 :
road16-raymax

@kvark kvark force-pushed the mipmap branch from 6e6f107 to 6c43f8c Jan 4, 2019

@kvark kvark force-pushed the mipmap branch from 3c7656b to 977ce98 Jan 4, 2019

@kvark

This comment has been minimized.

Copy link
Owner Author

commented Jan 4, 2019

I think the change is basically done. Of course quality/performance improvements are possible here and there, but this will always be the case.

The biggest concern is currently the portability of the change:

  • doesn't work on Mac/Intel (not sure about dedicated HW macs), since their GL doesn't support texture views
  • doesn't work on Linux/Intel, because of apparently a driver bug causing the shader to not see any mipmaps of sampler2DArray texture:
  • texelFetch with non-zero LOD always returns zero
  • textureLod with non-zero LOD always returns the data from the base LOD

With this in mind, I think we should proceed with the change, considering the follow-ups:

  1. another way to render the terrain that is way simpler than ray tracing or tessellation
  2. eventually port to wgpu-rs, which would resolve both the bugs and limited GL capabilities
@kvark

This comment has been minimized.

Copy link
Owner Author

commented Jan 4, 2019

Alright, I did the most reasonable thing for portability - brought back the old ray tracer, just as a fallback option. Time to ship this!
bors r+

bors bot added a commit that referenced this pull request Jan 4, 2019

Merge #62
62: Modernized ray-tracing r=kvark a=kvark

Algorithm is based on [Maximum Mipmaps for Fast, Accurate, and Scalable Dynamic Height Field Rendering](http://www.tevs.eu/project_i3d08.html).

- [x] update glutin and configuration
- [x] generate the max mipmap chain

![vangers-maxmip](https://user-images.githubusercontent.com/107301/50570732-26c75880-0d64-11e9-927e-f49307639174.png)

- [x] actually rewrite the raytracing algorithm
- [x] support dual layer
- [x] make it portable

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
@bors

This comment has been minimized.

Copy link
Contributor

commented Jan 4, 2019

@bors bors bot merged commit c04c036 into master Jan 4, 2019

3 checks passed

bors Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

bors bot added a commit that referenced this pull request Jan 5, 2019

Merge #64
64: Don't create SRVs of the height for mipmapping r=kvark a=kvark

This is a follow-up to #62 that makes it friendly to Macs and older GLs.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>

bors bot added a commit that referenced this pull request Jan 5, 2019

Merge #64
64: Don't create SRVs of the height for mipmapping r=kvark a=kvark

This is a follow-up to #62 that makes it friendly to Macs and older GLs.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>

@kvark kvark deleted the mipmap branch Jan 5, 2019

@kvark kvark referenced this pull request Jan 5, 2019

Closed

Fix ray skipped hills #47

bors bot added a commit that referenced this pull request Jan 6, 2019

Merge #64
64: Don't create SRVs of the height for mipmapping r=kvark a=kvark

This is a follow-up to #62 that makes it friendly to Macs and older GLs.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
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.