05.01.2021
+ Bloom effect + PixelInformation + Many Summaries + Add-methods for CVectors + Exposure-Field in GenericCamera for HDR. ~ ColorAttachments now can have PixelInformation ~ Transformed MeshAttributes to a own class ~ Fixed the non-applying of transformations at texts ~ Added more information to the context ~ Improved Pipeline-Process. ~ Changed how Uniform takes arrays - Light system
This commit is contained in:
parent
9b917ac181
commit
4c18127c88
52 changed files with 697 additions and 373 deletions
|
|
@ -39,7 +39,7 @@ namespace SM_TEST
|
|||
|
||||
window = new GLWindow2D {Scaling = new Vector2(0, 1000)};
|
||||
//window.GrabCursor();
|
||||
window.SetRenderPipeline(Basic2DPipeline.Pipeline);
|
||||
window.SetRenderPipeline(new TestRenderPipeline());
|
||||
window.SetScene(scene = new Scene());
|
||||
window.Load += WindowOnLoad;
|
||||
window.RenderFrame += WindowOnUpdateFrame;
|
||||
|
|
@ -60,16 +60,12 @@ namespace SM_TEST
|
|||
{
|
||||
scene.ShowAxisHelper = true;
|
||||
|
||||
DrawObject2D kasten = new DrawObject2D();
|
||||
kasten.ShadowCaster = true;
|
||||
kasten.Texture = new Texture(new Bitmap("herosword.png"));
|
||||
kasten.Transform.ApplyTextureSize(kasten.Texture, 500);
|
||||
scene.Objects.Add(kasten);
|
||||
|
||||
//scene.Background.Color = Color4.White;
|
||||
|
||||
DrawText text = new DrawText(font, "Text");
|
||||
text.Transform.Position.Set(0, 500);
|
||||
text.Transform.Position.Set(0, 0);
|
||||
text.Transform.Size.Set(2);
|
||||
scene.Objects.Add(text);
|
||||
|
||||
light = new PointLight
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TestRenderPipeline.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
|
|
|
|||
39
SM_TEST/TestRenderPipeline.cs
Normal file
39
SM_TEST/TestRenderPipeline.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System.Collections.Generic;
|
||||
using OpenTK.Graphics.OpenGL4;
|
||||
using SM.Base;
|
||||
using SM.Base.Contexts;
|
||||
using SM.Base.Drawing;
|
||||
using SM.Base.PostEffects;
|
||||
using SM.OGL.Framebuffer;
|
||||
using SM2D.Scene;
|
||||
|
||||
namespace SM_TEST
|
||||
{
|
||||
public class TestRenderPipeline : RenderPipeline<Scene>
|
||||
{
|
||||
private BloomEffect _bloom;
|
||||
|
||||
protected override void Initialization(GenericWindow window)
|
||||
{
|
||||
base.Initialization(window);
|
||||
_bloom = new BloomEffect(1);
|
||||
|
||||
MainFramebuffer = CreateWindowFramebuffer();
|
||||
|
||||
_bloom.Initilize(this);
|
||||
}
|
||||
|
||||
protected override void RenderProcess(ref DrawContext context, Scene scene)
|
||||
{
|
||||
MainFramebuffer.Activate(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||
scene.DrawBackground(context);
|
||||
scene.DrawMainObjects(context);
|
||||
|
||||
Framebuffer.Screen.Activate(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||
_bloom.Draw(context);
|
||||
|
||||
scene.DrawHUD(context);
|
||||
scene.DrawDebug(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue