Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a user-toggleable “backface culling” feature to the LightViewer pipeline, exposed through C++ (sync/async) and the Python bindings, and implemented in the default rainbow shader via fragment discards based on view-space normals.
Changes:
- Expose
enable_backface_culling(),disable_backface_culling(), andbackface_culling_enabled()onLightViewerContext(plus async wrappers) and bind them to Python. - Add a
GLCanvasflag, plumbing it into the shader uniformbackface_culling_enabled. - Update
rainbow.vert/.fragto compute a view-space normal and discard fragments deemed back-facing when the feature is enabled.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/python/guik.cpp |
Adds Python bindings for backface-culling toggles/query on LightViewerContext. |
src/guik/viewer/light_viewer_context.cpp |
Implements LightViewerContext backface-culling toggles/query by delegating to GLCanvas. |
src/guik/viewer/async_light_viewer_context.cpp |
Adds async invocations for partial rendering + backface-culling toggles. |
src/guik/gl_canvas.cpp |
Stores backface-culling state and forwards it to shaders via a uniform. |
include/guik/viewer/light_viewer_context.hpp |
Declares the new LightViewerContext backface-culling API. |
include/guik/viewer/async_light_viewer_context.hpp |
Declares async backface-culling + partial-rendering API. |
include/guik/gl_canvas.hpp |
Declares GLCanvas backface-culling API/state. |
data/shader/rainbow.vert |
Computes view-space normal when backface culling is enabled. |
data/shader/rainbow.frag |
Discards fragments based on the view-space normal when enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+88
to
+92
| if (backface_culling_enabled && length(frag_normal) > 0.1) { | ||
| frag_normal_view = normalize((view_matrix * vec4(frag_normal, 0.0)).xyz); | ||
| } else { | ||
| frag_normal_view = vec3(0.0, 0.0, 0.0); | ||
| } |
This file contains hidden or 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
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.
No description provided.