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

[WIP] Allow SDFGI, VoxelGI, ... reflections on lightmapped objects #86039

Closed
wants to merge 48 commits into from

Conversation

guerro323
Copy link

This complete a part of godotengine/godot-proposals#3012 (it doesn't address disabling VoxelGI reflections for SDFGI)

This add support for reflections from GI such as SDFGI onto lightmapped objects
image
(scene from https://sketchfab.com/3d-models/japanese-street-at-night-fb1bdcd71a5544d699379d2d13dd1171)

Simple scene:

  • The left part of the floor is a standard default material, the other part is a metallic with roughness set to 0.
  • The black cubes are material with roughness set to 0 and black color.
  • The grey cube is a 100% metallic white material.
  • The white cube is a 100% specular white material.
Lightmap Only Lightmap + SDFGI
image image
image image

Benefits and constraints

  • It help level designers dealing with less reflection probes, especially in complex scenes (such as rounded walls, complex corridors that aren't straight, etc...)
  • Reflection probes can still be used (as seen in my comment in the proposal) and blends well with the GI, it's mostly useful for cube shaped interiors.
  • There is a cost of using Lightmapped objects + SDFGI, but it's less than SDFGI only as we only apply the reflection buffer (further optimizations could be possible).
  • It doesn't work well with simple shapes with no textures if you crank the roughness to 0 and metallic to 100.

TODO:

  • Add VoxelGI reflections
  • Tests to see if everything work as expected
  • Benchmarks¹
  • Screenshots comparisons¹

Open Questions:

  • Optimizations? It is possible to optimize SDFGI to only care about reflection data?
  • An option to disable this effect? Would there be an use case to only have GI reflections only on non-lightmapped objects?

¹ I posted some screenshots and benchmarks here godotengine/godot-proposals#3012 (comment). I'll make some new one for this PR.

adamscott and others added 23 commits December 13, 2023 23:19
- Set `-sSTACK_SIZE` to what it was before emscripten 3.1.27.
  It was renamed in 3.1.25 so also set `-sTOTAL_SIZE` for older
  versions for consistency.
- Set `-sDEFAULT_PTHREAD_STACK_SIZE` to what it was before 3.1.30.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Adds query functions to get random points on navigation mesh to the NavigationServer.
…rial

These are needed to tweak sky exposure separately from background
…ixer

When a animation track doesn't have an keys, it's possible that we leak memory due the ERR_CONTINUE_MSG macro usage.

By checking the error condition first, we avoid a allocation and thus the leak.
Note: this change completely overwrites the meshoptimizer library source
(from git SHA c21d3be6ddf627f8ca852ba4b6db9903b0557858)
without including any patches; a distance error metric patch is still
needed and will be reapplied in the next commit.

The changes elsewhere are due to a signature change for
meshopt_simplifyWithAttributes.
This change replicates the distance-only metric patch which is now much
smaller and cleaner, as upstream simplifier already tracks distance and
attribute quadrics separately - it just doesn't store both errors in the
collapse structures.

The old two patches were removed as they are no longer needed.
The weight is per-attribute scalar (X, Y, Z), not per-vertex; this was
the case even before the library update so this appears to be an
oversight.
bruvzg and others added 24 commits December 13, 2023 23:19
This provides information for the debug monitors
This is useful to speed up iteration when working on the engine
(or editor).

This can be combined with a script that calls `adb` to deploy the APK
on a device (coupled with Godot's `--export-*` for projects)
to further speed up iteration.
This also documents `physics_ticks_per_second` not being automatically
adjusted, which can be important when speeding up simulation.
The type of the right operand is now taken into account.
- Improve behavior of SDFGI reflections combined with specular occlusion
- Add an optimized method for getting reflections from VoxelGI
@guerro323 guerro323 closed this Dec 13, 2023
@guerro323
Copy link
Author

guerro323 commented Dec 13, 2023

rebase failed sorry for the notifications :(

@guerro323 guerro323 deleted the lightmap-gi-reflection branch December 13, 2023 22:37
@AThousandShips AThousandShips removed this from the 4.x milestone Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.