Commit Graph

151 Commits

Author SHA1 Message Date
fe49e57330 Merge pull request 'feat: implement ClusterLOD C# bindings in Ghost.Graphics.Meshlet' (#2) from Julian/GhostEngine:develop into develop
Reviewed-on: #2
Reviewed-by: Misaki <misaki_39@outlook.com>
2026-03-17 03:52:12 +00:00
2376fc9414 fix: resolve all build errors in Meshlet LOD pipeline
- Use correct UnsafeList constructor (int capacity, Allocator)
- Use .Count instead of .Length for UnsafeList
- Cast GetUnsafePtr() to typed pointers explicitly
- Use Api.meshopt_* constants (not MeshOptApi) for simplify flags
- Use meshopt_Meshlet instance methods BuildsFlex/BuildsSpatial
- Use correct meshopt_Meshlet field names (vertex_offset, triangle_offset, etc.)
- Fix byte constant overflow with unchecked cast in LockBoundary
- Add Ghost.MeshOptimizer project reference to Ghost.Graphics.csproj
2026-03-17 03:14:09 +00:00
0a3502b858 refactor: optimize memory for mega-meshes and fix collection usage
- Switch large/dynamic collections from StackScope to Allocator.Temp/Persistent to prevent stack overflow
- Remove redundant Resize calls; use capacity in constructor + Add or AsSpan().Fill for initialization
- Correctly propagate Allocator parameter for returned collections
- Ensure all temporary collections are properly disposed before returning
- Refine ClodBuilder, ClodPartition, ClodBoundsHelper, and ClodSimplify for high-scale mesh processing
2026-03-17 02:34:42 +00:00
22fdae1061 cleanup: remove obsolete Clod.cs file 2026-03-17 02:21:01 +00:00
92c503b253 refactor: address PR review feedback on meshlet LOD system
- Remove WORK_SUMMARY.md
- Use Debug.Assert for stride validation in ClodBuilder
- Fix ClodBuilder.Build return value after cluster disposal
- Update ClodPartition to accept AllocationHandle for return collections
- Standardize on camelCase for public fields in ClodConfig, ClodMesh, ClodBounds, etc.
- Remove redundant Resize calls where capacity suffices or Add is used
- Enforce stack allocator usage for internal temporary collections
- Ensure proper allocator propagation for collections returned from methods
2026-03-17 02:18:37 +00:00
f7fb7da496 fix: correct API calls and cleanup documentation
- Replace .Ptr with .GetUnsafePtr() for UnsafeList access
- Use proper MeshOptApi method names (CamelCase): ComputeClusterBounds, BuildMeshletsBound, PartitionClusters, etc.
- Fix SimplifyVertex_Protect constant access
- Remove IMPLEMENTATION_COMPLETE.md
- Rename AGENT_GUIDELINES.md to AGENT.md
2026-03-17 00:23:42 +00:00
2ba60c4bae refactor: improve unsafe collection API usage per review
- Replace float[3] with Vector3 (System.Numerics)
- Use UnsafeList.GetUnsafePtr() instead of fixed blocks
- Use AllocationManager.CreateStackScope() for temporary collections
- Remove redundant properties in ClodConfig (public fields suffice)
- Use MeshOptApi directly instead of Api alias
- Fix method signatures to not require allocator for stack-scoped collections
2026-03-16 23:55:19 +00:00
f2b68955b1 docs: comprehensive implementation summary 2026-03-16 16:12:33 +00:00
85a000e5c4 docs: add work summary for clusterlod translation 2026-03-16 16:05:02 +00:00
301a6d1c45 feat: translate clusterlod to C# and restructure to Ghost.Graphics.Meshlet 2026-03-16 16:01:57 +00:00
e831b71a79 feat(bindings): update C# wrappers for meshopt, nvtt, ufbx
Refactor and regenerate native C# bindings for Ghost.MeshOptimizer, Ghost.Nvtt, and Ghost.Ufbx to match updated native APIs and improve usability.
- Replace meshoptimizer.dll with newer version.
- Move meshoptimizer functions to static methods in partial class; add new meshlet, simplification, quantization features.
- Remove enum wrappers in favor of constants; delete meshopt_Allocator.cs.
- Regenerate native wrappers with PascalCase naming, XML doc comments, and aggressive inlining.
- Implement IDisposable for resource structs; update configs for naming, documentation, and method mapping.
- Update user code to use new wrapper classes and method names.
- Improve documentation and comments for clarity.

BREAKING CHANGE: API surface changes, wrapper class and method names updated, enum wrappers removed, custom allocator deleted.
2026-03-17 00:19:54 +09:00
9bae3e647e docs(README): rewrite and expand documentation
Major rewrite of the README for Ghost.NativeWrapperGen:
- Clarifies project purpose, design, and intended usage.
- Adds concrete code examples of generated wrappers.
- Updates CLI usage and provides validated command lines.
- Replaces old config schema docs with detailed tables for all config fields, including new `remaps` and `actions`.
- Documents the new config-driven routing and remapping system.
- Explains the action-based method routing with conditions and apply steps.
- Details naming conventions and method name derivation.
- Provides a full, modern config example for nvtt.
- Updates recommended workflow for wrapper regeneration and build.
- Emphasizes the design principle of keeping policy in config.
- Removes outdated sections and limitations.
- Improves formatting and accessibility for new users.
2026-03-15 21:15:52 +09:00
6cadd8edeb feat(nativegen)!: refactor to struct-based native wrappers
Major overhaul of native wrapper generation for ufbx and nvtt.
Replaces all hand-written and class-based wrappers with auto-generated partial struct wrappers that directly expose native API methods via pointers. Introduces a new JSON-driven configuration system using "remaps" and "actions" for flexible parameter/return mapping and method routing. Removes legacy config sections and helper classes, focusing solely on method wrappers. Updates all usages and tests to use the new pointer-based API. Cleans up obsolete code and ensures resource management is handled via struct Dispose methods. The result is a thinner, more direct, and maintainable interop layer.

BREAKING CHANGE: All managed wrapper classes and helpers are removed in favor of struct-based pointer wrappers. API usage and resource management patterns have changed.
2026-03-15 20:48:54 +09:00
3e4084c42a Added ufbx warper 2026-03-15 02:19:40 +09:00
cce1cf7256 Added Ufbx 2026-03-14 18:29:18 +09:00
254b08bc81 Added doc folder 2026-03-14 12:33:12 +09:00
912b320d8f Fixed compilation errors;
Added MaterialPalette
2026-03-14 12:27:49 +09:00
8a3b40b4f8 Refactor MeshInstance 2026-03-13 15:10:25 +09:00
619720feee Render extraction system & ECS/graphics refactor
Introduced RenderExtractionSystem for entity-based render data extraction. Added MeshInstance and MeshPalette components with shadow casting support. Refactored QueryBuilder API, SharedComponentStore, and component registration for clarity and flexibility. Updated SystemManager and SystemGroup to use SystemAPI. Replaced RenderingConfig with GraphicsEngineDesc/RenderSystemDesc. RenderFrame now uses CPU/GPU fence values for sync. Removed Camera.cs in favor of ECS-based rendering. Improved Material, RenderingLayerMask, Mesh, and RenderList APIs. Updated package references and fixed naming, error handling, and disposal issues.
2026-03-08 22:51:03 +09:00
bfe8588d76 Refactor render pipeline and resource management APIs
Split IFenceSynchronizer/IRenderSystem interfaces for clarity. Refactor D3D12GraphicsEngine to use IFenceSynchronizer. Update RenderGraph and context to use explicit resource manager/database/allocator references. Add multi-buffering methods to IRGBuilder (stub). Support history access for multi-frame resources. Remove legacy RenderPipelineBase; introduce IRenderPipelineSettings and sealed GhostRenderPipeline. Clean up resource aliasing and pool logic. Improve modularity and future extensibility.
2026-03-03 20:14:22 +09:00
b8af6e8c3a Added RenderPipelineBase 2026-03-02 19:06:19 +09:00
5e42d699c3 Added RenderList and RenderReques.
Added IRenderPipeline.
2026-02-28 21:31:38 +09:00
6f802ac12b Added CopyTexture support in ICommandBuffer 2026-02-26 21:40:07 +09:00
162b71f309 Refactor render graph error handling and resource APIs
- RenderGraph.Compile/Execute now return Error for better failure detection; error handling is propagated throughout compiler and executor.
- Renamed ScheduleReleaseResource to ReleaseResource for clarity; updated all usages.
- ResourceManager now calls ReleaseResource directly on Mesh, Material, and Shader types.
- Camera exposes Actual/Virtual size properties and Render returns Error.
- RenderingContext now uses IResourceManager for mesh/resource ops.
- Replaced custom BinaryWriter with BufferWriter in RenderGraphHasher.
- Improved variable naming, interface signatures, and code formatting.
- Added Error extension for IsSuccess/IsFailure.
- Minor FMOD/native interop and test code cleanups.
- No breaking API changes except for new Error return values on some methods.
2026-02-25 19:08:54 +09:00
30090f84ab Refactor rendering projects 2026-02-24 20:08:26 +09:00
93c58fa7fb Add Ghost.Nvtt C# wrapper and integrate nvtt texture pipeline
- Introduce full managed C# wrapper for NVIDIA Texture Tools (nvtt) with safe handle classes, idiomatic APIs, and managed callback support.
- Integrate Ghost.Nvtt into Ghost.Editor.Core and Ghost.MicroTest; update TextureAssetHandler to use the new nvtt wrapper for texture compression.
- Add comprehensive end-to-end binding test (NvttBindingTest).
- Refactor D3D12 resource management: add deferred/immediate release APIs, update allocator/database usage, and ensure proper resource cleanup.
- Update project files for new native DLL layout and dependency versions.
- Minor API cleanups: EditorApplication properties, D3D12 input layout, and removal of obsolete code.
- Update shaders, tests, and documentation for new APIs and usage patterns.
2026-02-23 17:13:10 +09:00
78e3b4ef31 Merge branch 'develop' of https://github.com/misakieku/GhostEngine into develop 2026-02-18 00:52:23 +09:00
db8ca971a8 Refactor folder structure 2026-02-18 00:52:18 +09:00
638417d4f0 Refactor folder structure 2026-02-18 00:50:46 +09:00
426786397c Modify AssetService 2026-02-05 19:25:48 +09:00
9bbccfc8f8 Update ContextFlyout 2026-02-05 13:52:53 +09:00
eadd13931f Updating ProjectBrowser 2026-02-04 19:08:18 +09:00
59991f47d5 Update editor 2026-02-03 21:49:14 +09:00
9fcf06dbe4 Update icon assets 2026-02-01 01:54:04 +09:00
6505099667 Fixed the issue where the test does not cleanup the temp folder 2026-02-01 01:53:19 +09:00
d263f0c7e1 Imporving AssetDatabase 2026-01-30 21:20:18 +09:00
9f05944d81 Improve AssetDatabase performance. 2026-01-29 20:37:45 +09:00
e71851550b Update asset database 2026-01-29 14:03:24 +09:00
8a5795069f Update AssetDatabase 2026-01-27 14:39:00 +09:00
b505c7c1c0 backup 2026-01-26 22:55:14 +09:00
8d82c0a750 Update plan 2026-01-26 15:58:19 +09:00
8df0b46960 Update scene graph 2026-01-26 13:59:33 +09:00
06a150b899 Fix error 2026-01-26 11:47:00 +09:00
49f54c6b43 Add scene graph draft 2026-01-25 22:06:58 +09:00
fdf831630b feat: implement complete scene graph system with hierarchical editor support
- Add SceneNode and EntityNode classes for editor-only metadata storage
- Implement SceneGraph view-model with O(1) entity lookup via internal caching
- Create IdRemapTable for file-local to global entity ID remapping on load
- Implement SceneSerializationContext for load/save operation tracking
- Add JSON-serializable SceneAssetData, EntityData, and ComponentData models
- Implement SceneSerializer for save/load with validation and reference remapping
- Add comprehensive documentation: README.md, IMPLEMENTATION_GUIDE.md, SYSTEM_SUMMARY.md
- Update Ghost.Editor.Core.csproj to reference Ghost.Entities assembly
- Support parent-child relationships via Hierarchy component
- Enforce no cross-scene entity references
- Keep runtime minimal: only SceneID, Hierarchy, LocalToWorld components
- All editor metadata (names, UI state) stored in editor-only SceneNode/EntityNode classes

This implements the architecture from SceneGraph Plan.md with clean separation of concerns,
minimal runtime footprint, and AOT compatibility.
2026-01-25 21:42:03 +09:00
ba5dc2159e Remove old SceneGraph 2026-01-25 21:18:16 +09:00
0201f0fc33 Add simple scene graph 2026-01-25 18:37:45 +09:00
364fbf9208 Refactor error handling: use Error enum, update APIs
Replaces ErrorStatus with Error across all systems for consistency.
Renames ResourceBarrierData fields to camelCase.
Adds BindlessAccess enum and updates GetBindlessIndex API.
Updates method signatures, result types, and error checks.
Modernizes HLSL mesh shader syntax and fixes naming.
Improves code style and updates comments for clarity.
2026-01-25 16:34:28 +09:00
e11a9ebb52 Refactor render graph: modular compilation & execution
Major overhaul of render graph system for modularity and performance:
- Split compilation and execution logic into dedicated classes (Compiler, Executor, NativePassBuilder, Barriers)
- Overhauled barrier system: now uses CompiledBarrier with target state only, querying before state at execution
- Resource size/alignment now queried from D3D12 device for accurate heap allocation
- ResourceDesc now includes Type field and asserts correct union access
- Centralized D3D12 interop logic in D3D12Utility extensions
- Added RenderGraphHasher for structural graph hashing and cache invalidation
- RenderGraph class simplified to orchestrate specialized components
- ResourceAliasingManager now uses allocator for size queries
- Compilation cache now stores compiled barriers, reducing memory usage
- Improved comments, debug assertions, and removed redundant code

Result: more maintainable, efficient, and robust render graph pipeline.
2026-01-23 18:12:52 +09:00
4173ff2432 Refactor RenderGraph barrier/state tracking system
Major overhaul of resource barrier and state tracking in RenderGraph:
- Introduce ResourceBarrierData for explicit (layout, access, sync) tracking.
- Separate aliasing and transition barriers; explicit aliasing support.
- Remove BufferHint; infer buffer usage from BufferUsage flags.
- Update TextureAccess/BufferAccess to include usage requirements.
- Improve enums (BarrierSync, BarrierAccess, BarrierLayout) for D3D12 alignment.
- Update D3D12CommandBuffer to use new barrier data and error handling.
- Make D3D12DescriptorHeap a class; add ReleaseSampler to IResourceDatabase.
- Reset resource pools and aliasing managers each frame.
- Batch and flush barriers efficiently per pass.
- Update HLSL mesh shader macros to [NumThreads].
- Remove obsolete code and improve documentation.
This refactor improves correctness, extensibility, and prepares for advanced features.
2026-01-22 20:51:58 +09:00