emil28092005
e740cf1214
fix: compute face normals when OBJ has no vn lines
...
- ObjLoader.ParseFace: if no normals in OBJ, compute face normal from
first triangle using MeshMath.ComputeFaceNormal and apply to all face vertices
- cube.obj has no vn lines, so all faces previously had normal (0,1,0)
- Now each face has correct outward-facing normal for proper lighting
2026-06-18 12:42:13 +03:00
emil28092005
2e0970e769
feat: rebuild Vulkan renderer from scratch — pure P/Invoke triangle (Vulkan 1.3)
...
- Complete rewrite of Engine.Graphics.Vulkan with pure P/Invoke (no wrapper libs)
- Vulkan 1.3: dynamic rendering (vkCmdBeginRendering/vkCmdEndRendering),
synchronization2 (vkQueueSubmit2, vkCmdPipelineBarrier2)
- Split types into VulkanHandles.cs, VulkanEnums.cs, VulkanStructs.cs
- Staging buffer → device-local vertex buffer pattern
- Correct swapchain semaphore indexing (per-image, not per-frame-in-flight)
- VK_EXT_debug_utils debug messenger with validation layer fallback
- Dynamic viewport/scissor (no pipeline recreation on resize)
- Simplified Program.cs to triangle-only rendering
- Removed old Silk.NET renderer, ImGui, PBR shaders, screenshot code
- Updated VULKAN_IMPLEMENTATION_PLAN.md with full architecture decisions
2026-06-18 01:49:25 +03:00
emil28092005
80238b08f5
feat: pure Vulkan P/Invoke renderer — no wrappers, SDL3 window, SPIR-V shaders
...
- Engine.Graphics: restored interfaces (IRenderContext, IRenderer, RenderBackendFactory),
loaders (ObjLoader, GltfLoader), ProceduralMesh, MeshMath, SceneSerializer
- Engine.Graphics.Vulkan: pure P/Invoke to libvulkan.so.1/vulkan-1.dll
- VulkanNative: library loading, function pointer loading via vkGetInstanceProcAddr
- Vk: static function cache for ~80 Vulkan functions, all delegate types
- VulkanTypes: ~50 structs, ~20 enums matching Vulkan C headers
- VulkanContext: instance, physical device, logical device, surface, memory types
- VulkanSwapchain: swapchain, image views, depth image, render pass, framebuffers
- VulkanPipeline: graphics pipeline, descriptor set layout, shader modules
- VulkanBuffer: vertex/index/uniform buffers, staging, memory allocation
- VulkanRenderer: command buffers, sync (semaphores/fences), render loop, 2 frames in flight
- GLSL 450 shaders: PBR lighting (Fresnel, ACES, gamma), directional+point lights
- Compiled to SPIR-V via @webgpu/glslang WASM
- CortexEngine.App: switched to vulkan backend, removed Raylib/OpenTK/ImGui refs
- Tests: all 66 pass (ObjLoader, MeshMath, ProceduralMesh, SceneSerializer, etc.)
- Camera tour: 16 poses, screenshots captured, clean shutdown
2026-06-17 23:03:24 +03:00
emil28092005
dd105ea4af
chore: remove all graphics backends (Raylib, OpenTK, Vulkan/Silk.NET) — prepare for pure Vulkan P/Invoke rewrite
2026-06-17 22:12:51 +03:00
emil28092005
2d30dec01c
feat: Dear ImGui editor, GLTF materials, scene serialization
...
- ImGuiLayer: entity inspector (Transform/Material/Light/Camera editing),
hierarchy panel, debug overlay with FPS graph (rlImgui-cs + ImGui.NET)
- GltfLoader.LoadWithMaterials: extracts PBR albedo, roughness, metallic,
base color texture from glTF files
- SceneSerializer: save/load ECS world to/from JSON with custom
Vector3/Quaternion converters, 6 tests
- ImGui disabled in tour/test mode to keep screenshots clean
- 66/66 tests passing
2026-06-17 14:12:02 +03:00
emil28092005
fb6e26a268
feat: modular HAL, Raylib backend, PBR shading, textures, 60 unit tests
...
- Replace hardcoded SDL3 windowing with IWindow/IInputState/Key abstractions
- Each render backend owns its window (Raylib GLFW, SDL3 for Vulkan)
- Raylib backend: DrawModelEx, custom GLSL shader with Fresnel, ACES
tonemapping, gamma correction, hemisphere ambient
- Fix backface culling, mesh memory (NativeMemory.Alloc), texture loading
- Camera controllers use backend-agnostic Key enum (inverted yaw/strafe)
- Demo scene: 8 cubes, 7 spheres, torus knot OBJ with checker texture
- Extract ProceduralMesh + MeshMath from Program.cs to Engine.Graphics
- Vulkan backend deferred (compiles, untested, IWindow-compatible)
- 60 unit tests: ObjLoader, camera controllers, AiCommandProcessor,
RenderBackendFactory, Timing, ProceduralMesh, MeshMath, Transform
- AGENTS.md for opencode integration
2026-06-17 13:49:12 +03:00
emil28092005
98a429710a
feat: directional lighting with per-face normals
...
- Add Normal to Vertex struct and vertex input pipeline.
- Update vertex/fragment shaders with push-constant light data (direction, color, ambient).
- Compute per-face normals in ObjLoader and GltfLoader for flat shading.
- Add Transform.TransformNormal() using inverse-transpose of the model matrix.
- MeshRenderer builds world-space normals and pushes light constants each frame.
- Recompile SPIR-V shaders.
2026-06-16 20:18:20 +03:00
emil28092005
05703f820f
feat: Step 4 load .obj and glTF models into ECS
...
- Add Vertex struct and Mesh ECS component (vertices + indices).
- Add Vulkan IndexBuffer for indexed draws.
- Add MeshRenderer that draws Mesh + Transform entities with vkCmdDrawIndexed.
- Add minimal .obj loader (positions, faces) and glTF/glTF-binary loader via SharpGLTF.Core.
- Rewrite shaders to 3D position + color; recompile to SPIR-V.
- Update VulkanPipeline for new vertex format.
- Ship a sample Content/cube.obj and wire Program.cs to load it.
- Remove TriangleRenderer (replaced by MeshRenderer).
2026-06-16 19:15:20 +03:00