Framework for mesh handeling #2

Open
opened 2023-12-22 16:46:53 +01:00 by Daniel · 0 comments
Owner

During the process of creating a cube sphere the following would make such things much easier (this might change once assimp is used, but this will be looked at for the "real" engine):

Add sealed class "Mesh" as well as "Material" (maybe also sealed)
Constructor of "Mesh" should register itself to be rendered

Mesh should look something like this:

class Mesh {
  float[] vertices
  float[] normals // either throw error when not same size as vertices or other error handling method
  float[] uv // do not need to be specified
  float[] indices // needed for ebo
  Material mat

  OnRender()
}

While constructing mesh/reconstructing mesh, the vbo has to have vertices and their normals and uv coord while ebo contains indices (look into whether these indices need to be different when normals etc are included?)

Material should have a Shader, if none is specified, a default shader should be used (one that can handle stuff like no uv defined etc. maybe factory pattern for different default shaders?)

During the process of creating a cube sphere the following would make such things much easier (this might change once assimp is used, but this will be looked at for the "real" engine): Add sealed class "Mesh" as well as "Material" (maybe also sealed) Constructor of "Mesh" should register itself to be rendered Mesh should look something like this: ```cs class Mesh { float[] vertices float[] normals // either throw error when not same size as vertices or other error handling method float[] uv // do not need to be specified float[] indices // needed for ebo Material mat OnRender() } ``` While constructing mesh/reconstructing mesh, the vbo has to have vertices and their normals and uv coord while ebo contains indices (look into whether these indices need to be different when normals etc are included?) Material should have a Shader, if none is specified, a default shader should be used (one that can handle stuff like no uv defined etc. maybe factory pattern for different default shaders?)
Daniel added the
enhancement
label 2024-01-03 21:50:06 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Daniel/Engine_silk.NET#2
No description provided.