-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Improved smooth section lighting in shaders #251
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Commit entire chunks of light at a time - Share all light data between embeddings
- "Functional" arena based lighting for indirect - Strip out most of the reference counting stuffs for embeddings - Naively re-buffer all tracked light sections every frame
- Do embedded lighting in the fragment shader - Fix light coord being saturated
- Use naive trilinear interpolation when fetching embedded light
- Avoid adding all sections every frame - Remove sections when they are no longer needed - Rebuild the lut when sections are removed - Properly detect missing sections by writing 1-based indices to the lut
- Fix light being fetched from a section adjacent to the block a fragment actually resides in - Fix light always being missing
- Pass light updates to LightStorage so that we don't have to re-upload every tracked section every frame - Slightly optimize light section writing, still room for improvement - Remove dead code in LightStorage
- Sideport light lut stuffs to instancing engine - Move actual lookup logic to light_lut.glsl, and have backend mains provide functions to index the backing storages for sanity's sake - Standardize naming of lut and sections - Pull in pepper's loom fix, so I can build :lwe: - Allow specifying the internal format of texture buffers so light can be a simple uint array
- Expose light in the shader api - flw_light - for builtin smooth lighting, faster than can be implemented by materials alone - flw_lightFetch - for materials that want to go crazy, access to raw data
- Trim out dead light code from *EmbeddedEnvironment - Fix indirect never deleting empty culling groups - Fix embedded transforms not being applied
- Implement RogueLogix's normal-dependent smooth lighting function - Uses a lot of fetches, so I imagine occupancy is kinda bad
- Not attached to the name - Add SmoothLitVisual opt in interface, allowing any visuals to contribute light sections to the arena - Remove lightChunks from VisualEmbedding, it has been usurped - Pass total collected light sections from BEs, Es, and effects to the engine interface. It seemed the most proper way to hand off information from the impl to the backend - Add SmoothLitVisualStorage to maintain the set of collected sections, though at the moment it is very naive and simply unions everything upon request, which is also naively done every frame
- Only push light sections to the engine when the set of sections requested by visuals changes - Clean up light storage plan and comment code - Remove LIGHT_VOLUME debug mode as it's no longer used
- Optimize collecting light section edges - Kinda an absurd amount of code, but I'm not sure how to parameterize by an axis without having capturing lambdas - Around 3-4x faster
- Unused in flywheel and not a productive utility for others with the new features
- Deduplicate section tracking logic between Lit and SmoothLit - Now there is one SectionPropertyImpl which the 2 storages add listeners to
- Rename the light visuals to have distinct names - Rename SectionProperty -> SectionCollector because it isn't really a property
- Ensure section set returned by SectionTracker is Unmodifiable to avoid copy in LightUpdatedVisualStorage - Do not recompute section set in ShaderLightVisualStorage if not dirty - Fix BlockEntityStorage not clearing posLookup on recreation or invalidation - Fix Storage.invalidate not clearing everything - Inline TopLevelEmbeddedEnvironment and NestedEmbeddedEnvironment into AbstractEmbeddedEnvironment and rename to EmbeddedEnvironment - Move some classes between packages - Remove unused fields in EmbeddingUniforms - Remove suffix on field names in BufferBindings - Rename enqueueLightUpdateSection methods to onLightUpdate - Rename SectionCollectorImpl to SectionTracker - Rename classes, methods, fields, and parameters and edit javadoc and comments to match previously done renames, new renames, and other existing classes
PepperCode1
approved these changes
Jul 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SmoothLitVisuals may request that specific sections have their light uploaded to the GPU.
Uploaded sections are shared between all visuals/instances and available for query via a new shader API function.
Massive kudos to RogueLogix for their LUT scheme that allows for sparse storage of section light.