Continued with lighting
This commit is contained in:
parent
597a14743b
commit
e88d972ecc
12 changed files with 95 additions and 6 deletions
22
SMCode/SM2D/Light/LightObjects/LightObject.cs
Normal file
22
SMCode/SM2D/Light/LightObjects/LightObject.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
7
SMCode/SM2D/Light/LightObjects/PointLight.cs
Normal file
7
SMCode/SM2D/Light/LightObjects/PointLight.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
namespace SM2D.Light
|
||||
{
|
||||
public class PointLight : LightObject
|
||||
{
|
||||
internal override int Type { get; } = 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue