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
|
|
@ -75,9 +75,10 @@ namespace SM.OGL.Mesh
|
|||
_id = GL.GenVertexArray();
|
||||
GL.BindVertexArray(_id);
|
||||
|
||||
if (Attributes == null) throw new Exception("[Critical] The model requires attributes.");
|
||||
if (Attributes == null || Attributes.Count == 0) throw new Exception("[Critical] The model requires attributes.");
|
||||
|
||||
foreach (var kvp in Attributes) kvp.ConnectedVBO?.BindBuffer(kvp.Index);
|
||||
foreach (var kvp in Attributes)
|
||||
kvp.ConnectedVBO?.BindBuffer(kvp.Index);
|
||||
|
||||
GL.BindVertexArray(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,21 @@
|
|||
namespace SM.OGL.Mesh
|
||||
{
|
||||
public struct MeshAttribute
|
||||
/// <summary>
|
||||
/// This represents a attribute of a mesh.
|
||||
/// </summary>
|
||||
public class MeshAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Index of attribute
|
||||
/// </summary>
|
||||
public int Index;
|
||||
/// <summary>
|
||||
/// Name of the attribute
|
||||
/// </summary>
|
||||
public string Name;
|
||||
/// <summary>
|
||||
/// Connected buffer object.
|
||||
/// </summary>
|
||||
public VBO ConnectedVBO;
|
||||
|
||||
public MeshAttribute(int index, string name, VBO buffer)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,14 @@ using System.Runtime.InteropServices;
|
|||
|
||||
namespace SM.OGL.Mesh
|
||||
{
|
||||
/// <summary>
|
||||
/// List of mesh attributes.
|
||||
/// </summary>
|
||||
public class MeshAttributeList : List<MeshAttribute>
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the VBO (or null) that is connected to the specified name.
|
||||
/// </summary>
|
||||
public VBO this[string name]
|
||||
{
|
||||
get
|
||||
|
|
@ -20,11 +26,28 @@ namespace SM.OGL.Mesh
|
|||
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
for (int i = 0; i < Count; i++)
|
||||
{
|
||||
if (this[i].Name == name)
|
||||
{
|
||||
this[i].ConnectedVBO = value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new attribute.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="vbo"></param>
|
||||
public void Add(int id, string name, VBO vbo)
|
||||
{
|
||||
if (vbo == null) return;
|
||||
//if (vbo == null) return;
|
||||
Add(new MeshAttribute(id, name, vbo));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue