Plat 10869 cmf viewer axis for normals tangent and binormals#4
Merged
filipppavlov merged 26 commits intoJun 24, 2026
Merged
Conversation
Making a meshState object that contains the state of each mesh. Moving away from the equally sized collections of states on the model
Fixing the defect where the model that was loaded wasn't loaded as the animation owner
Added a shader for vertex colors. Since we can have multiple vertex attributes that can be visualized, I added support in the python script to create one shader for each usage index (but only if there are 2 vertex attributes required by the shader: position and the thing to visualize) I also added default shader selection
Add debug visualization for vertex normals, tangents and binormals. New GLSL shaders and a shared packed_tangent.inc helper were added (unpacked/packed/legacy variants and axis vertex/fragment shaders). Primitive and axis code were extended: axis primitives, creation helpers, and mesh-level PrimitiveRenderable instances are created/initialized and rendered conditionally. GraphicsEffect now defines a VertexUboData and supports vertexInputRate so axis rendering can use instance-rate vertex streams; ShaderCache uses this rate when creating pipelines. UI and AppState were extended with per-mesh and global toggles to show/hide normals/tangents/bitangents. Also refine CMake shader generation to only compile .comp/.vert/.frag files and simplify model_packed_normal shaders to include the shared packed tangent code. A small change was made to the shaderCacheCreator script to skip unknown shader types.
Rename and refactor orientation/gizmo primitives and effects, clean up shaders and misc fixes based on pr code review: - Rename Axis::Create -> Axis::CreateOrientationPrimitive and update callers (orientationGizmoRenderer, animationState). - Introduce CreateOrientationEffect and refactor PrimitiveEffects: move CreateAxisEffect implementation, add CreateOrientationEffect, use constexpr axis constants, and rework CreateFlatColorEffect placement. - Remove unused modelMatrix from tangent/normal/binormal vertex shaders. - Add callback invocations for showVertexNormals, showVertexTangents, showVertexBinormals in app state. - Improve SFINAE utility formatting in appState_template_impl.h. - Add padding to AxisConfig and update primitive header (remove SetBuffer API) and implementation (assert vertexBuffer non-null). - Move DEFAULT_SHADER_ORDER into anonymous namespace and minor formatting/spacing cleanups. - Fix typo in shaderCacheCreator.py (continueu -> continue) and tighten CMake shader-extension string comparisons. Also include small fixes for rendering call sites and mesh debug rendering argument formatting.
Disable per-mesh and global UI controls for normals, tangents and bitangents when meshes lack those vertex attributes. Adds hasNormals/hasTangents/hasBinormals flags to MeshUiState and populates them in UpdateUiState by inspecting the vertex declaration; wraps the corresponding ImGui controls with BeginDisabled/EndDisabled. Also minor cleanup in primitive effects: value-initialize AxisConfig and remove a padding field from the struct.
Changed the near and far clip calculations based on how far the boundingsphere center is in the view space, instead of euclidian eye to center space
…-Axis-for-normals-tangent-and-binormals
Add support for multiple vertex-usage indices and shader input declarations. Introduces GraphicsEffectTypes and ShaderInputDeclaration handling, updates GraphicsEffect APIs and many call sites to accept a usageIndex or shader input declaration. StateCollection gained templated AddState overloads and empty(), model/mesh code now tracks per-usage axis renderables (vectors) and uses State<std::pair<usageIndex,bool>> for per-index toggles. Shaders were annotated for multi_usage, shader cache and UI were updated to expose available shaders with their declarations and to present per-attribute checkboxes. Overall this enables proper handling of multiple normal/tangent/bitangent streams.
Implemented tri-state checkboxes in the UI for mesh display, wireframe, and audio occlusion controls, as well as per-attribute-index toggles for normals, tangents, and bitangents. Refactored related logic, improved tooltips, and added helper methods for managing tri-state states across multiple meshes.
…-Axis-for-normals-tangent-and-binormals
…-Axis-for-normals-tangent-and-binormals
…-Axis-for-normals-tangent-and-binormals
ccp-intern
commented
Jun 24, 2026
filipppavlov
approved these changes
Jun 24, 2026
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.
PR Classification
Refactor and feature addition to unify mesh state management and add per-mesh axis visualization.
PR Summary
This PR refactors mesh state handling to use a unified
MeshStatestruct, adds per-mesh normal/tangent/binormal visualization with new shaders and UI controls, and updates related rendering and state logic.StateCollection<MeshState>, updating all mesh property logic and callbacks.