Mise à jour du dépôt en fonction du .gitignore

This commit is contained in:
Troispoils 2024-02-25 22:03:08 +01:00
parent 1f0f033fad
commit 4a59748e67
224 changed files with 6785 additions and 0 deletions

View file

@ -0,0 +1,20 @@
using AC2RE.Definitions;
namespace LandblockExtraction.DatEngine {
public class CellEngine {
private DatReader cellReader;
public CellEngine() {
cellReader = new(@"X:\DatFiles\cell_1.dat");
}
public CLandBlockData? GetLandBlockData(uint id) {
DataId dataId = new DataId(id);
if (!cellReader.contains(dataId)) return null;
using (var data = cellReader.getFileReader(dataId)) {
CLandBlockData cLandBlockData = new(data);
return cLandBlockData;
}
}
}
}

View file

@ -0,0 +1,47 @@
using AC2RE.Definitions;
namespace LandblockExtraction.DatEngine {
public class PortalEngine {
private readonly DataId TERRAINDESCID = new DataId(0x12000000);
private readonly DataId SURFACEDESCID = new DataId(0x13000000);
private readonly DataId LANDSCAPEID = new DataId(0x36000000);
private DatReader portalReader;
public CTerrainDesc cTerrainDesc { get; private set; }
public CSurfaceDesc cSurfaceDesc { get; private set; }
public LandScapeDefs landScapeDefs { get; private set; }
public PortalEngine() {
portalReader = new(@"X:\DatFiles\portal.dat");
InitTerrainDesc();
InitSurfaceDesc();
InitLandScapeDesc();
}
public bool InitTerrainDesc() {
if (!portalReader.contains(TERRAINDESCID)) return false;
using (var data = portalReader.getFileReader(TERRAINDESCID)) {
if (data == null) return false;
cTerrainDesc = new(data);
}
return true;
}
public bool InitSurfaceDesc() {
if (!portalReader.contains(SURFACEDESCID)) return false;
using (var data = portalReader.getFileReader(SURFACEDESCID)) {
if (data == null) return false;
cSurfaceDesc = new(data);
}
return true;
}
public bool InitLandScapeDesc() {
if (!portalReader.contains(LANDSCAPEID)) return false;
using (var data = portalReader.getFileReader(LANDSCAPEID)) {
if (data == null) return false;
landScapeDefs = new(data);
}
return true;
}
}
}

View file

@ -0,0 +1,83 @@
using AC2RE.Definitions;
using LandblockExtraction.DatEngine;
using LandblockExtraction.Tools;
using System.Numerics;
namespace LandblockExtraction.LandBlockExtractor {
public class LandBlockExtrator {
private PortalEngine portalEngine;
private CellEngine cellEngine;
private readonly int NumberLandBlocks = 255;
private readonly int BlockSize = 17;
private readonly int cellSize = 8;
public LandBlockExtrator(PortalEngine portalEngine, CellEngine cellEngine) {
this.portalEngine = portalEngine;
this.cellEngine = cellEngine;
}
public BlockStruct? GetBlock(int landX, int landY) {
CellId landBlockId = new CellId((byte)landX, (byte)landY, 0xFF, 0xFF);
var landBlock = cellEngine.GetLandBlockData(landBlockId.id);
if (landBlock == null) return null;
return GenerateBlockStructByData(landBlock, landX, landY);
}
public BlockStruct GenerateBlockStructByData(CLandBlockData blockData, int landX, int landY) {
BlockStruct blockStruct = new BlockStruct();
for (int y = 0; y < BlockStruct.BlockSize; y++) {
for (int x = 0; x < BlockStruct.BlockSize; x++) {
var indice = y * BlockStruct.BlockSize + x;
blockStruct.verticesStruct.position[indice] = GenerateVertexPosition(landX, landY, x, y, blockData.heights[indice]);
blockStruct.verticesStruct.color[indice] = GenerateVertexColor(blockData.cellInfos[indice]);
blockStruct.verticesStruct.farcolor[indice] = GenerateVertexFarColor(blockData.cellInfos[indice]);
blockStruct.GenerateIndices();
}
}
return blockStruct;
}
private Vector3 GenerateVertexPosition(int landx, int landy, int x, int y, byte height) {
int tmpx = (landx * BlockSize + y) * cellSize;
int tmpy = (BlockSize * NumberLandBlocks * cellSize) - ((landy * BlockSize + x) * cellSize) - 1;
var newX = (tmpx - (NumberLandBlocks * BlockSize * cellSize / 2));
var newY = (tmpy - ((NumberLandBlocks * BlockSize * cellSize) - (NumberLandBlocks * BlockSize * cellSize / 2) - 1));
return new Vector3(newX, portalEngine.landScapeDefs.landHeightTable[height], newY);
}
private Vector4 GenerateVertexColor(uint cellInfo) {
var terrain = MathOperations.GetTerrainInCellInfo(cellInfo);
foreach (var terrainType in portalEngine.cTerrainDesc.terrains) {
if (terrainType.terrainIndex == terrain) {
foreach (var surfaceIndex in portalEngine.cSurfaceDesc.surfaces) {
if (surfaceIndex.surfIndex == terrainType.surfaceInfo) {
var color = surfaceIndex.terrainMaterials.First().vertexColor.First().vertexColor;
return MathOperations.RGBAColorToVector4(color);
}
}
}
}
return Vector4.One;
}
private Vector4 GenerateVertexFarColor(uint cellInfo) {
var terrain = MathOperations.GetTerrainInCellInfo(cellInfo);
foreach (var terrainType in portalEngine.cTerrainDesc.terrains) {
if (terrainType.terrainIndex == terrain) {
foreach (var surfaceIndex in portalEngine.cSurfaceDesc.surfaces) {
if (surfaceIndex.surfIndex == terrainType.surfaceInfo) {
var color = surfaceIndex.terrainMaterials.First().vertexColor.First().farVertexColor;
return MathOperations.RGBAColorToVector4(color);
}
}
}
}
return Vector4.One;
}
}
}

View file

@ -0,0 +1,30 @@
namespace LandblockExtraction.LandBlockExtractor {
public class BlockStruct {
public readonly static int BlockSize = 17;
public VerticesStruct verticesStruct;
public int[] indices;
public BlockStruct() {
verticesStruct = new VerticesStruct(BlockSize);
indices = new int[(BlockSize - 1) * (BlockSize - 1) * 6];
}
public void GenerateIndices() {
int index = 0;
for (int y = 0; y < BlockSize - 1; y++) {
for (int x = 0; x < BlockSize - 1; x++) {
// Indices des sommets du premier triangle
indices[index++] = y * BlockSize + x;
indices[index++] = (y + 1) * BlockSize + x;
indices[index++] = y * BlockSize + x + 1;
// Indices des sommets du deuxième triangle
indices[index++] = y * BlockSize + x + 1;
indices[index++] = (y + 1) * BlockSize + x;
indices[index++] = (y + 1) * BlockSize + x + 1;
}
}
}
}
}

View file

@ -0,0 +1,34 @@
using System.Numerics;
namespace LandblockExtraction.LandBlockExtractor {
public class VerticesStruct {
public Vector3[] position { get; set; }
public Vector4[] color { get; set; }
public Vector4[] farcolor { get; set; }
public VerticesStruct(int blockSize) {
position = new Vector3[blockSize * blockSize];
color = new Vector4[blockSize * blockSize];
farcolor = new Vector4[blockSize * blockSize];
}
public float[] Vertices() {
int length = position.Length;
float[] vertices = new float[length * 11]; // 3 pour position, 4 pour color, et 4 pour farcolor
for (int i = 0, vi = 0; i < length; i++, vi += 11) {
vertices[vi] = position[i].X;
vertices[vi + 1] = position[i].Y;
vertices[vi + 2] = position[i].Z;
vertices[vi + 3] = color[i].X;
vertices[vi + 4] = color[i].Y;
vertices[vi + 5] = color[i].Z;
vertices[vi + 6] = color[i].W;
vertices[vi + 7] = farcolor[i].X;
vertices[vi + 8] = farcolor[i].Y;
vertices[vi + 9] = farcolor[i].Z;
vertices[vi + 10] = farcolor[i].W;
}
return vertices;
}
}
}

View file

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Reference Include="AC2RE.Definitions">
<HintPath>..\Libs\AC2RE.Definitions.dll</HintPath>
</Reference>
<Reference Include="AC2RE.Utils">
<HintPath>..\Libs\AC2RE.Utils.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="AtlasMaker\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="13.6.0" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,187 @@
using AC2RE.Definitions;
namespace LandblockExtraction.Tools;
public static class DDSHeader {
//MagicNumber for DDS file.
private static readonly uint MAGICNUMBER = 0x20534444;
//Length of header
private static readonly int LENGTH = 125;
public static byte[] Generate(RenderSurface renderSurface) {
if (renderSurface.pixelFormat == PixelFormat.CUSTOM_RAW_JPEG) return renderSurface.sourceData;
DDS_HEADER header = genHeadStruct(renderSurface.pixelFormat, renderSurface.height, renderSurface.width);
using (MemoryStream stream = new MemoryStream(LENGTH + renderSurface.sourceData.Length)) {
stream.Write(BitConverter.GetBytes(MAGICNUMBER));
stream.Write(BitConverter.GetBytes(header.dwSize));
stream.Write(BitConverter.GetBytes((uint)header.dwFlags));
stream.Write(BitConverter.GetBytes(header.dwHeight));
stream.Write(BitConverter.GetBytes(header.dwWidth));
stream.Write(BitConverter.GetBytes(header.dwPitchOrLinearSize));
stream.Write(BitConverter.GetBytes(header.dwDepth));
stream.Write(BitConverter.GetBytes(header.dwMipMapCount));
foreach (var i in header.dwReserved1) stream.Write(BitConverter.GetBytes(i));
stream.Write(BitConverter.GetBytes(header.ddspf.dwSize));
stream.Write(BitConverter.GetBytes((uint)header.ddspf.dwFlags));
stream.Write(BitConverter.GetBytes(header.ddspf.dwFourCC));
stream.Write(BitConverter.GetBytes(header.ddspf.dwRGBBitCount));
stream.Write(BitConverter.GetBytes(header.ddspf.dwRBitMask));
stream.Write(BitConverter.GetBytes(header.ddspf.dwGBitMask));
stream.Write(BitConverter.GetBytes(header.ddspf.dwBBitMask));
stream.Write(BitConverter.GetBytes(header.ddspf.dwABitMask));
stream.Write(BitConverter.GetBytes(header.dwCaps));
stream.Write(BitConverter.GetBytes(header.dwCaps2));
stream.Write(BitConverter.GetBytes(header.dwCaps3));
stream.Write(BitConverter.GetBytes(header.dwCaps4));
stream.Write(BitConverter.GetBytes(header.dwReserved2));
stream.Write(renderSurface.sourceData);
return stream.ToArray();
}
}
private static DDS_HEADER genHeadStruct(PixelFormat format, uint height, uint width) {
//I think always same each format?
DDS_HEADER dDS_HEADER = new DDS_HEADER();
dDS_HEADER.dwFlags |= DDSHeaderFlags.DDSD_CAPS | DDSHeaderFlags.DDSD_HEIGHT | DDSHeaderFlags.DDSD_WIDTH | DDSHeaderFlags.DDSD_PIXELFORMAT;
if (dDS_HEADER.dwFlags.HasFlag(DDSHeaderFlags.DDSD_HEIGHT)) dDS_HEADER.dwHeight = height;
if (dDS_HEADER.dwFlags.HasFlag(DDSHeaderFlags.DDSD_WIDTH)) dDS_HEADER.dwWidth = width;
if (format == PixelFormat.DXT1) {
dDS_HEADER.dwFlags |= DDSHeaderFlags.DDSD_LINEARSIZE;
dDS_HEADER.dwPitchOrLinearSize = CalculateCompressedBlockSize(height, width, (uint)new byte[8].Length);
}
if (format == PixelFormat.DXT3 || format == PixelFormat.DXT2 || format == PixelFormat.DXT4 || format == PixelFormat.DXT5) {
dDS_HEADER.dwFlags |= DDSHeaderFlags.DDSD_LINEARSIZE;
dDS_HEADER.dwPitchOrLinearSize = CalculateCompressedBlockSize(height, width, (uint)new byte[16].Length);
}
if (dDS_HEADER.dwFlags.HasFlag(DDSHeaderFlags.DDSD_PIXELFORMAT)) dDS_HEADER.ddspf = genPixelformatStruct(format);
return dDS_HEADER;
}
private static DDS_PIXELFORMAT genPixelformatStruct(PixelFormat surface) {
DDS_PIXELFORMAT dDS_PIXELFORMAT = new DDS_PIXELFORMAT();
switch (surface) {
case PixelFormat.DXT1:
case PixelFormat.DXT3:
case PixelFormat.DXT4:
case PixelFormat.DXT5:
dDS_PIXELFORMAT.dwFlags |= DDSPixelformatFlags.DDPF_FOURCC;
dDS_PIXELFORMAT.dwFourCC = (uint)surface;
break;
case PixelFormat.A8R8G8B8:
dDS_PIXELFORMAT.dwFlags |= DDSPixelformatFlags.DDPF_ALPHAPIXELS | DDSPixelformatFlags.DDPF_RGB;
dDS_PIXELFORMAT.dwRGBBitCount = 0x20;
dDS_PIXELFORMAT.dwRBitMask = 0x00FF0000;
dDS_PIXELFORMAT.dwGBitMask = 0x0000FF00;
dDS_PIXELFORMAT.dwBBitMask = 0x000000FF;
dDS_PIXELFORMAT.dwABitMask = 0xFF000000;
break;
case PixelFormat.R8G8B8:
dDS_PIXELFORMAT.dwFlags |= DDSPixelformatFlags.DDPF_RGB;
dDS_PIXELFORMAT.dwRGBBitCount = 0x18;
dDS_PIXELFORMAT.dwRBitMask = 0x00FF0000;
dDS_PIXELFORMAT.dwGBitMask = 0x0000FF00;
dDS_PIXELFORMAT.dwBBitMask = 0x000000FF;
break;
case PixelFormat.A8:
dDS_PIXELFORMAT.dwFlags |= DDSPixelformatFlags.DDPF_ALPHAPIXELS;
dDS_PIXELFORMAT.dwRGBBitCount = 0x8;
dDS_PIXELFORMAT.dwABitMask = 0xFF;
break;
default:
dDS_PIXELFORMAT.dwFlags |= DDSPixelformatFlags.DDPF_FOURCC;
break;
}
return dDS_PIXELFORMAT;
}
public static uint CalculateCompressedBlockSize(uint height, uint width, uint blockSize) {
return ((width + 3) / 4) * ((height + 3) / 4) * blockSize;
}
}
public struct DDS_HEADER {
public uint dwSize;
public DDSHeaderFlags dwFlags;
public uint dwHeight;
public uint dwWidth;
public uint dwPitchOrLinearSize;
public uint dwDepth;
public uint dwMipMapCount;
public uint[] dwReserved1;
public DDS_PIXELFORMAT ddspf;
public uint dwCaps;
public uint dwCaps2;
public uint dwCaps3;
public uint dwCaps4;
public uint dwReserved2;
public DDS_HEADER() {
dwSize = 124; //Fixed on 124 octets
dwFlags = 0;
dwHeight = 0;
dwWidth = 0;
dwPitchOrLinearSize = 0;
dwDepth = 0;
dwMipMapCount = 0;
dwReserved1 = new uint[11];
foreach (var i in dwReserved1) dwReserved1[i] = 0x00000000;
ddspf = new DDS_PIXELFORMAT();
dwCaps = 0x1000;
dwCaps2 = 0;
dwCaps3 = 0;
dwCaps4 = 0;
dwReserved2 = 0;
}
}
public struct DDS_PIXELFORMAT {
public uint dwSize;
public DDSPixelformatFlags dwFlags;
public uint dwFourCC;
public uint dwRGBBitCount;
public uint dwRBitMask;
public uint dwGBitMask;
public uint dwBBitMask;
public uint dwABitMask;
public DDS_PIXELFORMAT() {
dwSize = 32; //Fixed on 32 octets
dwFlags = 0;
dwFourCC = 0;
dwRGBBitCount = 0;
dwRBitMask = 0;
dwGBitMask = 0;
dwBBitMask = 0;
dwABitMask = 0;
}
}
[Flags]
public enum DDSHeaderFlags : uint {
NONE = 0,
DDSD_CAPS = 1 << 0, // 0x00000001
DDSD_HEIGHT = 1 << 1, // 0x00000002
DDSD_WIDTH = 1 << 2, // 0x00000004
DDSD_PITCH = 1 << 3, // 0x00000008
DDSD_PIXELFORMAT = 1 << 12, // 0x00001000
DDSD_MIPMAPCOUNT = 1 << 17, // 0x00020000
DDSD_LINEARSIZE = 1 << 19, // 0x00080000
DDSD_DEPTH = 1 << 23, // 0x00800000
}
[Flags]
public enum DDSPixelformatFlags : uint {
NONE = 0,
DDPF_ALPHAPIXELS = 1 << 0, // 0x00000001
DDPF_ALPHA = 1 << 1, // 0x00000002
DDPF_FOURCC = 1 << 2, // 0x00000004
DDPF_RGB = 1 << 6, // 0x00000040
DDPF_YUV = 1 << 9, // 0x00000200
DDPF_LUMINANCE = 1 << 17, // 0x00020000
}

View file

@ -0,0 +1,14 @@
using ImageMagick;
namespace LandblockExtraction.Tools;
public static class ImageTools {
public static byte[] DdsToPng(Stream stream) {
using (IMagickImage image = new MagickImage(stream)) {
image.Format = MagickFormat.Jpg;
using (MemoryStream memoryStream = new MemoryStream()) {
image.Write(memoryStream);
return memoryStream.ToArray();
}
}
}
}

View file

@ -0,0 +1,28 @@
using AC2RE.Definitions;
using System.Numerics;
namespace LandblockExtraction.Tools {
public static class MathOperations {
public static uint GetXLandblock(uint landblock) {
return (landblock & 0xFF000000) >> 24;
}
public static uint GetYLandblock(uint landblock) {
return (landblock & 0x00FF0000) >> 16;
}
public static uint GetTerrainInCellInfo(uint cellInfo) {
return (cellInfo >> 0) & (0x7f);
}
public static uint GetRoadInCellInfo(uint cellInfo) {
return (cellInfo >> 24) & (0xff);
}
public static uint GetColorInCellInfo(uint cellInfo) {
return (cellInfo >> 16) & (0xff);
}
public static uint GetSceneInCellInfo(uint cellInfo) {
return (cellInfo >> 7) & (0x1f);
}
public static Vector4 RGBAColorToVector4(RGBAColor color) {
return new Vector4(color.r, color.g, color.b, color.a);
}
}
}

Binary file not shown.

View file

@ -0,0 +1,53 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v7.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"LandblockExtraction/1.0.0": {
"dependencies": {
"AC2RE.Definitions": "1.0.0.0",
"AC2RE.Utils": "1.0.0.0"
},
"runtime": {
"LandblockExtraction.dll": {}
}
},
"AC2RE.Definitions/1.0.0.0": {
"runtime": {
"AC2RE.Definitions.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
},
"AC2RE.Utils/1.0.0.0": {
"runtime": {
"AC2RE.Utils.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
}
}
},
"libraries": {
"LandblockExtraction/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"AC2RE.Definitions/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"AC2RE.Utils/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
}
}
}

View file

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]

View file

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.42000
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("LandblockExtraction")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("LandblockExtraction")]
[assembly: System.Reflection.AssemblyTitleAttribute("LandblockExtraction")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Généré par la classe MSBuild WriteCodeFragment.

View file

@ -0,0 +1 @@
fcb85b1f1be3aecde831cdbd2e1d164333d97472cf0802e51f27acbf510e4597

View file

@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net7.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = LandblockExtraction
build_property.ProjectDir = C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

View file

@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View file

@ -0,0 +1 @@
ae3225192e6b65595b6f193c5e16a86f86815259ffd4c9105f4aa585389a2823

View file

@ -0,0 +1,15 @@
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\bin\Debug\net7.0\LandblockExtraction.deps.json
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\bin\Debug\net7.0\LandblockExtraction.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\bin\Debug\net7.0\LandblockExtraction.pdb
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\bin\Debug\net7.0\AC2RE.Definitions.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\bin\Debug\net7.0\AC2RE.Utils.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\LandblockExtraction.csproj.AssemblyReference.cache
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\LandblockExtraction.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\LandblockExtraction.AssemblyInfoInputs.cache
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\LandblockExtraction.AssemblyInfo.cs
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\LandblockExtraction.csproj.CoreCompileInputs.cache
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\LandblockExtraction.csproj.CopyComplete
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\LandblockExtraction.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\refint\LandblockExtraction.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\LandblockExtraction.pdb
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\LandblockExtraction\obj\Debug\net7.0\ref\LandblockExtraction.dll

View file

@ -0,0 +1,69 @@
{
"format": 1,
"restore": {
"C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj": {}
},
"projects": {
"C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj",
"projectName": "LandblockExtraction",
"projectPath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj",
"packagesPath": "C:\\Users\\Troispoils\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Troispoils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"dependencies": {
"Magick.NET-Q16-AnyCPU": {
"target": "Package",
"version": "[13.6.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Troispoils\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.8.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Troispoils\.nuget\packages\" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)magick.net-q16-anycpu\13.6.0\build\netstandard20\Magick.NET-Q16-AnyCPU.targets" Condition="Exists('$(NuGetPackageRoot)magick.net-q16-anycpu\13.6.0\build\netstandard20\Magick.NET-Q16-AnyCPU.targets')" />
</ImportGroup>
</Project>

View file

@ -0,0 +1,192 @@
{
"version": 3,
"targets": {
"net7.0": {
"Magick.NET-Q16-AnyCPU/13.6.0": {
"type": "package",
"dependencies": {
"Magick.NET.Core": "13.6.0"
},
"compile": {
"lib/netstandard21/Magick.NET-Q16-AnyCPU.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netstandard21/Magick.NET-Q16-AnyCPU.dll": {
"related": ".xml"
}
},
"build": {
"build/netstandard20/Magick.NET-Q16-AnyCPU.targets": {}
},
"runtimeTargets": {
"runtimes/linux-arm64/native/Magick.Native-Q16-arm64.dll.so": {
"assetType": "native",
"rid": "linux-arm64"
},
"runtimes/linux-musl-x64/native/Magick.Native-Q16-x64.dll.so": {
"assetType": "native",
"rid": "linux-musl-x64"
},
"runtimes/linux-x64/native/Magick.Native-Q16-x64.dll.so": {
"assetType": "native",
"rid": "linux-x64"
},
"runtimes/osx-arm64/native/Magick.Native-Q16-arm64.dll.dylib": {
"assetType": "native",
"rid": "osx-arm64"
},
"runtimes/osx-x64/native/Magick.Native-Q16-x64.dll.dylib": {
"assetType": "native",
"rid": "osx-x64"
},
"runtimes/win-arm64/native/Magick.Native-Q16-arm64.dll": {
"assetType": "native",
"rid": "win-arm64"
},
"runtimes/win-x64/native/Magick.Native-Q16-x64.dll": {
"assetType": "native",
"rid": "win-x64"
},
"runtimes/win-x86/native/Magick.Native-Q16-x86.dll": {
"assetType": "native",
"rid": "win-x86"
}
}
},
"Magick.NET.Core/13.6.0": {
"type": "package",
"compile": {
"lib/netstandard21/Magick.NET.Core.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netstandard21/Magick.NET.Core.dll": {
"related": ".xml"
}
}
}
}
},
"libraries": {
"Magick.NET-Q16-AnyCPU/13.6.0": {
"sha512": "yuRR9pMdf6DoQ0aa9u/CAANeaeMW4PxzCw4EMSm349/VLVa3bLv70hm2w6kQXpTpf+IPf2Th1+5AbcNA12sHrw==",
"type": "package",
"path": "magick.net-q16-anycpu/13.6.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Magick.NET.icon.png",
"Notice.linux-musl.txt",
"Notice.linux.txt",
"Notice.osx.txt",
"Notice.win.txt",
"build/netstandard20/Magick.NET-Q16-AnyCPU.targets",
"docs/Readme.md",
"lib/netstandard20/Magick.NET-Q16-AnyCPU.dll",
"lib/netstandard20/Magick.NET-Q16-AnyCPU.xml",
"lib/netstandard21/Magick.NET-Q16-AnyCPU.dll",
"lib/netstandard21/Magick.NET-Q16-AnyCPU.xml",
"magick.net-q16-anycpu.13.6.0.nupkg.sha512",
"magick.net-q16-anycpu.nuspec",
"runtimes/linux-arm64/native/Magick.Native-Q16-arm64.dll.so",
"runtimes/linux-musl-x64/native/Magick.Native-Q16-x64.dll.so",
"runtimes/linux-x64/native/Magick.Native-Q16-x64.dll.so",
"runtimes/osx-arm64/native/Magick.Native-Q16-arm64.dll.dylib",
"runtimes/osx-x64/native/Magick.Native-Q16-x64.dll.dylib",
"runtimes/win-arm64/native/Magick.Native-Q16-arm64.dll",
"runtimes/win-x64/native/Magick.Native-Q16-x64.dll",
"runtimes/win-x86/native/Magick.Native-Q16-x86.dll"
]
},
"Magick.NET.Core/13.6.0": {
"sha512": "VHW7fxIM/5z0m7pm6XXkAqTTCg6DlvVyn6MS/DhJ1bwY9v8W27AdhYDWOLns2P9zkD0WR72YAXPlcVbbIBVW6A==",
"type": "package",
"path": "magick.net.core/13.6.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Copyright.txt",
"Magick.NET.icon.png",
"docs/Readme.md",
"lib/netstandard20/Magick.NET.Core.dll",
"lib/netstandard20/Magick.NET.Core.xml",
"lib/netstandard21/Magick.NET.Core.dll",
"lib/netstandard21/Magick.NET.Core.xml",
"magick.net.core.13.6.0.nupkg.sha512",
"magick.net.core.nuspec"
]
}
},
"projectFileDependencyGroups": {
"net7.0": [
"Magick.NET-Q16-AnyCPU >= 13.6.0"
]
},
"packageFolders": {
"C:\\Users\\Troispoils\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj",
"projectName": "LandblockExtraction",
"projectPath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj",
"packagesPath": "C:\\Users\\Troispoils\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Troispoils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"dependencies": {
"Magick.NET-Q16-AnyCPU": {
"target": "Package",
"version": "[13.6.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100\\RuntimeIdentifierGraph.json"
}
}
}
}

View file

@ -0,0 +1,11 @@
{
"version": 2,
"dgSpecHash": "Qpb5GJsbpATaMM6x+8ls8LBnRs8xbmQdHBcQ9c+NaUAfHopyuH5R2jLwghH5f1df0rfONdea9gg14m/BbUiqSg==",
"success": true,
"projectFilePath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj",
"expectedPackageFiles": [
"C:\\Users\\Troispoils\\.nuget\\packages\\magick.net-q16-anycpu\\13.6.0\\magick.net-q16-anycpu.13.6.0.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\magick.net.core\\13.6.0\\magick.net.core.13.6.0.nupkg.sha512"
],
"logs": []
}

BIN
Libs/AC2RE.Definitions.dll Normal file

Binary file not shown.

BIN
Libs/AC2RE.Utils.dll Normal file

Binary file not shown.

42
Map3DRendering.sln Normal file
View file

@ -0,0 +1,42 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34330.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Map3DRendering", "Map3DRendering\Map3DRendering.csproj", "{B2ED409E-ACF9-4D6B-9632-6B9A7D0C3386}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LandblockExtraction", "LandblockExtraction\LandblockExtraction.csproj", "{CE966441-7638-4137-BD1A-A8ED612A4E81}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_LandblockExtraction", "Test_LandblockExtraction\Test_LandblockExtraction.csproj", "{23CE2C14-661B-4544-A768-5475809641FC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestUnit", "TestUnit", "{9CEDBDBC-D718-4F94-A8C7-8A10835816E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B2ED409E-ACF9-4D6B-9632-6B9A7D0C3386}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2ED409E-ACF9-4D6B-9632-6B9A7D0C3386}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2ED409E-ACF9-4D6B-9632-6B9A7D0C3386}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2ED409E-ACF9-4D6B-9632-6B9A7D0C3386}.Release|Any CPU.Build.0 = Release|Any CPU
{CE966441-7638-4137-BD1A-A8ED612A4E81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE966441-7638-4137-BD1A-A8ED612A4E81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE966441-7638-4137-BD1A-A8ED612A4E81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE966441-7638-4137-BD1A-A8ED612A4E81}.Release|Any CPU.Build.0 = Release|Any CPU
{23CE2C14-661B-4544-A768-5475809641FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23CE2C14-661B-4544-A768-5475809641FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23CE2C14-661B-4544-A768-5475809641FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23CE2C14-661B-4544-A768-5475809641FC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{23CE2C14-661B-4544-A768-5475809641FC} = {9CEDBDBC-D718-4F94-A8C7-8A10835816E3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6D193CE6-9C4B-4DE3-B80F-ED5DF195FC6C}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,106 @@
using OpenTK.Mathematics;
namespace Map3DRendering.Common {
// This is the camera class as it could be set up after the tutorials on the website.
// It is important to note there are a few ways you could have set up this camera.
// For example, you could have also managed the player input inside the camera class,
// and a lot of the properties could have been made into functions.
// TL;DR: This is just one of many ways in which we could have set up the camera.
// Check out the web version if you don't know why we are doing a specific thing or want to know more about the code.
public class Camera {
// Those vectors are directions pointing outwards from the camera to define how it rotated.
private Vector3 _front = -Vector3.UnitZ;
private Vector3 _up = Vector3.UnitY;
private Vector3 _right = Vector3.UnitX;
// Rotation around the X axis (radians)
private float _pitch;
// Rotation around the Y axis (radians)
private float _yaw = -MathHelper.PiOver2; // Without this, you would be started rotated 90 degrees right.
// The field of view of the camera (radians)
private float _fov = MathHelper.PiOver2;
public Camera(Vector3 position, float aspectRatio) {
Position = position;
AspectRatio = aspectRatio;
}
// The position of the camera
public Vector3 Position { get; set; }
// This is simply the aspect ratio of the viewport, used for the projection matrix.
public float AspectRatio { private get; set; }
public Vector3 Front => _front;
public Vector3 Up => _up;
public Vector3 Right => _right;
// We convert from degrees to radians as soon as the property is set to improve performance.
public float Pitch {
get => MathHelper.RadiansToDegrees(_pitch);
set {
// We clamp the pitch value between -89 and 89 to prevent the camera from going upside down, and a bunch
// of weird "bugs" when you are using euler angles for rotation.
// If you want to read more about this you can try researching a topic called gimbal lock
var angle = MathHelper.Clamp(value, -89f, 89f);
_pitch = MathHelper.DegreesToRadians(angle);
UpdateVectors();
}
}
// We convert from degrees to radians as soon as the property is set to improve performance.
public float Yaw {
get => MathHelper.RadiansToDegrees(_yaw);
set {
_yaw = MathHelper.DegreesToRadians(value);
UpdateVectors();
}
}
// The field of view (FOV) is the vertical angle of the camera view.
// This has been discussed more in depth in a previous tutorial,
// but in this tutorial, you have also learned how we can use this to simulate a zoom feature.
// We convert from degrees to radians as soon as the property is set to improve performance.
public float Fov {
get => MathHelper.RadiansToDegrees(_fov);
set {
var angle = MathHelper.Clamp(value, 1f, 90f);
_fov = MathHelper.DegreesToRadians(angle);
}
}
// Get the view matrix using the amazing LookAt function described more in depth on the web tutorials
public Matrix4 GetViewMatrix() {
return Matrix4.LookAt(Position, Position + _front, _up);
}
// Get the projection matrix using the same method we have used up until this point
public Matrix4 GetProjectionMatrix() {
return Matrix4.CreatePerspectiveFieldOfView(_fov, AspectRatio, 0.01f, 1000f);
}
// This function is going to update the direction vertices using some of the math learned in the web tutorials.
private void UpdateVectors() {
// First, the front matrix is calculated using some basic trigonometry.
_front.X = MathF.Cos(_pitch) * MathF.Cos(_yaw);
_front.Y = MathF.Sin(_pitch);
_front.Z = MathF.Cos(_pitch) * MathF.Sin(_yaw);
// We need to make sure the vectors are all normalized, as otherwise we would get some funky results.
_front = Vector3.Normalize(_front);
// Calculate both the right and the up vector using cross product.
// Note that we are calculating the right from the global up; this behaviour might
// not be what you need for all cameras so keep this in mind if you do not want a FPS camera.
_right = Vector3.Normalize(Vector3.Cross(_front, Vector3.UnitY));
_up = Vector3.Normalize(Vector3.Cross(_right, _front));
}
}
}

View file

@ -0,0 +1,176 @@
using OpenTK.Graphics.OpenGL4;
using OpenTK.Mathematics;
namespace Map3DRendering.Common {
// A simple class meant to help create shaders.
public class Shader {
public readonly int Handle;
private readonly Dictionary<string, int> _uniformLocations;
// This is how you create a simple shader.
// Shaders are written in GLSL, which is a language very similar to C in its semantics.
// The GLSL source is compiled *at runtime*, so it can optimize itself for the graphics card it's currently being used on.
// A commented example of GLSL can be found in shader.vert.
public Shader(string vertPath, string fragPath) {
// There are several different types of shaders, but the only two you need for basic rendering are the vertex and fragment shaders.
// The vertex shader is responsible for moving around vertices, and uploading that data to the fragment shader.
// The vertex shader won't be too important here, but they'll be more important later.
// The fragment shader is responsible for then converting the vertices to "fragments", which represent all the data OpenGL needs to draw a pixel.
// The fragment shader is what we'll be using the most here.
// Load vertex shader and compile
var shaderSource = File.ReadAllText(vertPath);
// GL.CreateShader will create an empty shader (obviously). The ShaderType enum denotes which type of shader will be created.
var vertexShader = GL.CreateShader(ShaderType.VertexShader);
// Now, bind the GLSL source code
GL.ShaderSource(vertexShader, shaderSource);
// And then compile
CompileShader(vertexShader);
// We do the same for the fragment shader.
shaderSource = File.ReadAllText(fragPath);
var fragmentShader = GL.CreateShader(ShaderType.FragmentShader);
GL.ShaderSource(fragmentShader, shaderSource);
CompileShader(fragmentShader);
// These two shaders must then be merged into a shader program, which can then be used by OpenGL.
// To do this, create a program...
Handle = GL.CreateProgram();
// Attach both shaders...
GL.AttachShader(Handle, vertexShader);
GL.AttachShader(Handle, fragmentShader);
// And then link them together.
LinkProgram(Handle);
// When the shader program is linked, it no longer needs the individual shaders attached to it; the compiled code is copied into the shader program.
// Detach them, and then delete them.
GL.DetachShader(Handle, vertexShader);
GL.DetachShader(Handle, fragmentShader);
GL.DeleteShader(fragmentShader);
GL.DeleteShader(vertexShader);
// The shader is now ready to go, but first, we're going to cache all the shader uniform locations.
// Querying this from the shader is very slow, so we do it once on initialization and reuse those values
// later.
// First, we have to get the number of active uniforms in the shader.
GL.GetProgram(Handle, GetProgramParameterName.ActiveUniforms, out var numberOfUniforms);
// Next, allocate the dictionary to hold the locations.
_uniformLocations = new Dictionary<string, int>();
// Loop over all the uniforms,
for (var i = 0; i < numberOfUniforms; i++) {
// get the name of this uniform,
var key = GL.GetActiveUniform(Handle, i, out _, out _);
// get the location,
var location = GL.GetUniformLocation(Handle, key);
// and then add it to the dictionary.
_uniformLocations.Add(key, location);
}
}
private static void CompileShader(int shader) {
// Try to compile the shader
GL.CompileShader(shader);
// Check for compilation errors
GL.GetShader(shader, ShaderParameter.CompileStatus, out var code);
if (code != (int)All.True) {
// We can use `GL.GetShaderInfoLog(shader)` to get information about the error.
var infoLog = GL.GetShaderInfoLog(shader);
throw new Exception($"Error occurred whilst compiling Shader({shader}).\n\n{infoLog}");
}
}
private static void LinkProgram(int program) {
// We link the program
GL.LinkProgram(program);
// Check for linking errors
GL.GetProgram(program, GetProgramParameterName.LinkStatus, out var code);
if (code != (int)All.True) {
// We can use `GL.GetProgramInfoLog(program)` to get information about the error.
throw new Exception($"Error occurred whilst linking Program({program})");
}
}
// A wrapper function that enables the shader program.
public void Use() {
GL.UseProgram(Handle);
}
// The shader sources provided with this project use hardcoded layout(location)-s. If you want to do it dynamically,
// you can omit the layout(location=X) lines in the vertex shader, and use this in VertexAttribPointer instead of the hardcoded values.
public int GetAttribLocation(string attribName) {
return GL.GetAttribLocation(Handle, attribName);
}
// Uniform setters
// Uniforms are variables that can be set by user code, instead of reading them from the VBO.
// You use VBOs for vertex-related data, and uniforms for almost everything else.
// Setting a uniform is almost always the exact same, so I'll explain it here once, instead of in every method:
// 1. Bind the program you want to set the uniform on
// 2. Get a handle to the location of the uniform with GL.GetUniformLocation.
// 3. Use the appropriate GL.Uniform* function to set the uniform.
/// <summary>
/// Set a uniform int on this shader.
/// </summary>
/// <param name="name">The name of the uniform</param>
/// <param name="data">The data to set</param>
public void SetInt(string name, int data) {
GL.UseProgram(Handle);
GL.Uniform1(_uniformLocations[name], data);
}
/// <summary>
/// Set a uniform float on this shader.
/// </summary>
/// <param name="name">The name of the uniform</param>
/// <param name="data">The data to set</param>
public void SetFloat(string name, float data) {
GL.UseProgram(Handle);
GL.Uniform1(_uniformLocations[name], data);
}
/// <summary>
/// Set a uniform Matrix4 on this shader
/// </summary>
/// <param name="name">The name of the uniform</param>
/// <param name="data">The data to set</param>
/// <remarks>
/// <para>
/// The matrix is transposed before being sent to the shader.
/// </para>
/// </remarks>
public void SetMatrix4(string name, Matrix4 data) {
GL.UseProgram(Handle);
GL.UniformMatrix4(_uniformLocations[name], true, ref data);
}
/// <summary>
/// Set a uniform Vector3 on this shader.
/// </summary>
/// <param name="name">The name of the uniform</param>
/// <param name="data">The data to set</param>
public void SetVector3(string name, Vector3 data) {
GL.UseProgram(Handle);
GL.Uniform3(_uniformLocations[name], data);
}
public void SetVector4(string name, Vector4 data) {
GL.UseProgram(Handle);
GL.Uniform4(_uniformLocations[name], data);
}
}
}

View file

@ -0,0 +1,86 @@
using OpenTK.Graphics.OpenGL4;
using StbImageSharp;
namespace Map3DRendering.Common {
// A helper class, much like Shader, meant to simplify loading textures.
public class Texture {
public readonly int Handle;
public static Texture LoadFromFile(string path) {
// Generate handle
int handle = GL.GenTexture();
// Bind the handle
GL.ActiveTexture(TextureUnit.Texture0);
GL.BindTexture(TextureTarget.Texture2D, handle);
// For this example, we're going to use .NET's built-in System.Drawing library to load textures.
// OpenGL has it's texture origin in the lower left corner instead of the top left corner,
// so we tell StbImageSharp to flip the image when loading.
StbImage.stbi_set_flip_vertically_on_load(1);
// Here we open a stream to the file and pass it to StbImageSharp to load.
using (Stream stream = File.OpenRead(path)) {
ImageResult image = ImageResult.FromStream(stream, ColorComponents.RedGreenBlueAlpha);
// Now that our pixels are prepared, it's time to generate a texture. We do this with GL.TexImage2D.
// Arguments:
// The type of texture we're generating. There are various different types of textures, but the only one we need right now is Texture2D.
// Level of detail. We can use this to start from a smaller mipmap (if we want), but we don't need to do that, so leave it at 0.
// Target format of the pixels. This is the format OpenGL will store our image with.
// Width of the image
// Height of the image.
// Border of the image. This must always be 0; it's a legacy parameter that Khronos never got rid of.
// The format of the pixels, explained above. Since we loaded the pixels as RGBA earlier, we need to use PixelFormat.Rgba.
// Data type of the pixels.
// And finally, the actual pixels.
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, image.Width, image.Height, 0, PixelFormat.Rgba, PixelType.UnsignedByte, image.Data);
}
// Now that our texture is loaded, we can set a few settings to affect how the image appears on rendering.
// First, we set the min and mag filter. These are used for when the texture is scaled down and up, respectively.
// Here, we use Linear for both. This means that OpenGL will try to blend pixels, meaning that textures scaled too far will look blurred.
// You could also use (amongst other options) Nearest, which just grabs the nearest pixel, which makes the texture look pixelated if scaled too far.
// NOTE: The default settings for both of these are LinearMipmap. If you leave these as default but don't generate mipmaps,
// your image will fail to render at all (usually resulting in pure black instead).
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
// Now, set the wrapping mode. S is for the X axis, and T is for the Y axis.
// We set this to Repeat so that textures will repeat when wrapped. Not demonstrated here since the texture coordinates exactly match
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Repeat);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Repeat);
// Next, generate mipmaps.
// Mipmaps are smaller copies of the texture, scaled down. Each mipmap level is half the size of the previous one
// Generated mipmaps go all the way down to just one pixel.
// OpenGL will automatically switch between mipmaps when an object gets sufficiently far away.
// This prevents moiré effects, as well as saving on texture bandwidth.
// Here you can see and read about the morié effect https://en.wikipedia.org/wiki/Moir%C3%A9_pattern
// Here is an example of mips in action https://en.wikipedia.org/wiki/File:Mipmap_Aliasing_Comparison.png
GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
return new Texture(handle);
}
public Texture(int glHandle) {
Handle = glHandle;
}
// Activate texture
// Multiple textures can be bound, if your shader needs more than just one.
// If you want to do that, use GL.ActiveTexture to set which slot GL.BindTexture binds to.
// The OpenGL standard requires that there be at least 16, but there can be more depending on your graphics card.
public void Use(TextureUnit unit) {
GL.ActiveTexture(unit);
GL.BindTexture(TextureTarget.Texture2D, Handle);
}
public void Assign(int shader, int i) {
int location = GL.GetUniformLocation(shader, "textures[" + i.ToString() + "]");
GL.Uniform1(location, i);
}
}
}

View file

@ -0,0 +1,61 @@
using Map3DRendering.Common;
using OpenTK.Graphics.OpenGL4;
using OpenTK.Mathematics;
namespace Map3DRendering {
public class AxesGizmo {
private Shader axesShader;
private int vao;
public AxesGizmo() {
// Initialisation du shader
axesShader = new Shader("Shaders/Gizmo/axes.vert", "Shaders/Gizmo/axes.frag");
// Configuration des données des axes (positions et couleurs)
float[] axesVertices = {
// Axe X, rouge
0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
// Axe Y, vert
0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
// Axe Z, bleu
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f
};
vao = GL.GenVertexArray();
int vbo = GL.GenBuffer();
GL.BindVertexArray(vao);
GL.BindBuffer(BufferTarget.ArrayBuffer, vbo);
GL.BufferData(BufferTarget.ArrayBuffer, axesVertices.Length * sizeof(float), axesVertices, BufferUsageHint.StaticDraw);
// Position attribute
GL.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, false, 6 * sizeof(float), 0);
GL.EnableVertexAttribArray(0);
// Color attribute
GL.VertexAttribPointer(1, 3, VertexAttribPointerType.Float, false, 6 * sizeof(float), 3 * sizeof(float));
GL.EnableVertexAttribArray(1);
}
public void Render(int windowWidth, int windowHeight, Camera camera) {
int gizmoSize = 200; // Taille du gizmo en pixels
GL.Viewport(windowWidth - (gizmoSize + 50), windowHeight - (gizmoSize + 50), gizmoSize, gizmoSize);
Matrix4 gizmoProjection = Matrix4.CreateOrthographicOffCenter(-1f, 1f, -1f, 1f, 0, 1);
Matrix4 cameraRotation = camera.GetViewMatrix();
cameraRotation.Row3 = Vector4.UnitW; // Réinitialise la translation
axesShader.Use();
axesShader.SetMatrix4("view", cameraRotation);
axesShader.SetMatrix4("projection", gizmoProjection);
GL.BindVertexArray(vao);
GL.DrawArrays(PrimitiveType.Lines, 0, 6); // 6 points pour les 3 lignes des axes
GL.Viewport(0, 0, windowWidth, windowHeight); // Rétablissement du viewport principal
}
}
}

View file

@ -0,0 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenTK" Version="4.8.2" />
<PackageReference Include="StbImageSharp" Version="2.27.13" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LandblockExtraction\LandblockExtraction.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Shaders\Gizmo\" />
</ItemGroup>
<ItemGroup>
<None Update="Shaders\Gizmo\axes.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Shaders\Gizmo\axes.vert">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Shaders\lighting.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Shaders\shader.frag">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Shaders\shader.vert">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

161
Map3DRendering/MapRender.cs Normal file
View file

@ -0,0 +1,161 @@
using LandblockExtraction.DatEngine;
using LandblockExtraction.LandBlockExtractor;
using Map3DRendering.Common;
using OpenTK.Graphics.OpenGL4;
using OpenTK.Mathematics;
namespace Map3DRendering {
public class MapRender {
private PortalEngine portalEngine;
private CellEngine cellEngine;
private LandBlockExtrator landblockExtraction;
private readonly int NumberLandBlocks = 255;
private readonly int BlockSize = 17;
private readonly int allBlocks = 255 * 17 * 255 * 17;
private readonly int cellSize = 8;
private readonly int radius = 0x10; // Rayon du voisinage
public int[,] _vertexArrayObject;
public int[,] _vertexBufferObject;
public int[,] _elementBufferObject;
public bool[,] _mapExiste;
public int currentLandBlockX { get; private set; } // Position X du landblock actuel
public int currentLandBlockY { get; private set; } // Position Y du landblock actuel
public int startX { get; private set; }
public int startY { get; private set; }
public int endX { get; private set; }
public int endY { get; private set; }
public MapRender() {
portalEngine = new PortalEngine();
cellEngine = new CellEngine();
landblockExtraction = new(portalEngine, cellEngine);
_vertexArrayObject = new int[0xFE, 0xFE];
_vertexBufferObject = new int[0xFE, 0xFE];
_elementBufferObject = new int[0xFE, 0xFE];
_mapExiste = new bool[0xFE, 0xFE];
currentLandBlockX = 0x7F;
currentLandBlockY = 0x7F;
CalculeRadius(currentLandBlockX, currentLandBlockY);
}
public int GetIndiceLenght() {
return (17 - 1) * (17 - 1) * 6; //Always that.
}
public void CalculeRadius(int x, int y) {
currentLandBlockX = x;
currentLandBlockY = y;
startX = Math.Max(0, currentLandBlockX - radius);
startY = Math.Max(0, currentLandBlockY - radius);
endX = Math.Min(NumberLandBlocks - 1, currentLandBlockX + radius);
endY = Math.Min(NumberLandBlocks - 1, currentLandBlockY + radius);
}
public void OnLoad(Shader _shader) {
for (int landY = startY; landY <= endY; landY++) {
for (int landX = startX; landX <= endX; landX++) {
if (!_mapExiste[landX, landY]) {
var block = landblockExtraction.GetBlock(landX, landY);
if (block != null) {
InitializeBlock(landX, landY, block, _shader);
_mapExiste[landX, landY] = true;
}
}
}
}
}
private void InitializeBlock(int x, int y, BlockStruct block, Shader _shader) {
int lenghPacket = 11;
// Initialisez le VAO, VBO et EBO pour le bloc à (x, y)...
// Utilisez le code de votre méthode OnLoad originale pour configurer le VAO, VBO et EBO.
int tempVertexArray = GL.GenVertexArray();
GL.BindVertexArray(tempVertexArray);
_vertexArrayObject[x, y] = tempVertexArray;
int tmpVertexBuffer = GL.GenBuffer();
GL.BindBuffer(BufferTarget.ArrayBuffer, tmpVertexBuffer);
GL.BufferData(BufferTarget.ArrayBuffer, block.verticesStruct.Vertices().Length * sizeof(float), block.verticesStruct.Vertices(), BufferUsageHint.StaticDraw);
_vertexBufferObject[x, y] = tmpVertexBuffer;
GL.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, false, lenghPacket * sizeof(float), 0);
int tmpElementBuffer = GL.GenBuffer();
GL.BindBuffer(BufferTarget.ElementArrayBuffer, tmpElementBuffer);
GL.BufferData(BufferTarget.ElementArrayBuffer, block.indices.Length * sizeof(int), block.indices, BufferUsageHint.StaticDraw);
_elementBufferObject[x, y] = tmpElementBuffer;
var vertexLocation = _shader.GetAttribLocation("aPos");
GL.EnableVertexAttribArray(vertexLocation);
GL.VertexAttribPointer(vertexLocation, 3, VertexAttribPointerType.Float, false, lenghPacket * sizeof(float), 0);
var colorLocation = _shader.GetAttribLocation("aColor");
GL.EnableVertexAttribArray(colorLocation);
GL.VertexAttribPointer(colorLocation, 4, VertexAttribPointerType.Float, false, lenghPacket * sizeof(float), 3 * sizeof(float));
var farcolorLocation = _shader.GetAttribLocation("aColorFar");
GL.EnableVertexAttribArray(farcolorLocation);
GL.VertexAttribPointer(farcolorLocation, 4, VertexAttribPointerType.Float, false, lenghPacket * sizeof(float), 7 * sizeof(float));
}
public void Render(Shader shader) {
for (int y = startY; y <= endY; y++) {
for (int x = startX; x <= endX; x++) {
if (_mapExiste[x, y]) {
var model = Matrix4.Identity;//CreateTranslation(x * BlockSize, 0, y * BlockSize); // Ajustez selon votre système de coordonnées
shader.SetMatrix4("model", model);
GL.BindVertexArray(_vertexArrayObject[x, y]);
GL.DrawElements(PrimitiveType.Lines, GetIndiceLenght(), DrawElementsType.UnsignedInt, 0);
}
}
}
}
public void CleanupBlock(int x, int y) {
if (_mapExiste[x, y]) {
GL.DeleteBuffer(_vertexBufferObject[x, y]);
GL.DeleteBuffer(_elementBufferObject[x, y]);
GL.DeleteVertexArray(_vertexArrayObject[x, y]);
_mapExiste[x, y] = false;
}
}
public void UpdateBlocks(Vector3 cameraPosition, Shader shader) {
// Convertir la position de la caméra en coordonnées de landblock
int newLandBlockX = ConvertPositionToLandBlockCoord(cameraPosition.X);
int newLandBlockY = (0xFF) - ConvertPositionToLandBlockCoord(cameraPosition.Z);
// Vérifier si la caméra a déplacé suffisamment pour nécessiter une mise à jour des blocs
if (newLandBlockX != currentLandBlockX || newLandBlockY != currentLandBlockY) {
// Nettoyer les blocs qui ne sont plus dans la nouvelle zone visible
for (int y = startY; y <= endY; y++) {
for (int x = startX; x <= endX; x++) {
if (!IsInNewRadius(x, y, newLandBlockX, newLandBlockY)) {
CleanupBlock(x, y);
}
}
}
// Mettre à jour les coordonnées du rayon pour la nouvelle position
CalculeRadius(newLandBlockX, newLandBlockY);
// Initialiser les nouveaux blocs dans la nouvelle zone visible
OnLoad(shader);
}
}
private int ConvertPositionToLandBlockCoord(float position) {
// Convertir la position en coordonnée de landblock, ajuster selon la mise en échelle de votre carte
return (int)(position / 128) + 0x7f; // Ajustez cette conversion en fonction de votre mise en échelle
}
private bool IsInNewRadius(int x, int y, int newLandBlockX, int newLandBlockY) {
// Calculer le nouveau startX, startY, endX, et endY basé sur newLandBlockX, newLandBlockY
int newStartX = Math.Max(0, newLandBlockX - radius);
int newStartY = Math.Max(0, newLandBlockY - radius);
int newEndX = Math.Min(NumberLandBlocks - 1, newLandBlockX + radius);
int newEndY = Math.Min(NumberLandBlocks - 1, newLandBlockY + radius);
// Vérifier si (x, y) est dans la nouvelle zone définie par newStartX, newStartY, newEndX, et newEndY
return x >= newStartX && x <= newEndX && y >= newStartY && y <= newEndY;
}
}
}

20
Map3DRendering/Program.cs Normal file
View file

@ -0,0 +1,20 @@
using OpenTK.Mathematics;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.Desktop;
namespace Map3DRendering {
public static class Program {
private static void Main() {
var nativeWindowSettings = new NativeWindowSettings() {
Size = new Vector2i(800, 600),
Title = "LearnOpenTK - Map AC2",
// This is needed to run on macos
Flags = ContextFlags.ForwardCompatible,
};
using (var window = new Window(GameWindowSettings.Default, nativeWindowSettings)) {
window.Run();
}
}
}
}

View file

@ -0,0 +1,8 @@
#version 330 core
in vec3 vertexColor;
out vec4 FragColor;
void main() {
FragColor = vec4(vertexColor, 1.0);
}

View file

@ -0,0 +1,14 @@
#version 330 core
layout (location = 0) in vec3 aPosition;
layout (location = 1) in vec3 aColor;
uniform mat4 view;
uniform mat4 projection;
out vec3 vertexColor;
void main() {
gl_Position = projection * view * vec4(aPosition, 1.0);
vertexColor = aColor;
}

View file

@ -0,0 +1,49 @@
#version 330 core
out vec4 FragColor;
//In order to calculate some basic lighting we need a few things per model basis, and a few things per fragment basis:
uniform vec3 objectColor; //The color of the object.
uniform vec3 lightColor; //The color of the light.
uniform vec3 lightPos; //The position of the light.
uniform vec3 viewPos; //The position of the view and/or of the player.
uniform vec4 lineColor;
uniform sampler2D texture0;
in vec3 Normal; //The normal of the fragment is calculated in the vertex shader.
in vec3 FragPos; //The fragment position.
in vec4 Color;
void main()
{
//The ambient color is the color where the light does not directly hit the object.
//You can think of it as an underlying tone throughout the object. Or the light coming from the scene/the sky (not the sun).
float ambientStrength = 1;
vec4 textureColor = Color;
vec3 ambient = ambientStrength * lightColor * textureColor;
//We calculate the light direction, and make sure the normal is normalized.
vec3 norm = normalize(Normal);
vec3 lightDir = normalize(lightPos - FragPos); //Note: The light is pointing from the light to the fragment
//The diffuse part of the phong model.
//This is the part of the light that gives the most, it is the color of the object where it is hit by light.
float diff = max(dot(norm, lightDir), 0.0); //We make sure the value is non negative with the max function.
vec3 diffuse = diff * lightColor;
//The specular light is the light that shines from the object, like light hitting metal.
//The calculations are explained much more detailed in the web version of the tutorials.
float specularStrength = 0.5;
vec3 viewDir = normalize(viewPos - FragPos);
vec3 reflectDir = reflect(-lightDir, norm);
float spec = pow(max(dot(viewDir, reflectDir), 0.0), 32); //The 32 is the shininess of the material.
vec3 specular = specularStrength * spec * lightColor;
//At last we add all the light components together and multiply with the color of the object. Then we set the color
//and makes sure the alpha value is 1
vec3 result = (ambient + diffuse + specular) * objectColor * textureColor;
FragColor = lineColor * vec4(result, 1.0);
//Note we still use the light color * object color from the last tutorial.
//This time the light values are in the phong model (ambient, diffuse and specular)
}

View file

@ -0,0 +1,17 @@
#version 330
out vec4 outputColor;
uniform vec3 viewPos;
in vec4 Color;
in vec4 FarColor;
in vec3 FragPos;
void main()
{
float distance = length(viewPos - FragPos);
float interpolationFactor = clamp(distance / 1000, 0.0, 1.0);
outputColor = mix(Color, FarColor, interpolationFactor);
}

View file

@ -0,0 +1,20 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec4 aColor;
layout (location = 2) in vec4 aColorFar;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
out vec3 FragPos;
out vec4 Color;
out vec4 FarColor;
void main()
{
gl_Position = vec4(aPos, 1.0) * model * view * projection;
FragPos = vec3(vec4(aPos, 1.0) * model);
Color = aColor;
FarColor = aColorFar;
}

168
Map3DRendering/Window.cs Normal file
View file

@ -0,0 +1,168 @@
using Map3DRendering.Common;
using OpenTK.Graphics.OpenGL4;
using OpenTK.Mathematics;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.Desktop;
using OpenTK.Windowing.GraphicsLibraryFramework;
namespace Map3DRendering {
public class Window : GameWindow {
private readonly Vector3 _lightPos = new Vector3(0x10, 0, 0x10);
private MapRender mapRender;
private AxesGizmo axesGizmo;
private Shader _shader;
private Texture _texture;
private Camera _camera;
private bool _firstMove = true;
private Vector2 _lastPos;
private double _time;
private float tileSize = 64;
private float cameraSpeed = 50f;
private int maxTextures;
public Window(GameWindowSettings gameWindowSettings, NativeWindowSettings nativeWindowSettings)
: base(gameWindowSettings, nativeWindowSettings) {
mapRender = new MapRender();
GL.GetInteger(GetPName.MaxTextureImageUnits, out maxTextures);
}
protected override void OnLoad() {
base.OnLoad();
GL.ClearColor(0.2f, 0.3f, 0.3f, 1.0f);
GL.Enable(EnableCap.DepthTest);
_shader = new Shader("Shaders/shader.vert", "Shaders/shader.frag");
_shader.Use();
mapRender.OnLoad(_shader);
//_texture = Texture.LoadFromFile("atlas.jpg");
//_texture.Use(TextureUnit.Texture0);
axesGizmo = new AxesGizmo();
_camera = new Camera(Vector3.UnitY * 300, Size.X / (float)Size.Y);
_camera.Fov = 60;
//CursorState = CursorState.Grabbed;
}
protected override void OnRenderFrame(FrameEventArgs e) {
base.OnRenderFrame(e);
_time += 4.0 * e.Time;
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
_shader.Use();
//_texture.Use(TextureUnit.Texture0);
_shader.SetMatrix4("view", _camera.GetViewMatrix());
_shader.SetMatrix4("projection", _camera.GetProjectionMatrix());
/*_shader.SetVector3("objectColor", new Vector3(0.5f, 0.5f, 0.5f));
_shader.SetVector3("lightColor", new Vector3(1.0f, 1.0f, 1.0f));
_shader.SetVector3("lightPos", _camera.Position);
_shader.SetVector3("viewPos", _camera.Position);*/
GL.LineWidth(5.0f);
_shader.SetVector3("viewPos", _camera.Position);
mapRender.UpdateBlocks(_camera.Position, _shader);
mapRender.Render(_shader);
axesGizmo.Render(Size.X, Size.Y, _camera);
SwapBuffers();
}
protected override void OnUpdateFrame(FrameEventArgs e) {
base.OnUpdateFrame(e);
if (!IsFocused) // Check to see if the window is focused
{
return;
}
var input = KeyboardState;
if (input.IsKeyDown(Keys.Escape)) {
Close();
}
const float sensitivity = 0.2f;
if (input.IsKeyDown(Keys.W)) {
_camera.Position += _camera.Front * cameraSpeed * (float)e.Time; // Forward
}
if (input.IsKeyDown(Keys.S)) {
_camera.Position -= _camera.Front * cameraSpeed * (float)e.Time; // Backwards
}
if (input.IsKeyDown(Keys.A)) {
_camera.Position -= _camera.Right * cameraSpeed * (float)e.Time; // Left
}
if (input.IsKeyDown(Keys.D)) {
_camera.Position += _camera.Right * cameraSpeed * (float)e.Time; // Right
}
if (input.IsKeyDown(Keys.Space)) {
_camera.Position += _camera.Up * cameraSpeed * (float)e.Time; // Up
}
if (input.IsKeyDown(Keys.LeftShift)) {
_camera.Position -= _camera.Up * cameraSpeed * (float)e.Time; // Down
}
// Get the mouse state
var mouse = MouseState;
// Check if the right mouse button is pressed
if (mouse.IsButtonDown(MouseButton.Right)) {
CursorState = CursorState.Grabbed;
if (_firstMove) // This bool variable is initially set to true.
{
_lastPos = new Vector2(mouse.X, mouse.Y);
_firstMove = false;
} else {
// Calculate the offset of the mouse position
var deltaX = mouse.X - _lastPos.X;
var deltaY = mouse.Y - _lastPos.Y;
_lastPos = new Vector2(mouse.X, mouse.Y);
// Apply the camera pitch and yaw (we clamp the pitch in the camera class)
_camera.Yaw += deltaX * sensitivity;
_camera.Pitch -= deltaY * sensitivity; // Reversed since y-coordinates range from bottom to top
}
} else {
_firstMove = true;
CursorState = CursorState.Normal;
}
}
// In the mouse wheel function, we manage all the zooming of the camera.
// This is simply done by changing the FOV of the camera.
protected override void OnMouseWheel(MouseWheelEventArgs e) {
base.OnMouseWheel(e);
cameraSpeed -= e.OffsetY * 2f;
}
protected override void OnResize(ResizeEventArgs e) {
base.OnResize(e);
GL.Viewport(0, 0, Size.X, Size.Y);
// We need to update the aspect ratio once the window has been resized.
_camera.AspectRatio = Size.X / (float)Size.Y;
}
}
}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,308 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v7.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"Map3DRendering/1.0.0": {
"dependencies": {
"LandblockExtraction": "1.0.0",
"OpenTK": "4.8.2",
"StbImageSharp": "2.27.13"
},
"runtime": {
"Map3DRendering.dll": {}
}
},
"OpenTK/4.8.2": {
"dependencies": {
"OpenTK.Audio.OpenAL": "4.8.2",
"OpenTK.Compute": "4.8.2",
"OpenTK.Core": "4.8.2",
"OpenTK.Graphics": "4.8.2",
"OpenTK.Input": "4.8.2",
"OpenTK.Mathematics": "4.8.2",
"OpenTK.Windowing.Common": "4.8.2",
"OpenTK.Windowing.Desktop": "4.8.2",
"OpenTK.Windowing.GraphicsLibraryFramework": "4.8.2"
}
},
"OpenTK.Audio.OpenAL/4.8.2": {
"dependencies": {
"OpenTK.Core": "4.8.2",
"OpenTK.Mathematics": "4.8.2"
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Audio.OpenAL.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"OpenTK.Compute/4.8.2": {
"runtime": {
"lib/netcoreapp3.1/OpenTK.Compute.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"OpenTK.Core/4.8.2": {
"runtime": {
"lib/netstandard2.1/OpenTK.Core.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"OpenTK.Graphics/4.8.2": {
"dependencies": {
"OpenTK.Core": "4.8.2",
"OpenTK.Mathematics": "4.8.2"
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Graphics.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"OpenTK.Input/4.8.2": {
"runtime": {
"lib/netstandard2.0/OpenTK.Input.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"OpenTK.Mathematics/4.8.2": {
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "5.0.0"
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Mathematics.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"OpenTK.redist.glfw/3.3.8.39": {
"runtimeTargets": {
"runtimes/linux-x64/native/libglfw-wayland.so.3.3": {
"rid": "linux-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/linux-x64/native/libglfw.so.3.3": {
"rid": "linux-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/osx-arm64/native/libglfw.3.dylib": {
"rid": "osx-arm64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/osx-x64/native/libglfw.3.dylib": {
"rid": "osx-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/win-x64/native/glfw3.dll": {
"rid": "win-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/win-x86/native/glfw3.dll": {
"rid": "win-x86",
"assetType": "native",
"fileVersion": "0.0.0.0"
}
}
},
"OpenTK.Windowing.Common/4.8.2": {
"dependencies": {
"OpenTK.Core": "4.8.2",
"OpenTK.Mathematics": "4.8.2"
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Windowing.Common.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"OpenTK.Windowing.Desktop/4.8.2": {
"dependencies": {
"OpenTK.Core": "4.8.2",
"OpenTK.Mathematics": "4.8.2",
"OpenTK.Windowing.Common": "4.8.2",
"OpenTK.Windowing.GraphicsLibraryFramework": "4.8.2"
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Windowing.Desktop.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"OpenTK.Windowing.GraphicsLibraryFramework/4.8.2": {
"dependencies": {
"OpenTK.Core": "4.8.2",
"OpenTK.redist.glfw": "3.3.8.39"
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Windowing.GraphicsLibraryFramework.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.0"
}
}
},
"StbImageSharp/2.27.13": {
"runtime": {
"lib/netstandard2.0/StbImageSharp.dll": {
"assemblyVersion": "2.27.13.0",
"fileVersion": "2.27.13.0"
}
}
},
"System.Runtime.CompilerServices.Unsafe/5.0.0": {},
"LandblockExtraction/1.0.0": {
"runtime": {
"LandblockExtraction.dll": {}
}
},
"AC2RE.Definitions/1.0.0.0": {
"runtime": {
"AC2RE.Definitions.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
},
"AC2RE.Utils/1.0.0.0": {
"runtime": {
"AC2RE.Utils.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
}
}
},
"libraries": {
"Map3DRendering/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"OpenTK/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-s2bqkD0glaX5Zbrv0Nj91zcefGrwq+nAp7SnXw14Z22Wj1nVE9CWkEyKX8tha1EdxqSRwKdP6gi+xzZXs4nK4Q==",
"path": "opentk/4.8.2",
"hashPath": "opentk.4.8.2.nupkg.sha512"
},
"OpenTK.Audio.OpenAL/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/Xe0luzJiVOvJ8YXGMY/YLZsGsb0/7Ms09isb/WxkKWjLyuiB2OIflZ49VHmumZpQDz2PUgwqOt2fucviLOmuw==",
"path": "opentk.audio.openal/4.8.2",
"hashPath": "opentk.audio.openal.4.8.2.nupkg.sha512"
},
"OpenTK.Compute/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-n3gBbXOTCkvkNjSOKkVpoxfF/QXzo+cPWKtzObm4f/J+5mOE8odHKXgPn1765Tnu2Ou2ImvdXi/bUFQt/V5Qiw==",
"path": "opentk.compute/4.8.2",
"hashPath": "opentk.compute.4.8.2.nupkg.sha512"
},
"OpenTK.Core/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-BS5IM1W/BK9BtmsEnYT/RGv+KDK0Zrnw8nDDGvK45ywBjMLv+qBRB+Vkx5sQ4Jjy7btLxxqrPHmT3wt5N/PcxA==",
"path": "opentk.core/4.8.2",
"hashPath": "opentk.core.4.8.2.nupkg.sha512"
},
"OpenTK.Graphics/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-qpbyWqdO+yEFVFinKwEWKgi1Jgd0fVSgHbB7d5I8ozI9RL/SKZSNmJDxLjTMSQImJtFixmATcLEWwvEceJ/JsQ==",
"path": "opentk.graphics/4.8.2",
"hashPath": "opentk.graphics.4.8.2.nupkg.sha512"
},
"OpenTK.Input/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-BGs7STF0/o4kNJ1pWXko4I3IwEhieOHVgJFzXzo5m1tI4zMKjBqmzuc4GGfCu+Gtiv33vRYx3dt9f659nr5J8w==",
"path": "opentk.input/4.8.2",
"hashPath": "opentk.input.4.8.2.nupkg.sha512"
},
"OpenTK.Mathematics/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-A8D3eBWi/LKndvTQQ9o9uwyQJUjGORfWCn/gOvX0jIwmTctkLGnOdw5kw4JbRnzfrhZoSIaqZ7MYWWhIkasORw==",
"path": "opentk.mathematics/4.8.2",
"hashPath": "opentk.mathematics.4.8.2.nupkg.sha512"
},
"OpenTK.redist.glfw/3.3.8.39": {
"type": "package",
"serviceable": true,
"sha512": "sha512-JzjaBzHTyKenUk9CXOYIqA/v7VMnjFnqmd3SKR3I1YpuOTu/H3ohyy3o+ZfMCQ6IRKs7CLfSPXMarKLvwD0WgQ==",
"path": "opentk.redist.glfw/3.3.8.39",
"hashPath": "opentk.redist.glfw.3.3.8.39.nupkg.sha512"
},
"OpenTK.Windowing.Common/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-cE7w2AboX/cxtOl7UWa1rTnH4uUoCEg9rtppN6d1/8GOfKUW8LjO6bjEePrRk9LzRZL+5dky3nfw6ZONn5ItyA==",
"path": "opentk.windowing.common/4.8.2",
"hashPath": "opentk.windowing.common.4.8.2.nupkg.sha512"
},
"OpenTK.Windowing.Desktop/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-SlEuiAllLgE03/jJbloCOD1iNtBpnhMuVb510ccA/ILp//mzXHeRKsz7zFJ1ct7yIxe5U2WExXx52Tan++p11Q==",
"path": "opentk.windowing.desktop/4.8.2",
"hashPath": "opentk.windowing.desktop.4.8.2.nupkg.sha512"
},
"OpenTK.Windowing.GraphicsLibraryFramework/4.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-o50PgKL8G0Pqs7Lo7hu1ru+5X5l03aht5jaeik7McXFgVaBJzMLhMhZkiferx4bbcC9Rq597BOknDwqE/bsLOw==",
"path": "opentk.windowing.graphicslibraryframework/4.8.2",
"hashPath": "opentk.windowing.graphicslibraryframework.4.8.2.nupkg.sha512"
},
"StbImageSharp/2.27.13": {
"type": "package",
"serviceable": true,
"sha512": "sha512-tHnP2RHgFzWbOS96UqvRO/LYU1WmpMT1bKiig45we+rpaXacBr11Fq2IBF+MqlgyLyNXxRz18E66qr4R9YlSbg==",
"path": "stbimagesharp/2.27.13",
"hashPath": "stbimagesharp.2.27.13.nupkg.sha512"
},
"System.Runtime.CompilerServices.Unsafe/5.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==",
"path": "system.runtime.compilerservices.unsafe/5.0.0",
"hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512"
},
"LandblockExtraction/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"AC2RE.Definitions/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"AC2RE.Utils/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net7.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "7.0.0"
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,8 @@
#version 330 core
in vec3 vertexColor;
out vec4 FragColor;
void main() {
FragColor = vec4(vertexColor, 1.0);
}

View file

@ -0,0 +1,14 @@
#version 330 core
layout (location = 0) in vec3 aPosition;
layout (location = 1) in vec3 aColor;
uniform mat4 view;
uniform mat4 projection;
out vec3 vertexColor;
void main() {
gl_Position = projection * view * vec4(aPosition, 1.0);
vertexColor = aColor;
}

View file

@ -0,0 +1,49 @@
#version 330 core
out vec4 FragColor;
//In order to calculate some basic lighting we need a few things per model basis, and a few things per fragment basis:
uniform vec3 objectColor; //The color of the object.
uniform vec3 lightColor; //The color of the light.
uniform vec3 lightPos; //The position of the light.
uniform vec3 viewPos; //The position of the view and/or of the player.
uniform vec4 lineColor;
uniform sampler2D texture0;
in vec3 Normal; //The normal of the fragment is calculated in the vertex shader.
in vec3 FragPos; //The fragment position.
in vec4 Color;
void main()
{
//The ambient color is the color where the light does not directly hit the object.
//You can think of it as an underlying tone throughout the object. Or the light coming from the scene/the sky (not the sun).
float ambientStrength = 1;
vec4 textureColor = Color;
vec3 ambient = ambientStrength * lightColor * textureColor;
//We calculate the light direction, and make sure the normal is normalized.
vec3 norm = normalize(Normal);
vec3 lightDir = normalize(lightPos - FragPos); //Note: The light is pointing from the light to the fragment
//The diffuse part of the phong model.
//This is the part of the light that gives the most, it is the color of the object where it is hit by light.
float diff = max(dot(norm, lightDir), 0.0); //We make sure the value is non negative with the max function.
vec3 diffuse = diff * lightColor;
//The specular light is the light that shines from the object, like light hitting metal.
//The calculations are explained much more detailed in the web version of the tutorials.
float specularStrength = 0.5;
vec3 viewDir = normalize(viewPos - FragPos);
vec3 reflectDir = reflect(-lightDir, norm);
float spec = pow(max(dot(viewDir, reflectDir), 0.0), 32); //The 32 is the shininess of the material.
vec3 specular = specularStrength * spec * lightColor;
//At last we add all the light components together and multiply with the color of the object. Then we set the color
//and makes sure the alpha value is 1
vec3 result = (ambient + diffuse + specular) * objectColor * textureColor;
FragColor = lineColor * vec4(result, 1.0);
//Note we still use the light color * object color from the last tutorial.
//This time the light values are in the phong model (ambient, diffuse and specular)
}

View file

@ -0,0 +1,17 @@
#version 330
out vec4 outputColor;
uniform vec3 viewPos;
in vec4 Color;
in vec4 FarColor;
in vec3 FragPos;
void main()
{
float distance = length(viewPos - FragPos);
float interpolationFactor = clamp(distance / 1000, 0.0, 1.0);
outputColor = mix(Color, FarColor, interpolationFactor);
}

View file

@ -0,0 +1,20 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec4 aColor;
layout (location = 2) in vec4 aColorFar;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
out vec3 FragPos;
out vec4 Color;
out vec4 FarColor;
void main()
{
gl_Position = vec4(aPos, 1.0) * model * view * projection;
FragPos = vec3(vec4(aPos, 1.0) * model);
Color = aColor;
FarColor = aColorFar;
}

Binary file not shown.

View file

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]

View file

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.42000
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Map3DRendering")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Map3DRendering")]
[assembly: System.Reflection.AssemblyTitleAttribute("Map3DRendering")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Généré par la classe MSBuild WriteCodeFragment.

View file

@ -0,0 +1 @@
8af69b9dce5d51930a051b9424c0cf4a390c619a186f4caf0e03e7aac96b4f4c

View file

@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net7.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Map3DRendering
build_property.ProjectDir = C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

View file

@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View file

@ -0,0 +1 @@
948bda8dbc9d11c72bcfd3e112a4d805d0510c728778c3020986c78bc65b9523

View file

@ -0,0 +1,41 @@
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Map3DRendering.exe
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Map3DRendering.deps.json
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Map3DRendering.runtimeconfig.json
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Map3DRendering.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Map3DRendering.pdb
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\Map3DRendering.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\Map3DRendering.AssemblyInfoInputs.cache
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\Map3DRendering.AssemblyInfo.cs
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\Map3DRendering.csproj.CoreCompileInputs.cache
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\Map3DRendering.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\refint\Map3DRendering.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\Map3DRendering.pdb
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\Map3DRendering.genruntimeconfig.cache
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\ref\Map3DRendering.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\LandblockExtraction.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\AC2RE.Definitions.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\AC2RE.Utils.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\LandblockExtraction.pdb
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\Map3DRendering.csproj.AssemblyReference.cache
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\obj\Debug\net7.0\Map3DRendering.csproj.CopyComplete
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Shaders\lighting.frag
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Shaders\shader.frag
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Shaders\shader.vert
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\OpenTK.Audio.OpenAL.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\OpenTK.Compute.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\OpenTK.Core.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\OpenTK.Graphics.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\OpenTK.Input.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\OpenTK.Mathematics.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\OpenTK.Windowing.Common.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\OpenTK.Windowing.Desktop.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\OpenTK.Windowing.GraphicsLibraryFramework.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\StbImageSharp.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\runtimes\linux-x64\native\libglfw-wayland.so.3.3
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\runtimes\linux-x64\native\libglfw.so.3.3
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\runtimes\osx-arm64\native\libglfw.3.dylib
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\runtimes\osx-x64\native\libglfw.3.dylib
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\runtimes\win-x64\native\glfw3.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\runtimes\win-x86\native\glfw3.dll
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Shaders\Gizmo\axes.frag
C:\Users\Troispoils\Documents\GitHub\Map3DRendering\Map3DRendering\bin\Debug\net7.0\Shaders\Gizmo\axes.vert

Binary file not shown.

View file

@ -0,0 +1 @@
d9facc6cacb01d915647c2d924d770b3ad92a78acbec78cdd83108048fe4350e

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,132 @@
{
"format": 1,
"restore": {
"C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\Map3DRendering\\Map3DRendering.csproj": {}
},
"projects": {
"C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj",
"projectName": "LandblockExtraction",
"projectPath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj",
"packagesPath": "C:\\Users\\Troispoils\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Troispoils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100\\RuntimeIdentifierGraph.json"
}
}
},
"C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\Map3DRendering\\Map3DRendering.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\Map3DRendering\\Map3DRendering.csproj",
"projectName": "Map3DRendering",
"projectPath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\Map3DRendering\\Map3DRendering.csproj",
"packagesPath": "C:\\Users\\Troispoils\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\Map3DRendering\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Troispoils\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {
"C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj": {
"projectPath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\LandblockExtraction\\LandblockExtraction.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"dependencies": {
"OpenTK": {
"target": "Package",
"version": "[4.8.2, )"
},
"StbImageSharp": {
"target": "Package",
"version": "[2.27.13, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Troispoils\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.8.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Troispoils\.nuget\packages\" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

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