Update for AtlasBuilder ok

Need to improuve duplicate vertex for mapping texture.
This commit is contained in:
Troispoils 2024-02-27 17:04:09 +01:00
parent 4777783ffb
commit b9a2b87fe9
11 changed files with 160 additions and 33 deletions

View file

@ -48,14 +48,16 @@ namespace Map3DRendering {
_shader.Use();
mapRender.OnLoad(_shader);
//_texture = Texture.LoadFromFile("atlas.jpg");
//_texture.Use(TextureUnit.Texture0);
_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;
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Repeat);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Repeat);
}
protected override void OnRenderFrame(FrameEventArgs e) {
@ -66,7 +68,7 @@ namespace Map3DRendering {
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
_shader.Use();
//_texture.Use(TextureUnit.Texture0);
_texture.Use(TextureUnit.Texture0);
_shader.SetMatrix4("view", _camera.GetViewMatrix());
_shader.SetMatrix4("projection", _camera.GetProjectionMatrix());