This repository has been archived by the owner on Nov 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
VertexPositionTextureLight.cs
85 lines (69 loc) · 3.65 KB
/
VertexPositionTextureLight.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System.Runtime.InteropServices;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace MineLib.PGL
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct VertexPositionTextureLight : IVertexType
{
public Vector3 Position { get; set; }
public Vector2 TextureCoordinate { get; set; }
public float SunLight { get; set; }
public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(
new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0),
new VertexElement(20, VertexElementFormat.Single, VertexElementUsage.Color, 0));
VertexDeclaration IVertexType.VertexDeclaration => VertexDeclaration;
public VertexPositionTextureLight(Vector3 position, Vector2 textureCoordinate, float sunLight) : this()
{
Position = position;
TextureCoordinate = textureCoordinate;
SunLight = sunLight;
}
public static int SizeInBytes => 24;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct VertexPositionTextureLight1 : IVertexType
{
Vector3 Position { get; set; }
Vector2 TextureCoordinate { get; set; }
float SunLight { get; set; }
float LightType { get; set; }
public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(
new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0),
new VertexElement(20, VertexElementFormat.Single, VertexElementUsage.Color, 0),
new VertexElement(24, VertexElementFormat.Single, VertexElementUsage.Color, 1));
VertexDeclaration IVertexType.VertexDeclaration => VertexDeclaration;
public VertexPositionTextureLight1(Vector3 position, Vector2 textureCoordinate, float sunLight, byte lightType) : this()
{
Position = position;
TextureCoordinate = textureCoordinate;
SunLight = sunLight;
LightType = lightType;
}
public static int SizeInBytes => 28;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct VertexPositionTextureLight2 : IVertexType
{
Vector3 Position { get; set; }
Vector2 TextureCoordinate { get; set; }
float SunLight { get; set; }
Vector3 LocalLight { get; set; }
public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(
new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0),
new VertexElement(20, VertexElementFormat.Single, VertexElementUsage.Color, 0),
new VertexElement(24, VertexElementFormat.Color, VertexElementUsage.Color, 1));
VertexDeclaration IVertexType.VertexDeclaration => VertexDeclaration;
public VertexPositionTextureLight2(Vector3 position, Vector2 textureCoordinate, float sunLight, Vector3 localLight) : this()
{
Position = position;
TextureCoordinate = textureCoordinate;
SunLight = sunLight;
LocalLight = localLight;
}
public static int SizeInBytes => 40;
}
}