Skip to content

Commit

Permalink
Builtin classes refactoring
Browse files Browse the repository at this point in the history
New component to draw dynamic geometry with custom materials
  • Loading branch information
Selinux24 committed Jul 27, 2024
1 parent 5ca3a25 commit 698570c
Show file tree
Hide file tree
Showing 69 changed files with 592 additions and 158 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

namespace Engine
namespace Engine.BuiltIn.Components.Cubemap
{
/// <summary>
/// Cube map geometry enumeration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Engine
namespace Engine.BuiltIn.Components.Cubemap
{
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Cubemap;
using Engine.BuiltIn.Primitives;
using Engine.Common;
using Engine.Content;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using SharpDX;

namespace Engine
namespace Engine.BuiltIn.Components.Cubemap
{
/// <summary>
/// Cube-map description
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

namespace Engine
namespace Engine.BuiltIn.Components.Cubemap
{
using Engine.Common;

Expand Down
1 change: 1 addition & 0 deletions Engine/BuiltIn/Components/Decals/DecalDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Engine.BuiltIn.Components.Decals
{
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Decals;
using Engine.BuiltIn.Primitives;
using Engine.Common;
using Engine.Content;

Expand Down
1 change: 1 addition & 0 deletions Engine/BuiltIn/Components/Foliage/FoliageBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Primitives;
using Engine.Common;
using System;

Expand Down
3 changes: 2 additions & 1 deletion Engine/BuiltIn/Components/Foliage/FoliagePatch.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Engine.Collections;
using Engine.BuiltIn.Primitives;
using Engine.Collections;
using Engine.Common;
using SharpDX;
using System;
Expand Down
1 change: 1 addition & 0 deletions Engine/BuiltIn/Components/Ground/Scenery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace Engine.BuiltIn.Components.Ground
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Deferred;
using Engine.BuiltIn.Drawers.Forward;
using Engine.BuiltIn.Primitives;
using Engine.Collections.Generic;
using Engine.Common;
using Engine.Content;
Expand Down
1 change: 1 addition & 0 deletions Engine/BuiltIn/Components/Ground/Terrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Engine.BuiltIn.Components.Ground
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Common;
using Engine.BuiltIn.Drawers.Deferred;
using Engine.BuiltIn.Primitives;
using Engine.Common;
using Engine.Content;

Expand Down
1 change: 1 addition & 0 deletions Engine/BuiltIn/Components/Ground/TerrainGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Engine.BuiltIn.Components.Ground
{
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Primitives;
using Engine.Collections.Generic;
using Engine.Common;

Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Model/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public override bool Draw(DrawContext context)
continue;
}

var drawer = GetDrawer(context.DrawerMode, mesh.VertextType, false);
var drawer = BuiltInDrawer.GetDrawer(context.DrawerMode, mesh.VertextType, false);
if (drawer == null)
{
continue;
Expand Down
7 changes: 4 additions & 3 deletions Engine/BuiltIn/Components/Model/ModelInstanced.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Engine.BuiltIn.Components.Models
{
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Primitives;
using Engine.Common;

/// <summary>
Expand Down Expand Up @@ -152,7 +153,7 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
BufferManager.RemoveInstancingData(InstancingBuffer);
BufferManager.RemoveInstancingData<VertexInstancingData>(InstancingBuffer);
InstancingBuffer = null;
}

Expand Down Expand Up @@ -182,7 +183,7 @@ public override async Task ReadAssets(ModelInstancedDescription description)
/// <inheritdoc/>
public override async Task InitializeAssets()
{
InstancingBuffer = BufferManager.AddInstancingData($"{Name}.Instances", true, Description.Instances);
InstancingBuffer = BufferManager.AddInstancingData<VertexInstancingData>($"{Name}.Instances", true, Description.Instances);

foreach (var drawable in GetDrawingDataCollection())
{
Expand Down Expand Up @@ -493,7 +494,7 @@ private int DrawMesh(DrawContext context, DrawingData drawingData, ModelInstance
continue;
}

var drawer = GetDrawer(context.DrawerMode, mesh.VertextType, true);
var drawer = BuiltInDrawer.GetDrawer(context.DrawerMode, mesh.VertextType, true);
if (drawer == null)
{
continue;
Expand Down
1 change: 1 addition & 0 deletions Engine/BuiltIn/Components/Particles/ParticleSystemCPU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Engine.BuiltIn.Components.Particles
{
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Particles;
using Engine.BuiltIn.Primitives;
using Engine.Common;
using Engine.Content;

Expand Down
1 change: 1 addition & 0 deletions Engine/BuiltIn/Components/Particles/ParticleSystemGPU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Engine.BuiltIn.Components.Particles
{
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Particles;
using Engine.BuiltIn.Primitives;
using Engine.Common;
using Engine.Content;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Engine.BuiltIn.Components.Primitives
{
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Forward;
using Engine.BuiltIn.Primitives;
using Engine.Common;

/// <summary>
Expand Down
Loading

0 comments on commit 698570c

Please sign in to comment.