Holidays 12.10. -> 25.10.2020

~ Moved code around in files.

SM.Base:
+ PostProcessing-system
+ OnInitialization() for Scenes.
+ Shader-Extensions
+ Added option to not react while unfocused to the window.
+ Added Screenshots to the window.
+ Connected the log system to the SM.OGL-action system.

~ Replaced IShader with abstract MaterialShader.
~ When a log compression folder doesn't exist, it will create one.

SM.OGL:
+ Added support for UniformArrays
+ Added ShaderPreProcessing
+ Added Shader Extensions.
+ Added Debug actions.
+ SM.OGL settings

~ Framebuffer Size is automaticly changed, when the window and scale is set.

SM2D:
+ Added easy shader drawing.
This commit is contained in:
Michel Fedde 2020-10-24 15:10:36 +02:00
parent 2c00dbd31a
commit 03b3942732
102 changed files with 2683 additions and 1398 deletions

View file

@ -1,61 +1,71 @@
using System.Collections.Generic;
#region usings
using OpenTK;
using SM.Base.Scene;
using SM.OGL.Mesh;
#endregion
namespace SM.Base.Contexts
{
/// <summary>
/// Contains important information for drawing.
/// Contains important information for drawing.
/// </summary>
public struct DrawContext
{
/// <summary>
/// This says if it was forced to use the viewport camera.
/// This says if it was forced to use the viewport camera.
/// </summary>
public bool ForceViewport;
/// <summary>
/// The current world matrix.
/// The current world matrix.
/// </summary>
public Matrix4 World;
/// <summary>
/// The current view matrix.
/// The current view matrix.
/// </summary>
public Matrix4 View;
/// <summary>
/// The master model matrix.
/// The master model matrix.
/// </summary>
public Matrix4 ModelMaster;
/// <summary>
/// The drawing instances.
/// <para>If there is only one, it's index 0</para>
/// The drawing instances.
/// <para>If there is only one, it's index 0</para>
/// </summary>
public Instance[] Instances;
/// <summary>
/// The mesh.
/// The mesh.
/// </summary>
public GenericMesh Mesh;
/// <summary>
/// The material.
/// The material.
/// </summary>
public Material Material;
/// <summary>
/// Contains the currently used render pipeline.
/// Contains the currently used render pipeline.
/// </summary>
public RenderPipeline ActivePipeline;
/// <summary>
/// The current world scale.
/// The current world scale.
/// </summary>
public Vector2 WorldScale;
/// <summary>
/// Returns the appropriate shader.
/// <para>Returns the material shader, if available, otherwise it will take the default shader from the render pipeline.</para>
/// Returns the appropriate shader.
/// <para>
/// Returns the material shader, if available, otherwise it will take the default shader from the render
/// pipeline.
/// </para>
/// </summary>
public IShader Shader => Material.CustomShader ?? ActivePipeline._defaultShader;
public MaterialShader Shader => Material.CustomShader ?? ActivePipeline._defaultShader;
}
}

View file

@ -1,25 +1,28 @@
using OpenTK.Input;
using SM.Utility;
#region usings
using OpenTK.Input;
#endregion
namespace SM.Base.Contexts
{
/// <summary>
/// The update context.
/// The update context.
/// </summary>
public struct UpdateContext
{
/// <summary>
/// The delta time.
/// The delta time.
/// </summary>
public float Deltatime => SMRenderer.DefaultDeltatime.DeltaTime;
/// <summary>
/// The current keyboard state.
/// The current keyboard state.
/// </summary>
public KeyboardState KeyboardState;
/// <summary>
/// The current mouse state.
/// The current mouse state.
/// </summary>
public MouseState MouseState;
}