NUGET-Changes:
+ Materials now have a method to draw. That should allow more freedom on how materials can have a effect on the resulting shader.

~ PostProcessEffect.Draw now needs a source ColorAttachment.
~ Added some missing summaries

GIT-/SOLUTION-Changes:
Remade the folder structure, to something more senseable.
This commit is contained in:
Michel Fedde 2021-05-14 21:38:50 +02:00
parent db7f01dca1
commit 89de4258e1
181 changed files with 584 additions and 698 deletions

View file

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9BECA849-E6E9-4E15-83A6-ADD8C18065CB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SM3D</RootNamespace>
<AssemblyName>SM3D</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -3,23 +3,23 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30413.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SMRenderer", "SMRenderer", "{47EA2879-1D40-4683-BA6C-AB51F286EBDE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM.OGL", "src\renderer\SM.OGL\SM.OGL.csproj", "{F604D684-BC1D-4819-88B5-8B5D03A17BE0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM.OGL", "SMCode\SM.OGL\SM.OGL.csproj", "{F604D684-BC1D-4819-88B5-8B5D03A17BE0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM.Base", "src\renderer\SM.Base\SM.Base.csproj", "{8E733844-4204-43E7-B3DC-3913CDDABB0D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM.Base", "SMCode\SM.Base\SM.Base.csproj", "{8E733844-4204-43E7-B3DC-3913CDDABB0D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM2D", "src\renderer\SM2D\SM2D.csproj", "{A4565538-625A-42C6-A330-DD4F1ABB3986}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM3D", "SMCode\SM3D\SM3D.csproj", "{9BECA849-E6E9-4E15-83A6-ADD8C18065CB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM_TEST", "tests\SM_TEST\SM_TEST.csproj", "{6D4FB8E6-4D0B-4928-8F9E-EF5C2FBF44E8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM2D", "SMCode\SM2D\SM2D.csproj", "{A4565538-625A-42C6-A330-DD4F1ABB3986}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM.Utils", "src\optionals\SM.Utils\SM.Utils.csproj", "{079BAB31-3DC4-40DA-90C7-EFAA8517C647}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM_TEST", "SM_TEST\SM_TEST.csproj", "{6D4FB8E6-4D0B-4928-8F9E-EF5C2FBF44E8}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM.Intergrations", "src\optionals\SM.Intergrations\SM.Intergrations.csproj", "{4CB351F4-B3F2-4F77-ACC2-02F21DBF5EC2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Optionals", "Optionals", "{AE5B181B-BD8F-4F36-A64E-32C4FF7B6FD6}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Renderer", "Renderer", "{62ED6240-4DEC-4535-95EB-AE3D90A3FDF5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM.Game", "SMOptionals\SM.Game\SM.Game.csproj", "{079BAB31-3DC4-40DA-90C7-EFAA8517C647}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Optionals", "Optionals", "{CC0E5493-29E8-4ACB-8462-5724A6F636DE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM_WPF_TEST", "SM_WPF_TEST\SM_WPF_TEST.csproj", "{6F5367D3-B7E9-40CE-A692-29F9892B6F2A}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{2D2EDE5F-6610-4DF9-AAFD-664F4023A99D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -35,10 +35,6 @@ Global
{8E733844-4204-43E7-B3DC-3913CDDABB0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E733844-4204-43E7-B3DC-3913CDDABB0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E733844-4204-43E7-B3DC-3913CDDABB0D}.Release|Any CPU.Build.0 = Release|Any CPU
{9BECA849-E6E9-4E15-83A6-ADD8C18065CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BECA849-E6E9-4E15-83A6-ADD8C18065CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BECA849-E6E9-4E15-83A6-ADD8C18065CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BECA849-E6E9-4E15-83A6-ADD8C18065CB}.Release|Any CPU.Build.0 = Release|Any CPU
{A4565538-625A-42C6-A330-DD4F1ABB3986}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4565538-625A-42C6-A330-DD4F1ABB3986}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4565538-625A-42C6-A330-DD4F1ABB3986}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -51,20 +47,21 @@ Global
{079BAB31-3DC4-40DA-90C7-EFAA8517C647}.Debug|Any CPU.Build.0 = Debug|Any CPU
{079BAB31-3DC4-40DA-90C7-EFAA8517C647}.Release|Any CPU.ActiveCfg = Release|Any CPU
{079BAB31-3DC4-40DA-90C7-EFAA8517C647}.Release|Any CPU.Build.0 = Release|Any CPU
{6F5367D3-B7E9-40CE-A692-29F9892B6F2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F5367D3-B7E9-40CE-A692-29F9892B6F2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F5367D3-B7E9-40CE-A692-29F9892B6F2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F5367D3-B7E9-40CE-A692-29F9892B6F2A}.Release|Any CPU.Build.0 = Release|Any CPU
{4CB351F4-B3F2-4F77-ACC2-02F21DBF5EC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CB351F4-B3F2-4F77-ACC2-02F21DBF5EC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CB351F4-B3F2-4F77-ACC2-02F21DBF5EC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CB351F4-B3F2-4F77-ACC2-02F21DBF5EC2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F604D684-BC1D-4819-88B5-8B5D03A17BE0} = {47EA2879-1D40-4683-BA6C-AB51F286EBDE}
{8E733844-4204-43E7-B3DC-3913CDDABB0D} = {47EA2879-1D40-4683-BA6C-AB51F286EBDE}
{9BECA849-E6E9-4E15-83A6-ADD8C18065CB} = {47EA2879-1D40-4683-BA6C-AB51F286EBDE}
{A4565538-625A-42C6-A330-DD4F1ABB3986} = {47EA2879-1D40-4683-BA6C-AB51F286EBDE}
{079BAB31-3DC4-40DA-90C7-EFAA8517C647} = {AE5B181B-BD8F-4F36-A64E-32C4FF7B6FD6}
{F604D684-BC1D-4819-88B5-8B5D03A17BE0} = {62ED6240-4DEC-4535-95EB-AE3D90A3FDF5}
{8E733844-4204-43E7-B3DC-3913CDDABB0D} = {62ED6240-4DEC-4535-95EB-AE3D90A3FDF5}
{A4565538-625A-42C6-A330-DD4F1ABB3986} = {62ED6240-4DEC-4535-95EB-AE3D90A3FDF5}
{6D4FB8E6-4D0B-4928-8F9E-EF5C2FBF44E8} = {2D2EDE5F-6610-4DF9-AAFD-664F4023A99D}
{079BAB31-3DC4-40DA-90C7-EFAA8517C647} = {CC0E5493-29E8-4ACB-8462-5724A6F636DE}
{4CB351F4-B3F2-4F77-ACC2-02F21DBF5EC2} = {CC0E5493-29E8-4ACB-8462-5724A6F636DE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {51C827AB-3306-4EE6-9E60-B7BF84854469}

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

View file

@ -1,9 +0,0 @@
<Application x:Class="SM_WPF_TEST.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SM_WPF_TEST"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View file

@ -1,11 +0,0 @@
using System.Windows;
namespace SM_WPF_TEST
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View file

@ -1,16 +0,0 @@
<Window x:Class="SM_WPF_TEST.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SM_WPF_TEST"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid Name="grid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Content="WPF WITH SM-RENDERER" />
</Grid>
</Window>

View file

@ -1,32 +0,0 @@
using System.Windows;
namespace SM_WPF_TEST
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
/*
GLWPFWindow2D gl;
Scene scene;
gl = new GLWPFWindow2D();
Grid.SetColumn(gl, 1);
grid.Children.Add(gl);
gl.Start();
gl.SetScene(scene = new Scene());
gl.SetRenderPipeline(Default2DPipeline.Pipeline);
DrawObject2D cube = new DrawObject2D();
cube.Color = Color4.Blue;
scene.Objects.Add(cube);
new Window1().Show();*/
}
}
}

View file

@ -1,53 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SM_WPF_TEST")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SM_WPF_TEST")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -1,70 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SM_WPF_TEST.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SM_WPF_TEST.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View file

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -1,29 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SM_WPF_TEST.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View file

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View file

@ -1,102 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6F5367D3-B7E9-40CE-A692-29F9892B6F2A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>SM_WPF_TEST</RootNamespace>
<AssemblyName>SM_WPF_TEST</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Window1.xaml.cs">
<DependentUpon>Window1.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Window1.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -1,12 +0,0 @@
<Window x:Class="SM_WPF_TEST.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SM_WPF_TEST"
mc:Ignorable="d"
Title="Window1" Height="450" Width="800">
<Grid>
</Grid>
</Window>

View file

@ -1,30 +0,0 @@
using System.Windows;
namespace SM_WPF_TEST
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
/*GLWPFWindow2D gl;
Scene scene;
Content = gl = new GLWPFWindow2D();
gl.Start();
gl.SetScene(scene = new Scene());
gl.SetRenderPipeline(Basic2DPipeline.Pipeline);
DrawObject2D obj = new DrawObject2D()
{
Color = Color4.Red
};
obj.ApplyCircle();
scene.Objects.Add(obj);*/
}
}
}

View file

@ -1,19 +1,16 @@
#region usings
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SM3D")]
[assembly: AssemblyTitle("SM.Intergrations")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("SM3D")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2020")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SM.Intergrations")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@ -23,7 +20,7 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9beca849-e6e9-4e15-83a6-add8c18065cb")]
[assembly: Guid("4cb351f4-b3f2-4f77-acc2-02f21dbf5ec2")]
// Version information for an assembly consists of the following four values:
//

View file

@ -4,17 +4,17 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6D4FB8E6-4D0B-4928-8F9E-EF5C2FBF44E8}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>SM_TEST</RootNamespace>
<AssemblyName>SM_TEST</AssemblyName>
<ProjectGuid>{4CB351F4-B3F2-4F77-ACC2-02F21DBF5EC2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SM.Intergrations</RootNamespace>
<AssemblyName>SM.Intergrations</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
@ -24,7 +24,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
@ -32,43 +31,43 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=3.3.1.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\OpenTK.3.3.1\lib\net20\OpenTK.dll</HintPath>
<HintPath>..\..\..\packages\OpenTK.3.3.1\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="ShaderToolParser, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\ShaderToolParser.1.0.0-pre3\lib\net450\ShaderToolParser.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestRenderPipeline.cs" />
<Compile Include="ShaderTool\STMaterial.cs" />
<Compile Include="ShaderTool\STMaterialShader.cs" />
<Compile Include="ShaderTool\STPostProcessEffect.cs" />
<Compile Include="ShaderTool\STPostProcessShader.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SMCode\SM.Base\SM.Base.csproj">
<ProjectReference Include="..\..\renderer\SM.Base\SM.Base.csproj">
<Project>{8e733844-4204-43e7-b3dc-3913cddabb0d}</Project>
<Name>SM.Base</Name>
</ProjectReference>
<ProjectReference Include="..\SMCode\SM.OGL\SM.OGL.csproj">
<ProjectReference Include="..\..\renderer\SM.OGL\SM.OGL.csproj">
<Project>{f604d684-bc1d-4819-88b5-8b5d03a17be0}</Project>
<Name>SM.OGL</Name>
</ProjectReference>
<ProjectReference Include="..\SMCode\SM2D\SM2D.csproj">
<Project>{a4565538-625a-42c6-a330-dd4f1abb3986}</Project>
<Name>SM2D</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.IO.Pipes;
using OpenTK;
using OpenTK.Graphics;
using ShaderToolParser.Nodes;
using ShaderToolParser.Nodes.Textures;
using ShaderToolParser.Variables;
using SM.Base.Drawing;
using SM.Base.Textures;
using SM.Base.Window;
namespace SM.Intergrations.ShaderTool
{
public class STMaterial : Material
{
private Vector4 _tintVector = Vector4.One;
public override Color4 Tint
{
get => Color4.FromXyz(_tintVector);
set => _tintVector = Color4.ToXyz(value);
}
public STMaterial(STPDrawNode node)
{
if (node.OGLEffect == null)
throw new Exception("[ERROR AT IMPORTING MATERIAL] DrawNode didn't contain a OpenGL-shader.");
CustomShader = new STMaterialShader(node);
foreach (KeyValuePair<string, STPVariable> pair in node.Variables)
{
if (pair.Value.Type == STPBasisType.Texture)
ShaderArguments[pair.Key] = new Texture(((STPTextureNode) pair.Value.Texture).Bitmap);
}
}
public override void Draw(DrawContext context)
{
ShaderArguments["MVP"] = context.Instances[0].ModelMatrix * context.ModelMatrix * context.View * context.World;
ShaderArguments["MasterTextureMatrix"] = context.Instances[0].TextureMatrix * context.TextureMatrix;
ShaderArguments["HasVColor"] = context.Mesh.Attributes.Has("color");
ShaderArguments["_MATColor"] = _tintVector;
base.Draw(context);
}
}
}

View file

@ -0,0 +1,70 @@

using System;
using System.Collections.Generic;
using OpenTK;
using ShaderToolParser.Nodes;
using ShaderToolParser.Variables;
using SM.Base.Shaders;
using SM.Base.Textures;
using SM.Base.Window;
using SM.OGL.Shaders;
using SM.OGL.Texture;
namespace SM.Intergrations.ShaderTool
{
public class STMaterialShader : MaterialShader
{
private event Action<DrawContext> _uniforms;
public STMaterialShader(STPDrawNode drawNode) : base(new ShaderFileCollection())
{
if (drawNode.OGLEffect == null)
throw new Exception("[ERROR AT IMPORTING SHADER] DrawNode didn't contain a OpenGL-shader.");
STPCompositeNode composeNode = drawNode.OGLEffect;
ShaderFileFiles.Vertex = new[] { new ShaderFile(composeNode.Vertex.ShaderCode) };
ShaderFileFiles.Fragment = new [] {new ShaderFile(composeNode.Fragment.ShaderCode)};
if (composeNode.Geometry != null)
ShaderFileFiles.Geometry = new[] {new ShaderFile(composeNode.Geometry.ShaderCode)};
foreach (KeyValuePair<string, STPVariable> pair in drawNode.Variables)
{
switch (pair.Value.Type)
{
case STPBasisType.Bool:
_uniforms += context => Uniforms[pair.Key].SetUniform1(context.Material.ShaderArguments.Get(pair.Key, false));
break;
case STPBasisType.Float:
_uniforms += context => Uniforms[pair.Key].SetUniform1(context.Material.ShaderArguments.Get(pair.Key, 0.0f));
break;
case STPBasisType.Vector2:
_uniforms += context => Uniforms[pair.Key].SetUniform2(context.Material.ShaderArguments.Get(pair.Key, Vector2.Zero));
break;
case STPBasisType.Vector3:
_uniforms += context => Uniforms[pair.Key].SetUniform3(context.Material.ShaderArguments.Get(pair.Key, Vector3.Zero));
break;
case STPBasisType.Vector4:
_uniforms += context =>
Uniforms[pair.Key].SetUniform4(context.Material.ShaderArguments.Get(pair.Key, Vector4.Zero));
break;
case STPBasisType.Matrix:
_uniforms += context => Uniforms[pair.Key].SetMatrix4(context.Material.ShaderArguments.Get(pair.Key, Matrix4.Identity));
break;
case STPBasisType.Texture:
_uniforms += context => Uniforms[pair.Key].SetTexture(context.Material.ShaderArguments.Get<TextureBase>(pair.Key, null));
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
protected override void DrawProcess(DrawContext context)
{
_uniforms.Invoke(context);
DrawObject(context.ForcedType.GetValueOrDefault(context.Mesh.PrimitiveType), context.Mesh);
}
}
}

View file

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using OpenTK.Graphics.OpenGL4;
using ShaderToolParser.Nodes;
using ShaderToolParser.Nodes.Textures;
using ShaderToolParser.Variables;
using SM.Base.Drawing;
using SM.Base.PostProcess;
using SM.Base.Textures;
using SM.Base.Window;
using SM.OGL.Framebuffer;
using SM.OGL.Texture;
namespace SM.Intergrations.ShaderTool
{
public class STPostProcessEffect : PostProcessEffect
{
private STPostProcessShader _shader;
public ShaderArguments Arguments;
public STPostProcessEffect(STPDrawNode postEffectNode)
{
Arguments = Arguments ?? new ShaderArguments();
if (postEffectNode.OGLEffect == null)
throw new Exception("[ERROR AT IMPORTING EFFECT] DrawNode didn't contain a OpenGL-shader.");
_shader = new STPostProcessShader(postEffectNode);
foreach (KeyValuePair<string, STPVariable> pair in postEffectNode.Variables)
{
if (pair.Value.Type == STPBasisType.Texture)
{
if (pair.Value.Texture == null) continue;
Arguments[pair.Key] = new Texture(((STPTextureNode)pair.Value.Texture).Bitmap);
}
}
}
public override void Draw(ColorAttachment source, DrawContext context)
{
Arguments["_Scene"] = (TextureBase)source;
Arguments["_MVP"] = Mvp;
Arguments["_ViewportSize"] = context.Window.WindowSize;
_shader.Draw(Arguments);
}
}
}

View file

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using OpenTK;
using OpenTK.Graphics.OpenGL4;
using ShaderToolParser.Nodes;
using ShaderToolParser.Variables;
using SM.Base.Drawing;
using SM.Base.Objects.Static;
using SM.Base.Textures;
using SM.OGL.Shaders;
using SM.OGL.Texture;
namespace SM.Intergrations.ShaderTool
{
public class STPostProcessShader : GenericShader
{
private event Action<ShaderArguments> _uniforms;
public STPostProcessShader(STPDrawNode postProcessNode) : base(new ShaderFileCollection())
{
if (postProcessNode.OGLEffect == null)
throw new Exception("[ERROR AT IMPORTING SHADER] DrawNode didn't contain a OpenGL-shader.");
STPCompositeNode composeNode = postProcessNode.OGLEffect;
ShaderFileFiles.Vertex = new[] { new ShaderFile(composeNode.Vertex.ShaderCode) };
ShaderFileFiles.Fragment = new[] { new ShaderFile(composeNode.Fragment.ShaderCode) };
if (composeNode.Geometry != null)
ShaderFileFiles.Geometry = new[] { new ShaderFile(composeNode.Geometry.ShaderCode) };
foreach (KeyValuePair<string, STPVariable> pair in postProcessNode.Variables)
{
switch (pair.Value.Type)
{
case STPBasisType.Bool:
_uniforms += context => Uniforms[pair.Key].SetUniform1(context.Get(pair.Key, false));
break;
case STPBasisType.Float:
_uniforms += context => Uniforms[pair.Key].SetUniform1(context.Get(pair.Key, 0.0f));
break;
case STPBasisType.Vector2:
_uniforms += context => Uniforms[pair.Key].SetUniform2(context.Get(pair.Key, Vector2.Zero));
break;
case STPBasisType.Vector3:
_uniforms += context => Uniforms[pair.Key].SetUniform3(context.Get(pair.Key, Vector3.Zero));
break;
case STPBasisType.Vector4:
_uniforms += context =>
Uniforms[pair.Key].SetUniform4(context.Get(pair.Key, Vector4.Zero));
break;
case STPBasisType.Matrix:
_uniforms += context => Uniforms[pair.Key].SetMatrix4(context.Get(pair.Key, Matrix4.Identity));
break;
case STPBasisType.Texture:
_uniforms += context => Uniforms[pair.Key].SetTexture(context.Get<TextureBase>(pair.Key, null));
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
public void Draw(ShaderArguments arguments)
{
Activate();
Plate.Object.Activate();
_uniforms.Invoke(arguments);
GL.DrawArrays(PrimitiveType.Quads, 0, 4);
CleanUp();
}
}
}

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="3.3.1" targetFramework="net452" />
<package id="ShaderToolParser" version="1.0.0-pre3" targetFramework="net452" />
</packages>

View file

@ -1,6 +1,6 @@
using SharpDX.XInput;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public struct GameController
{

View file

@ -2,7 +2,7 @@
using OpenTK;
using SharpDX.XInput;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public struct GameControllerState
{

View file

@ -1,6 +1,6 @@
using SharpDX.XInput;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public struct GameControllerStateButtons
{

View file

@ -1,6 +1,6 @@
using SharpDX.XInput;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public struct GameControllerStateDPad
{

View file

@ -1,6 +1,6 @@
using OpenTK;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public struct GameControllerStateThumbs
{

View file

@ -1,4 +1,4 @@
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public struct GameControllerStateTriggers
{

View file

@ -1,6 +1,6 @@
using System;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public class GameKeybind
{
@ -18,10 +18,8 @@ namespace SM.Game.Controls
return AI;
case GameKeybindActorType.Keyboard:
return Keyboard;
break;
case GameKeybindActorType.Controller:
return Controller;
break;
default:
throw new ArgumentOutOfRangeException(nameof(type), type, null);
}

View file

@ -1,6 +1,6 @@
using OpenTK.Input;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public enum GameKeybindActorType
{

View file

@ -1,6 +1,6 @@
using OpenTK.Input;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public struct GameKeybindContext
{

View file

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public class GameKeybindHost
{

View file

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace SM.Game.Controls
namespace SM.Optionals.Controls
{
public class GameKeybindList : List<KeyValuePair<string, GameKeybind>>
{

View file

@ -7,8 +7,8 @@
<ProjectGuid>{079BAB31-3DC4-40DA-90C7-EFAA8517C647}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SM.Game</RootNamespace>
<AssemblyName>SM.Game</AssemblyName>
<RootNamespace>SM.Utils</RootNamespace>
<AssemblyName>SM.Utils</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
@ -32,13 +32,13 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=3.3.1.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenTK.3.3.1\lib\net20\OpenTK.dll</HintPath>
<HintPath>..\..\..\packages\OpenTK.3.3.1\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="SharpDX, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll</HintPath>
<HintPath>..\..\..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll</HintPath>
</Reference>
<Reference Include="SharpDX.XInput, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\..\packages\SharpDX.XInput.4.2.0\lib\net45\SharpDX.XInput.dll</HintPath>
<HintPath>..\..\..\packages\SharpDX.XInput.4.2.0\lib\net45\SharpDX.XInput.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View file

@ -2,6 +2,7 @@
using OpenTK.Graphics;
using SM.Base.Shaders;
using SM.Base.Window;
using SM.OGL.Texture;
#endregion
@ -16,26 +17,31 @@ namespace SM.Base.Drawing
/// <summary>
/// A setting to enable Blending.
/// </summary>
public bool Blending = false;
public virtual bool Blending { get; set; } = false;
/// <summary>
/// A custom shader, that is used to draw this material.
/// </summary>
public MaterialShader CustomShader;
public virtual MaterialShader CustomShader { get; set; }
/// <summary>
/// The base texture. (aka. Diffuse Texture)
/// </summary>
public TextureBase Texture;
public virtual TextureBase Texture { get; set; }
/// <summary>
/// The tint or color.
/// </summary>
public Color4 Tint = Color4.White;
public virtual Color4 Tint { get; set; } = Color4.White;
/// <summary>
/// This allows custom shaders to use own shader arguments.
/// </summary>
public ShaderArguments ShaderArguments { get; internal set; } = new ShaderArguments();
public virtual void Draw(DrawContext context)
{
context.Shader.Draw(context);
}
}
}

View file

@ -6,6 +6,7 @@ using OpenTK;
using SM.Base.Scene;
using SM.Base.Time;
using SM.Base.Window;
using Stopwatch = System.Diagnostics.Stopwatch;
#endregion
@ -41,7 +42,7 @@ namespace SM.Base.Drawing.Particles
/// </summary>
public float Lifetime;
/// <summary>
/// Ranomizes the lifetime for particles.
/// Randomizes the lifetime for particles.
/// </summary>
public float LifetimeRandomize = 0;
@ -62,6 +63,9 @@ namespace SM.Base.Drawing.Particles
}
}
/// <summary>
/// If true, the particles will spawn in Worldspace and can't be moved by the transformation.
/// </summary>
public bool DetachedParticles;
/// <summary>
@ -106,7 +110,8 @@ namespace SM.Base.Drawing.Particles
/// <inheritdoc />
public void Update(UpdateContext context)
{
Stopwatch stp = new Stopwatch();
stp.Start();
for (int i = 0; i < instances.Count; i++)
{
instances[i].Lifetime -= context.Deltatime;
@ -116,9 +121,10 @@ namespace SM.Base.Drawing.Particles
break;
}
instances[i].ModelMatrix = CreateMatrix(instances[i],
MovementCalculation(instances[i]));
instances[i].ModelMatrix = CreateMatrix(instances[i], MovementCalculation(instances[i]));
}
Console.WriteLine();
}
/// <summary>
@ -153,6 +159,7 @@ namespace SM.Base.Drawing.Particles
timer.Stop();
}
/// <inheritdoc />
public override void OnRemoved(object sender)
{
base.OnRemoved(sender);
@ -171,7 +178,7 @@ namespace SM.Base.Drawing.Particles
context.Instances = instances.ConvertAll(a => (Instance)a);
context.Shader.Draw(context);
Material.Draw(context);
}
/// <summary>
@ -189,7 +196,7 @@ namespace SM.Base.Drawing.Particles
private void CreateContinuesParticles(Timer arg1, UpdateContext arg2)
{
instances.Add(CreateObject(instances.Count));
instances.Add(CreateObject(0));
}
/// <summary>

View file

@ -2,8 +2,14 @@
namespace SM.Base.Drawing.Particles
{
/// <summary>
/// This describes a instance of a particle
/// </summary>
public class ParticleInstance : Instance
{
/// <summary>
/// The lifetime the particle started with.
/// </summary>
public float StartLifetime = 0;
/// <summary>
@ -22,6 +28,7 @@ namespace SM.Base.Drawing.Particles
public float Speed;
}
/// <inheritdoc />
public class ParticleInstance<TValue> : ParticleInstance
where TValue : struct
{
@ -29,10 +36,5 @@ namespace SM.Base.Drawing.Particles
/// A direction, that the particle should travel.
/// </summary>
public TValue Direction;
/// <summary>
/// The start position.
/// </summary>
public TValue StartPosition;
}
}

View file

@ -1,5 +1,6 @@
#region usings
using System.Drawing;
using OpenTK;
using OpenTK.Graphics.OpenGL4;
using SM.Base.Drawing;
@ -155,7 +156,7 @@ namespace SM.Base.PostEffects
}
/// <inheritdoc/>
public override void Draw(DrawContext context)
public override void Draw(ColorAttachment source, DrawContext context)
{
if (Enable)
{
@ -171,7 +172,7 @@ namespace SM.Base.PostEffects
_shader.Draw(collection =>
{
collection["renderedTexture"].SetTexture(first ? _source.ColorAttachments["color"] : (hoz ? _yBuffer : _xBuffer));
collection["renderedTexture"].SetTexture(first ? source : (hoz ? _yBuffer : _xBuffer));
collection["First"].SetUniform1(first);
collection["Threshold"].SetUniform1(Threshold);
@ -195,7 +196,7 @@ namespace SM.Base.PostEffects
_mergeShader.Draw(collection =>
{
collection["Scene"].SetTexture(_source.ColorAttachments["color"]);
collection["Scene"].SetTexture(source);
collection["Bloom"].SetTexture(_yBuffer);
collection["MinAmount"].SetUniform1(MinAmount);

View file

@ -3,6 +3,7 @@
using OpenTK;
using SM.Base.Scene;
using SM.Base.Window;
using SM.OGL.Framebuffer;
#endregion
@ -44,7 +45,7 @@ namespace SM.Base.PostProcess
/// <summary>
/// Method to draw the actual effect.
/// </summary>
public abstract void Draw(DrawContext context);
public abstract void Draw(ColorAttachment source, DrawContext context);
/// <summary>
/// Event, when the scene changed.

View file

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\SharpFont.4.0.1\build\SharpFont.props" Condition="Exists('..\..\..\packages\SharpFont.4.0.1\build\SharpFont.props')" />
<Import Project="..\..\..\packages\SharpFont.Dependencies.2.6\build\SharpFont.Dependencies.props" Condition="Exists('..\..\..\packages\SharpFont.Dependencies.2.6\build\SharpFont.Dependencies.props')" />
<Import Project="..\..\..\IAmTwo - Kopie\packages\SharpFont.4.0.1\build\SharpFont.props" Condition="Exists('..\..\..\IAmTwo - Kopie\packages\SharpFont.4.0.1\build\SharpFont.props')" />
<Import Project="..\..\..\IAmTwo - Kopie\packages\SharpFont.Dependencies.2.6\build\SharpFont.Dependencies.props" Condition="Exists('..\..\..\IAmTwo - Kopie\packages\SharpFont.Dependencies.2.6\build\SharpFont.Dependencies.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@ -37,23 +39,6 @@
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=3.3.1.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenTK.3.3.1\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="SharpFont, Version=4.0.1.200, Culture=neutral, PublicKeyToken=48add4c483071cdf, processorArchitecture=MSIL">
<HintPath>..\..\..\IAmTwo - Kopie\packages\SharpFont.4.0.1\lib\net45\SharpFont.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Animation\AnimationCurves.cs" />
<Compile Include="Animation\InterpolationProcess.cs" />
@ -126,12 +111,6 @@
<EmbeddedResource Include="PostProcess\DefaultFiles\vertexFile.vert" />
<EmbeddedResource Include="PostProcess\DefaultFiles\extensions.frag" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SM.OGL\SM.OGL.csproj">
<Project>{f604d684-bc1d-4819-88b5-8b5d03a17be0}</Project>
<Name>SM.OGL</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PostProcess\DefaultFiles\vertexWithExt.vert" />
</ItemGroup>
@ -140,8 +119,6 @@
<EmbeddedResource Include="PostEffects\Shaders\bloom_merge.glsl" />
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
<EmbeddedResource Include="Shaders\SimpleShaderPresets\basic_vertex.glsl" />
<EmbeddedResource Include="Shaders\SimpleShaderPresets\instanced_vertex.glsl" />
<EmbeddedResource Include="PostEffects\Shaders\bloom_merge_vert.glsl" />
@ -153,12 +130,42 @@
<ItemGroup>
<EmbeddedResource Include="Window\winIcon.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SM.OGL\SM.OGL.csproj">
<Project>{f604d684-bc1d-4819-88b5-8b5d03a17be0}</Project>
<Name>SM.OGL</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=3.3.1.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\OpenTK.3.3.1\lib\net20\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SharpFont, Version=4.0.1.200, Culture=neutral, PublicKeyToken=48add4c483071cdf, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\SharpFont.4.0.1\lib\net45\SharpFont.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\IAmTwo - Kopie\packages\SharpFont.Dependencies.2.6\build\SharpFont.Dependencies.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\IAmTwo - Kopie\packages\SharpFont.Dependencies.2.6\build\SharpFont.Dependencies.props'))" />
<Error Condition="!Exists('..\..\..\IAmTwo - Kopie\packages\SharpFont.4.0.1\build\SharpFont.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\IAmTwo - Kopie\packages\SharpFont.4.0.1\build\SharpFont.props'))" />
</Target>
</Project>

View file

@ -45,9 +45,7 @@ namespace SM.Base.Shaders
{
try
{
if (context.Mesh is ILineMesh lineMesh)
GL.LineWidth(context.Material.ShaderArguments.Get("LineWidth", lineMesh.LineWidth));
else if (context.Material.ShaderArguments.ContainsKey("LineWidth"))
if (context.Material.ShaderArguments.ContainsKey("LineWidth"))
GL.LineWidth((float)context.Material.ShaderArguments["LineWidth"]);
}
catch

Some files were not shown because too many files have changed in this diff Show more