Skip to content

#2 Load models from obj files - #108

Merged
Av3boy merged 52 commits into
devfrom
2-temp-2
May 3, 2025
Merged

Av3boy merged 52 commits into
devfrom
2-temp-2

Conversation

@Av3boy

@Av3boy Av3boy commented Apr 22, 2025

Copy link
Copy Markdown
Owner

#2 Load .obj mesh

Contents

This PR is trying to resolve:
The engine needs the ability to load both primitive types and custom models. Custom models are a key factor in any rendering engine.

We resolve it by:
Tried to use a custom implementation which for a reason or another does not work. To use an intermediate solution that works, marked a Model_Old class as obsolete and used it to load models.

The approach in this PR has an issue where the textures are not being loaded correctly. This will be fixed in an upcoming PR to keep the changes small enough.

Checklist

  • I have merged the latest changes from main to my branch.
  • I have tested my changes and any affected components.
  • I have added the proper documentation about my changes
  • I have made sure there is no overlapping work.
  • I have discussed any / all issues brought up from code review.

@Av3boy
Av3boy requested a review from Copilot April 22, 2025 20:48
@Av3boy Av3boy self-assigned this Apr 22, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR revisits the model loading approach to support custom .obj mesh files by switching from using the Material‐ and Mesh‑based assignment to a Model property, and it updates logging calls to use Debug.Log instead of Console.WriteLine.

  • Changed property assignment in BlockBase to use Model instead of separately assigning Material and Meshes.
  • Updated logging calls across Editor files with Debug.Log methods and added structured logging parameters.
  • Removed several core files (e.g. Texture, Shader, MeshService, etc.) as part of refactoring to transition to a new model loading approach.

Reviewed Changes

Copilot reviewed 180 out of 184 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Examples/MinecraftClone/Block/BlockBase.cs Updated assignment to use Model instead of Material/Meshes.
Editor/Windows/PropertiesWindow.cs Replaced Console.WriteLine with Debug.Log.Error and updated exception variable.
Editor/Windows/ImGuiWindowBase.cs Updated logging calls and TODO comment with new reference.
Editor/Windows/AssetsWindow.cs Adjusted TODO comment numbering.
Editor/Windows/ActionsMenuWindow.cs Replaced log methods with structured logging and updated TODOs.
Editor/Program.cs Revised logging calls and exception handling naming consistency.
Editor/EditorWindow.cs Numerous logging updates and TODO renumbering for clarity.
(Multiple Core files: TextureService.cs, Texture.cs, Shader.cs, MeshService.cs, Mesh.cs, Material.cs, GameObject.cs, Debug.cs, IRenderable.cs) Removed outdated or obsolete core files as part of the refactoring.
Files not reviewed (4)
  • Core/Shaders/shader.frag: Language not supported
  • Core/SharpEngine.Core.csproj: Language not supported
  • Directory.Build.props: Language not supported
  • Editor/SharpEngine.Editor.csproj: Language not supported

@Av3boy Av3boy added enhancement New feature or request mesh rendering Rendering related issues / questions core The issue is related to the Core library. test Something needs testing (unit test or manual) spike Something that needs investigation / needs an answer labels Apr 22, 2025
@sonarqubecloud

sonarqubecloud Bot commented May 3, 2025

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
7 Security Hotspots

See analysis details on SonarQube Cloud

@Av3boy

Av3boy commented May 3, 2025

Copy link
Copy Markdown
Owner Author

The issues reported by sonar cloud are mostly related to the known issues and the unsafe code blocks are marked as obsolete so they are find to push to dev. They will be addressed before release.

@Av3boy
Av3boy merged commit aeca04e into dev May 3, 2025
@Av3boy
Av3boy deleted the 2-temp-2 branch May 3, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core The issue is related to the Core library. enhancement New feature or request mesh rendering Rendering related issues / questions spike Something that needs investigation / needs an answer test Something needs testing (unit test or manual)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants