add some more test models

pull/1/head
cosmonaut 2020-10-01 22:27:41 -07:00
parent 754706f365
commit eed61d126d
6 changed files with 74 additions and 18 deletions

2
Kav

@ -1 +1 @@
Subproject commit 565be374bbb539ee652d0fa3b240bafb066bab18 Subproject commit 2fb20747e4978d1b745cde76a1bcac452dfd34e7

BIN
KavTest/Content/bluetorus.glb (Stored with Git LFS) Normal file

Binary file not shown.

BIN
KavTest/Content/pinkcone.glb (Stored with Git LFS) Normal file

Binary file not shown.

BIN
KavTest/Content/redcylinder.glb (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -50,8 +50,14 @@ namespace KavTest
var rustyBallModel = Kav.ModelLoader.Load( var rustyBallModel = Kav.ModelLoader.Load(
GraphicsDevice, GraphicsDevice,
Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/rustysphere.glb")) Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/rustysphere.glb")
)
); );
rustyBallModel.DisableNormalMaps();
rustyBallModel.DisableAlbedoMaps();
rustyBallModel.Albedo = Color.DeepSkyBlue;
var lightBulbModel = Kav.ModelLoader.Load( var lightBulbModel = Kav.ModelLoader.Load(
GraphicsDevice, GraphicsDevice,
@ -68,6 +74,30 @@ namespace KavTest
Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/avocado.glb")) Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/avocado.glb"))
); );
var redCylinderModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/redcylinder.glb")
)
);
var pinkConeModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/pinkcone.glb")
)
);
var blueTorusModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/bluetorus.glb")
)
);
WorldBuilder.AddEngine(new InputEngine(this)); WorldBuilder.AddEngine(new InputEngine(this));
WorldBuilder.AddEngine(new AngularVelocityEngine()); WorldBuilder.AddEngine(new AngularVelocityEngine());
WorldBuilder.AddEngine(new MoveAlongCurve3DEngine()); WorldBuilder.AddEngine(new MoveAlongCurve3DEngine());
@ -94,22 +124,40 @@ namespace KavTest
// new Vector3(-1, 1, 1) // new Vector3(-1, 1, 1)
// )); // ));
WorldBuilder.SendMessage(new StaticModelSpawnMessage(
new Transform3D(new Vector3(0, 1, 0), Quaternion.Identity, new Vector3(1f, 1f, 1f)),
rustyBallModel
));
WorldBuilder.SendMessage(new StaticModelSpawnMessage( WorldBuilder.SendMessage(new StaticModelSpawnMessage(
new Transform3D(new Vector3(0, -3, 0), Quaternion.Identity, new Vector3(10f, 1f, 10f)), new Transform3D(new Vector3(0, -3, 0), Quaternion.Identity, new Vector3(10f, 1f, 10f)),
floorModel floorModel
)); ));
var entity = WorldBuilder.CreateEntity(); WorldBuilder.SendMessage(new StaticModelSpawnMessage(
WorldBuilder.SetComponent(entity, new Transform3DComponent(
new Transform3D( new Transform3D(
new Vector3(0, 1, 0), new Vector3(-3, 1, 0),
Quaternion.CreateFromAxisAngle(Vector3.Right, -Microsoft.Xna.Framework.MathHelper.PiOver2), Quaternion.CreateFromAxisAngle(
new Vector3(30, 30, 30)) Vector3.Right,
) -Microsoft.Xna.Framework.MathHelper.PiOver2
); ),
WorldBuilder.SetComponent(entity, new ModelComponent(avocadoModel)); new Vector3(1f, 1f, 1f)
),
blueTorusModel
));
WorldBuilder.SendMessage(new StaticModelSpawnMessage(
new Transform3D(
new Vector3(3, 1, 0),
Quaternion.CreateFromAxisAngle(
Vector3.Right,
-Microsoft.Xna.Framework.MathHelper.PiOver2
),
new Vector3(1f, 1f, 1f)
),
pinkConeModel
));
for (var i = 0; i < 1; i++) for (var i = 0; i < 1; i++)
{ {
var start = RandomHelper.RandomVector3(-5, 5); var start = RandomHelper.RandomVector3(-5, 5);
@ -125,11 +173,11 @@ namespace KavTest
var ambientLightEntity = WorldBuilder.CreateEntity(); var ambientLightEntity = WorldBuilder.CreateEntity();
WorldBuilder.SetComponent(ambientLightEntity, new AmbientLightComponent( WorldBuilder.SetComponent(ambientLightEntity, new AmbientLightComponent(
new Color(0.3f, 0.3f, 0.3f) new Color(0.4f, 0.4f, 0.4f)
)); ));
WorldBuilder.SendMessage(new DirectionalLightSpawnMessage( WorldBuilder.SendMessage(new DirectionalLightSpawnMessage(
Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.PiOver4), Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.Pi / 3f),
Color.LightGoldenrodYellow, Color.LightGoldenrodYellow,
0.7f 0.7f
)); ));

View File

@ -19,6 +19,7 @@ namespace KavTest.Renderers
{ {
foreach (var entity in ReadEntitiesAsEnumerable<ModelComponent>()) foreach (var entity in ReadEntitiesAsEnumerable<ModelComponent>())
{ {
/* FIXME: this transformation should definitely not go here */
var transformComponent = GetComponent<Transform3DComponent>(entity); var transformComponent = GetComponent<Transform3DComponent>(entity);
var modelComponent = GetComponent<ModelComponent>(entity); var modelComponent = GetComponent<ModelComponent>(entity);
if (HasComponent<OverrideAlbedoComponent>(entity)) if (HasComponent<OverrideAlbedoComponent>(entity))
@ -29,11 +30,8 @@ namespace KavTest.Renderers
{ {
foreach (var meshPart in mesh.MeshParts) foreach (var meshPart in mesh.MeshParts)
{ {
if (meshPart.Effect is DeferredPBR_GBufferEffect gBufferEffect) meshPart.DisableAlbedoMap = true;
{ meshPart.Albedo = overrideAlbedoComponent.Color;
gBufferEffect.AlbedoTexture = null;
gBufferEffect.Albedo = overrideAlbedoComponent.Color;
}
} }
} }
} }
@ -136,6 +134,7 @@ namespace KavTest.Renderers
// Renderer.DeferredRender( // Renderer.DeferredRender(
// camera, // camera,
// ModelTransforms, // ModelTransforms,
// AmbientLight,
// PointLights, // PointLights,
// DirectionalLight() // DirectionalLight()
// ); // );