Continued with lighting

This commit is contained in:
Michel Fedde 2020-12-14 15:52:14 +01:00
parent 597a14743b
commit e88d972ecc
12 changed files with 95 additions and 6 deletions

View file

@ -0,0 +1,22 @@
using System.Collections.Generic;
using OpenTK.Graphics;
using SM.Base.Types;
using SM.OGL.Shaders;
namespace SM2D.Light
{
public abstract class LightObject
{
internal abstract int Type { get; }
public CVector2 Position = new CVector2(0);
public Color4 Color = Color4.White;
internal virtual void SetUniforms(Dictionary<string, Uniform> uniforms)
{
uniforms["Type"].SetUniform1(Type);
uniforms["Position"].SetUniform2(Position);
uniforms["Color"].SetUniform4(Color);
}
}
}

View file

@ -0,0 +1,7 @@
namespace SM2D.Light
{
public class PointLight : LightObject
{
internal override int Type { get; } = 0;
}
}