shadow goodies

main
cosmonaut 2020-12-08 03:35:34 -08:00
parent ba994797b1
commit 2a2b481eca
3 changed files with 35 additions and 29 deletions

2
Kav

@ -1 +1 @@
Subproject commit 96f6d228966e900a511164a176d1f2ae1f1caaa4
Subproject commit 14e07c74768bb5a1432b27d089de28f1ec5c2710

View File

@ -214,10 +214,14 @@ namespace KavTest
// rustyBallModel
// ));
// WorldBuilder.SendMessage(new StaticModelSpawnMessage(
// new Transform3D(new Vector3(0, -3, 0), Quaternion.Identity, new Vector3(10f, 1f, 10f)),
// floorModel
// ));
WorldBuilder.SendMessage(new StaticModelSpawnMessage(
new Transform3D(
new Vector3(0, -15, 0),
Quaternion.Identity,
new Vector3(100f, 1f, 100f)
),
floorModel
));
WorldBuilder.SendMessage(new StaticModelSpawnMessage(
new Transform3D(
@ -250,7 +254,7 @@ namespace KavTest
var entity = WorldBuilder.CreateEntity();
WorldBuilder.SetComponent(entity, new Transform3DComponent(
new Transform3D(
new Vector3(i * 3, -1, j * 3)
new Vector3(i * 5, -1, j * 5)
)
));
WorldBuilder.SetComponent(entity, new InstancedCubeComponent());
@ -288,17 +292,17 @@ namespace KavTest
// new ModelComponent(cubeModel)
// );
for (var i = 0; i < 1; i++)
{
var start = new Vector3(-2, 5, 0);
//for (var i = 0; i < 1; i++)
//{
// var start = new Vector3(-2, 5, 0);
WorldBuilder.SendMessage(new LightBulbSpawnMessage(
new Transform3D(start, Quaternion.Identity, new Vector3(0.1f, 0.1f, 0.1f)),
RandomHelper.RandomColor(),
50f,
RandomHelper.RandomLoop(new System.Numerics.Vector3(-2, 5, 0), 2, 5, 3, 10)
));
}
// WorldBuilder.SendMessage(new LightBulbSpawnMessage(
// new Transform3D(start, Quaternion.Identity, new Vector3(0.1f, 0.1f, 0.1f)),
// RandomHelper.RandomColor(),
// 50f,
// RandomHelper.RandomLoop(new System.Numerics.Vector3(-2, 5, 0), 2, 5, 3, 10)
// ));
//}
var ambientLightEntity = WorldBuilder.CreateEntity();

View File

@ -260,12 +260,6 @@ namespace KavTest.Renderers
GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.Black, 1f, 0);
GraphicsDevice.DepthStencilState = DepthStencilState.Default;
// Renderer.GBufferRender(
// GBuffer,
// camera,
// ModelTransforms
// );
Renderer.RenderGBufferInstanced(
GBuffer,
DeferredTarget,
@ -301,7 +295,7 @@ namespace KavTest.Renderers
GraphicsDevice.Clear(Color.White);
}
Renderer.RenderPointShadowsIndexed(
Renderer.RenderPointShadowMapIndexed(
ShadowCubeMap,
camera,
MeshPartTransforms,
@ -326,14 +320,24 @@ namespace KavTest.Renderers
{
DirectionalShadowMapData.Clear(GraphicsDevice);
Renderer.RenderDirectionalShadowsIndexed(
Renderer.PrepareDirectionalShadowData(
DirectionalShadowMapData,
camera,
MeshPartTransforms,
directionalLight.Value
);
Renderer.RenderDirectionalLightToon(
Renderer.RenderDirectionalShadowsIndexed(
DirectionalShadowMapData,
MeshPartTransforms
);
Renderer.RenderDirectionalShadowsInstanced(
DirectionalShadowMapData,
InstancedModelContainer.CubeModel,
CubeTransforms
);
Renderer.RenderDirectionalLight(
DeferredTarget,
GPosition,
GAlbedo,
@ -341,9 +345,7 @@ namespace KavTest.Renderers
GMetallicRoughness,
DirectionalShadowMapData,
camera,
MeshPartTransforms,
directionalLight.Value,
false
directionalLight.Value
);
}