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,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" />

View file

@ -0,0 +1,527 @@
{
"version": 3,
"targets": {
"net7.0": {
"OpenTK/4.8.2": {
"type": "package",
"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": {
"type": "package",
"dependencies": {
"OpenTK.Core": "[4.8.2, 4.9.0)",
"OpenTK.Mathematics": "[4.8.2, 4.9.0)"
},
"compile": {
"lib/netcoreapp3.1/OpenTK.Audio.OpenAL.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Audio.OpenAL.dll": {
"related": ".pdb;.xml"
}
}
},
"OpenTK.Compute/4.8.2": {
"type": "package",
"compile": {
"lib/netcoreapp3.1/OpenTK.Compute.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Compute.dll": {
"related": ".pdb;.xml"
}
}
},
"OpenTK.Core/4.8.2": {
"type": "package",
"compile": {
"lib/netstandard2.1/OpenTK.Core.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netstandard2.1/OpenTK.Core.dll": {
"related": ".pdb;.xml"
}
}
},
"OpenTK.Graphics/4.8.2": {
"type": "package",
"dependencies": {
"OpenTK.Core": "[4.8.2, 4.9.0)",
"OpenTK.Mathematics": "[4.8.2, 4.9.0)"
},
"compile": {
"lib/netcoreapp3.1/OpenTK.Graphics.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Graphics.dll": {
"related": ".pdb;.xml"
}
}
},
"OpenTK.Input/4.8.2": {
"type": "package",
"compile": {
"lib/netstandard2.0/OpenTK.Input.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netstandard2.0/OpenTK.Input.dll": {
"related": ".pdb;.xml"
}
}
},
"OpenTK.Mathematics/4.8.2": {
"type": "package",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "5.0.0"
},
"compile": {
"lib/netcoreapp3.1/OpenTK.Mathematics.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Mathematics.dll": {
"related": ".pdb;.xml"
}
}
},
"OpenTK.redist.glfw/3.3.8.39": {
"type": "package",
"compile": {
"lib/netstandard2.0/_._": {}
},
"runtime": {
"lib/netstandard2.0/_._": {}
},
"runtimeTargets": {
"runtimes/linux-x64/native/libglfw-wayland.so.3.3": {
"assetType": "native",
"rid": "linux-x64"
},
"runtimes/linux-x64/native/libglfw.so.3.3": {
"assetType": "native",
"rid": "linux-x64"
},
"runtimes/osx-arm64/native/libglfw.3.dylib": {
"assetType": "native",
"rid": "osx-arm64"
},
"runtimes/osx-x64/native/libglfw.3.dylib": {
"assetType": "native",
"rid": "osx-x64"
},
"runtimes/win-x64/native/glfw3.dll": {
"assetType": "native",
"rid": "win-x64"
},
"runtimes/win-x86/native/glfw3.dll": {
"assetType": "native",
"rid": "win-x86"
}
}
},
"OpenTK.Windowing.Common/4.8.2": {
"type": "package",
"dependencies": {
"OpenTK.Core": "[4.8.2, 4.9.0)",
"OpenTK.Mathematics": "[4.8.2, 4.9.0)"
},
"compile": {
"lib/netcoreapp3.1/OpenTK.Windowing.Common.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Windowing.Common.dll": {
"related": ".pdb;.xml"
}
}
},
"OpenTK.Windowing.Desktop/4.8.2": {
"type": "package",
"dependencies": {
"OpenTK.Core": "[4.8.2, 4.9.0)",
"OpenTK.Mathematics": "[4.8.2, 4.9.0)",
"OpenTK.Windowing.Common": "[4.8.2, 4.9.0)",
"OpenTK.Windowing.GraphicsLibraryFramework": "[4.8.2, 4.9.0)"
},
"compile": {
"lib/netcoreapp3.1/OpenTK.Windowing.Desktop.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Windowing.Desktop.dll": {
"related": ".pdb;.xml"
}
}
},
"OpenTK.Windowing.GraphicsLibraryFramework/4.8.2": {
"type": "package",
"dependencies": {
"OpenTK.Core": "[4.8.2, 4.9.0)",
"OpenTK.redist.glfw": "3.3.8.39"
},
"compile": {
"lib/netcoreapp3.1/OpenTK.Windowing.GraphicsLibraryFramework.dll": {
"related": ".pdb;.xml"
}
},
"runtime": {
"lib/netcoreapp3.1/OpenTK.Windowing.GraphicsLibraryFramework.dll": {
"related": ".pdb;.xml"
}
}
},
"StbImageSharp/2.27.13": {
"type": "package",
"compile": {
"lib/netstandard2.0/StbImageSharp.dll": {}
},
"runtime": {
"lib/netstandard2.0/StbImageSharp.dll": {}
}
},
"System.Runtime.CompilerServices.Unsafe/5.0.0": {
"type": "package",
"compile": {
"ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": {
"related": ".xml"
}
}
},
"LandblockExtraction/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v7.0",
"compile": {
"bin/placeholder/LandblockExtraction.dll": {}
},
"runtime": {
"bin/placeholder/LandblockExtraction.dll": {}
}
}
}
},
"libraries": {
"OpenTK/4.8.2": {
"sha512": "s2bqkD0glaX5Zbrv0Nj91zcefGrwq+nAp7SnXw14Z22Wj1nVE9CWkEyKX8tha1EdxqSRwKdP6gi+xzZXs4nK4Q==",
"type": "package",
"path": "opentk/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"opentk.4.8.2.nupkg.sha512",
"opentk.nuspec"
]
},
"OpenTK.Audio.OpenAL/4.8.2": {
"sha512": "/Xe0luzJiVOvJ8YXGMY/YLZsGsb0/7Ms09isb/WxkKWjLyuiB2OIflZ49VHmumZpQDz2PUgwqOt2fucviLOmuw==",
"type": "package",
"path": "opentk.audio.openal/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netcoreapp3.1/OpenTK.Audio.OpenAL.dll",
"lib/netcoreapp3.1/OpenTK.Audio.OpenAL.pdb",
"lib/netcoreapp3.1/OpenTK.Audio.OpenAL.xml",
"opentk.audio.openal.4.8.2.nupkg.sha512",
"opentk.audio.openal.nuspec"
]
},
"OpenTK.Compute/4.8.2": {
"sha512": "n3gBbXOTCkvkNjSOKkVpoxfF/QXzo+cPWKtzObm4f/J+5mOE8odHKXgPn1765Tnu2Ou2ImvdXi/bUFQt/V5Qiw==",
"type": "package",
"path": "opentk.compute/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netcoreapp3.1/OpenTK.Compute.dll",
"lib/netcoreapp3.1/OpenTK.Compute.pdb",
"lib/netcoreapp3.1/OpenTK.Compute.xml",
"opentk.compute.4.8.2.nupkg.sha512",
"opentk.compute.nuspec"
]
},
"OpenTK.Core/4.8.2": {
"sha512": "BS5IM1W/BK9BtmsEnYT/RGv+KDK0Zrnw8nDDGvK45ywBjMLv+qBRB+Vkx5sQ4Jjy7btLxxqrPHmT3wt5N/PcxA==",
"type": "package",
"path": "opentk.core/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netstandard2.1/OpenTK.Core.dll",
"lib/netstandard2.1/OpenTK.Core.pdb",
"lib/netstandard2.1/OpenTK.Core.xml",
"opentk.core.4.8.2.nupkg.sha512",
"opentk.core.nuspec"
]
},
"OpenTK.Graphics/4.8.2": {
"sha512": "qpbyWqdO+yEFVFinKwEWKgi1Jgd0fVSgHbB7d5I8ozI9RL/SKZSNmJDxLjTMSQImJtFixmATcLEWwvEceJ/JsQ==",
"type": "package",
"path": "opentk.graphics/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netcoreapp3.1/OpenTK.Graphics.dll",
"lib/netcoreapp3.1/OpenTK.Graphics.pdb",
"lib/netcoreapp3.1/OpenTK.Graphics.xml",
"lib/netstandard2.1/OpenTK.Graphics.dll",
"lib/netstandard2.1/OpenTK.Graphics.pdb",
"lib/netstandard2.1/OpenTK.Graphics.xml",
"opentk.graphics.4.8.2.nupkg.sha512",
"opentk.graphics.nuspec"
]
},
"OpenTK.Input/4.8.2": {
"sha512": "BGs7STF0/o4kNJ1pWXko4I3IwEhieOHVgJFzXzo5m1tI4zMKjBqmzuc4GGfCu+Gtiv33vRYx3dt9f659nr5J8w==",
"type": "package",
"path": "opentk.input/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netstandard2.0/OpenTK.Input.dll",
"lib/netstandard2.0/OpenTK.Input.pdb",
"lib/netstandard2.0/OpenTK.Input.xml",
"opentk.input.4.8.2.nupkg.sha512",
"opentk.input.nuspec"
]
},
"OpenTK.Mathematics/4.8.2": {
"sha512": "A8D3eBWi/LKndvTQQ9o9uwyQJUjGORfWCn/gOvX0jIwmTctkLGnOdw5kw4JbRnzfrhZoSIaqZ7MYWWhIkasORw==",
"type": "package",
"path": "opentk.mathematics/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netcoreapp3.1/OpenTK.Mathematics.dll",
"lib/netcoreapp3.1/OpenTK.Mathematics.pdb",
"lib/netcoreapp3.1/OpenTK.Mathematics.xml",
"lib/netstandard2.1/OpenTK.Mathematics.dll",
"lib/netstandard2.1/OpenTK.Mathematics.pdb",
"lib/netstandard2.1/OpenTK.Mathematics.xml",
"opentk.mathematics.4.8.2.nupkg.sha512",
"opentk.mathematics.nuspec"
]
},
"OpenTK.redist.glfw/3.3.8.39": {
"sha512": "JzjaBzHTyKenUk9CXOYIqA/v7VMnjFnqmd3SKR3I1YpuOTu/H3ohyy3o+ZfMCQ6IRKs7CLfSPXMarKLvwD0WgQ==",
"type": "package",
"path": "opentk.redist.glfw/3.3.8.39",
"files": [
".nupkg.metadata",
".signature.p7s",
"COPYING.md",
"lib/netstandard2.0/_._",
"opentk.png",
"opentk.redist.glfw.3.3.8.39.nupkg.sha512",
"opentk.redist.glfw.nuspec",
"runtimes/linux-x64/native/libglfw-wayland.so.3.3",
"runtimes/linux-x64/native/libglfw.so.3.3",
"runtimes/osx-arm64/native/libglfw.3.dylib",
"runtimes/osx-x64/native/libglfw.3.dylib",
"runtimes/win-x64/native/glfw3.dll",
"runtimes/win-x86/native/glfw3.dll"
]
},
"OpenTK.Windowing.Common/4.8.2": {
"sha512": "cE7w2AboX/cxtOl7UWa1rTnH4uUoCEg9rtppN6d1/8GOfKUW8LjO6bjEePrRk9LzRZL+5dky3nfw6ZONn5ItyA==",
"type": "package",
"path": "opentk.windowing.common/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netcoreapp3.1/OpenTK.Windowing.Common.dll",
"lib/netcoreapp3.1/OpenTK.Windowing.Common.pdb",
"lib/netcoreapp3.1/OpenTK.Windowing.Common.xml",
"lib/netstandard2.1/OpenTK.Windowing.Common.dll",
"lib/netstandard2.1/OpenTK.Windowing.Common.pdb",
"lib/netstandard2.1/OpenTK.Windowing.Common.xml",
"opentk.windowing.common.4.8.2.nupkg.sha512",
"opentk.windowing.common.nuspec"
]
},
"OpenTK.Windowing.Desktop/4.8.2": {
"sha512": "SlEuiAllLgE03/jJbloCOD1iNtBpnhMuVb510ccA/ILp//mzXHeRKsz7zFJ1ct7yIxe5U2WExXx52Tan++p11Q==",
"type": "package",
"path": "opentk.windowing.desktop/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netcoreapp3.1/OpenTK.Windowing.Desktop.dll",
"lib/netcoreapp3.1/OpenTK.Windowing.Desktop.pdb",
"lib/netcoreapp3.1/OpenTK.Windowing.Desktop.xml",
"opentk.windowing.desktop.4.8.2.nupkg.sha512",
"opentk.windowing.desktop.nuspec"
]
},
"OpenTK.Windowing.GraphicsLibraryFramework/4.8.2": {
"sha512": "o50PgKL8G0Pqs7Lo7hu1ru+5X5l03aht5jaeik7McXFgVaBJzMLhMhZkiferx4bbcC9Rq597BOknDwqE/bsLOw==",
"type": "package",
"path": "opentk.windowing.graphicslibraryframework/4.8.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netcoreapp3.1/OpenTK.Windowing.GraphicsLibraryFramework.dll",
"lib/netcoreapp3.1/OpenTK.Windowing.GraphicsLibraryFramework.pdb",
"lib/netcoreapp3.1/OpenTK.Windowing.GraphicsLibraryFramework.xml",
"opentk.windowing.graphicslibraryframework.4.8.2.nupkg.sha512",
"opentk.windowing.graphicslibraryframework.nuspec"
]
},
"StbImageSharp/2.27.13": {
"sha512": "tHnP2RHgFzWbOS96UqvRO/LYU1WmpMT1bKiig45we+rpaXacBr11Fq2IBF+MqlgyLyNXxRz18E66qr4R9YlSbg==",
"type": "package",
"path": "stbimagesharp/2.27.13",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/net471/StbImageSharp.dll",
"lib/netstandard2.0/StbImageSharp.dll",
"stbimagesharp.2.27.13.nupkg.sha512",
"stbimagesharp.nuspec"
]
},
"System.Runtime.CompilerServices.Unsafe/5.0.0": {
"sha512": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==",
"type": "package",
"path": "system.runtime.compilerservices.unsafe/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net45/System.Runtime.CompilerServices.Unsafe.dll",
"lib/net45/System.Runtime.CompilerServices.Unsafe.xml",
"lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll",
"lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.xml",
"lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll",
"lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml",
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll",
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml",
"ref/net461/System.Runtime.CompilerServices.Unsafe.dll",
"ref/net461/System.Runtime.CompilerServices.Unsafe.xml",
"ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll",
"ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml",
"ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll",
"ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml",
"ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.dll",
"ref/netstandard2.1/System.Runtime.CompilerServices.Unsafe.xml",
"system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512",
"system.runtime.compilerservices.unsafe.nuspec",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"LandblockExtraction/1.0.0": {
"type": "project",
"path": "../LandblockExtraction/LandblockExtraction.csproj",
"msbuildProject": "../LandblockExtraction/LandblockExtraction.csproj"
}
},
"projectFileDependencyGroups": {
"net7.0": [
"LandblockExtraction >= 1.0.0",
"OpenTK >= 4.8.2",
"StbImageSharp >= 2.27.13"
]
},
"packageFolders": {
"C:\\Users\\Troispoils\\.nuget\\packages\\": {}
},
"project": {
"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,22 @@
{
"version": 2,
"dgSpecHash": "FyISISlaEWKcgEU4kibZEHVnp7otf9MzMNZI01ds1TyXEdDX3Au99iPIZ3tg2S3NYGWyaMVN6J6pZJieZ7un7g==",
"success": true,
"projectFilePath": "C:\\Users\\Troispoils\\Documents\\GitHub\\Map3DRendering\\Map3DRendering\\Map3DRendering.csproj",
"expectedPackageFiles": [
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk\\4.8.2\\opentk.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.audio.openal\\4.8.2\\opentk.audio.openal.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.compute\\4.8.2\\opentk.compute.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.core\\4.8.2\\opentk.core.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.graphics\\4.8.2\\opentk.graphics.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.input\\4.8.2\\opentk.input.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.mathematics\\4.8.2\\opentk.mathematics.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.redist.glfw\\3.3.8.39\\opentk.redist.glfw.3.3.8.39.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.windowing.common\\4.8.2\\opentk.windowing.common.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.windowing.desktop\\4.8.2\\opentk.windowing.desktop.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\opentk.windowing.graphicslibraryframework\\4.8.2\\opentk.windowing.graphicslibraryframework.4.8.2.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\stbimagesharp\\2.27.13\\stbimagesharp.2.27.13.nupkg.sha512",
"C:\\Users\\Troispoils\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512"
],
"logs": []
}