Continued with lighting
This commit is contained in:
parent
597a14743b
commit
e88d972ecc
12 changed files with 95 additions and 6 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using SM.Base.PostProcess;
|
||||
using SM.Base.Scene;
|
||||
using SM.OGL.Framebuffer;
|
||||
using SM.OGL.Shaders;
|
||||
using SM.Utility;
|
||||
|
||||
namespace SM2D.Light
|
||||
|
|
@ -18,6 +19,13 @@ namespace SM2D.Light
|
|||
_shader.Draw(main.ColorAttachments["color"], collection =>
|
||||
{
|
||||
collection["Ambient"].SetUniform4(sceneExtension.Ambient);
|
||||
collection["LightCount"].SetUniform1(sceneExtension.Lights.Count);
|
||||
UniformArray array = collection.GetArray("Lights");
|
||||
|
||||
for (int i = 0; i < sceneExtension.Lights.Count; i++)
|
||||
{
|
||||
sceneExtension.Lights[i].SetUniforms(array[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue