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

Terrain fixes #188

Merged
merged 31 commits into from
Nov 10, 2023
Merged

Terrain fixes #188

merged 31 commits into from
Nov 10, 2023

Conversation

Duttenheim
Copy link
Contributor

Fixes various things with the terrain.

  1. Resolve pass is replaced by normal geometry pass to get correct lighting.
  2. Terrain tiles render using instanced rendering.
  3. Reorganized some of the terrain passes in the frame script so that they happen in the right order.

Duttenheim and others added 21 commits November 9, 2023 14:43
Added API for creating a resource table set from shader.
Resolve pass needs to render all geometry again to properly calculate light, but uses Z equals to early out.
Terrain tiles render with instancing.
Terrain PSOs gets created during setup.
Merged together terrain lighting code so it works the same for lowress fallback and virtual sample.
Normals are calculated in the domain shader instead of relying on base mesh normals.
Fix order of operations, page clear now happens after the prepass and the page status copy to readback.
Removed the screen space resolve shader and passes.
Added a bunch of extra markers to the terrain code so it's clearer what's going on when debugging.
Failing to load biome textures reverts to using the system textures for albedo, normals and materials.
Move terrain sampling to function to minimize shader code and repetition.
New API requires getting the offset and buffer to pass to a future upload, since the buffer in question might be different between subsequent calls to upload.
Remove the header reimplementation of interlocked in favor of a common header and per-platform implemnentation.
Add AtomicInt, AtomicInt64 and AtomicPointer as types which disallow directly modifying or reading the value.
Utilize 64 bit atomics to keep the byte offset and buffer id in the same object.
This allows for the allocating thread to always know for which buffer allocation attempts where made, such that the appropriate buffer can be returned.
Remove bufferlock for UploadInternal, we should now treat the Upload buffer as being inherently threadsafe.
Replace use of std::pair with Util::Pair.
Reduce upload heap by half, but keep it big enough to fit at least an 8K BC7 texture.
@Duttenheim Duttenheim merged commit 1a01840 into master Nov 10, 2023
4 checks passed
@Duttenheim Duttenheim deleted the terrain-fixes branch November 10, 2023 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants