I am using a Model and Mesh and setting the vertex buffer index buffer on the mesh. The models are in an Entity. I am using a custom vertex format of Position (Vector3), Normal (Half4), Color (Color). I feel like the problem is it’s not using the normals since I just get a flat color.
Anyway, I create a pipeline with:
RenderPipelineLightingFactory.CreateDefaultForward(this, "VoxEffectMain", Color.SkyBlue, true, true);
And my directional light with (in an entity):
var directLight = CreateDirectLight(new Vector3(-1, 1, -1), new Color3(1, 1, 1), 0.2f, ShadowMapFilterType.Variance);
Entities.Add(directLight);
CreateDirectLight:
private Entity CreateDirectLight(Vector3 direction, Color3 color, float intensity, ShadowMapFilterType filterType)
{
return new Entity()
{
new LightComponent
{
Type = LightType.Directional,
Color = color,
Deferred = false,
Enabled = true,
Intensity = intensity,
LightDirection = direction,
Layers = RenderLayers.RenderLayerAll,
ShadowMap = false,
ShadowFarDistance = 3000,
ShadowNearDistance = 10,
ShadowMapMaxSize = 1024,
ShadowMapMinSize = 512,
ShadowMapCascadeCount = 4,
ShadowMapFilterType = filterType,
BleedingFactor = 0,
MinVariance = 0
}
};
}
And my shader looks like:
using SiliconStudio.Paradox.Effects.Data;
namespace Vox.Effects
{
shader VoxEffectMain
{
mixin ParadoxDefaultForwardShader;
mixin VertexColorShading; // adding this line changes from all black to flat color
};
}
I have no idea what I should put in the shader language. Do we have to use custom coded shaders?