started work on toon shader
parent
b02d9efcd2
commit
754706f365
2
Kav
2
Kav
|
@ -1 +1 @@
|
|||
Subproject commit 66d4e5bf6e78949f6e5b2fc9eb1983d438047f0b
|
||||
Subproject commit 565be374bbb539ee652d0fa3b240bafb066bab18
|
|
@ -0,0 +1,15 @@
|
|||
using Encompass;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace KavTest.Components
|
||||
{
|
||||
public struct AmbientLightComponent : IComponent
|
||||
{
|
||||
public Color Color { get; }
|
||||
|
||||
public AmbientLightComponent(Color color)
|
||||
{
|
||||
Color = color;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -122,6 +122,12 @@ namespace KavTest
|
|||
));
|
||||
}
|
||||
|
||||
var ambientLightEntity = WorldBuilder.CreateEntity();
|
||||
|
||||
WorldBuilder.SetComponent(ambientLightEntity, new AmbientLightComponent(
|
||||
new Color(0.3f, 0.3f, 0.3f)
|
||||
));
|
||||
|
||||
WorldBuilder.SendMessage(new DirectionalLightSpawnMessage(
|
||||
Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.PiOver4),
|
||||
Color.LightGoldenrodYellow,
|
||||
|
|
|
@ -42,6 +42,21 @@ namespace KavTest.Renderers
|
|||
}
|
||||
}
|
||||
|
||||
private AmbientLight AmbientLight
|
||||
{
|
||||
get
|
||||
{
|
||||
if (SomeComponent<AmbientLightComponent>())
|
||||
{
|
||||
return new AmbientLight(ReadComponent<AmbientLightComponent>().Color);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new AmbientLight(Color.Black);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<PointLight> PointLights
|
||||
{
|
||||
get
|
||||
|
@ -118,10 +133,17 @@ namespace KavTest.Renderers
|
|||
// );
|
||||
// }
|
||||
|
||||
Renderer.DeferredRender(
|
||||
// Renderer.DeferredRender(
|
||||
// camera,
|
||||
// ModelTransforms,
|
||||
// PointLights,
|
||||
// DirectionalLight()
|
||||
// );
|
||||
|
||||
Renderer.DeferredToonRender(
|
||||
camera,
|
||||
ModelTransforms,
|
||||
PointLights,
|
||||
AmbientLight,
|
||||
DirectionalLight()
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue