GithubHelp home page GithubHelp logo

tape-worm / gorgon Goto Github PK

View Code? Open in Web Editor NEW
92.0 8.0 10.0 257.19 MB

A modular set of libraries for .Net that are useful for graphics and video game development.

Home Page: https://www.tape-worm.net

License: MIT License

C# 99.54% HLSL 0.44% PowerShell 0.02%
c-sharp graphics gorgon direct3d dotnet 2d video-game-development sharpdx

gorgon's Introduction

gorgon_2 x_logo_full_site

What is Gorgon?

A modular set of libraries useful for graphics and/or video game development. Gorgon uses Direct 3D 11.2 (via SharpDX) to provide high performance graphics for your applications.

What is not Gorgon?

Building applications with Gorgon requires that you write code. There's no nodes, no blueprints, etc... It does not contain:

  • A fully featured game engine.
  • An all-in-one editor that uses drag and drop to build your application.
  • A scripting system.

Gorgon is meant for people that want to write their own functionality, get down into the guts of their applications and not have to deal with a black boxed scripting system, or editor. In short, it's more work, but more customizable.

For those that want a more complete (and polished) package to build their applications there's Unity (after the crap they've pulled, no one should be using Unity), Unreal, Godot or Stride (formally Xenko).

Documentation

Documentation for the Gorgon APIs is located here.

What's the licensing?

Gorgon is licensed under the MIT license.

How far along are you? Is it done yet? How about now?

Gorgon 4.0 is in development.

What can it do?

Gorgon provides a set of libraries that are capable of handling pretty much any task thrown at it. It includes:

Core functionality, plug in support and utility functionality. This is the base library that everything else uses.

Core Windows specific functionality. Provides UI functionality, such as custom message box dialogs, timing functionality using QPC and/or the windows multimedia timer and various other bits of utility/diagnostic functionality.

A virtual file system that can mount a directory as a file system root, or using various file system providers, can mount a packed file as a virtual file system root. This code is based on the popular PhysFS library.

By default, Gorgon's basic virtual file system is based on the folder/files on the Windows file system, but using filesystem providers via plug ins, applications can read any type of file storage container can be used if the appropriate plug in is available for it. Gorgon comes with two plug ins for file system providers:

By default, the file system provider

A flexible input library to handle joysticks/gamepads, keyboard and mouse input. The input library can use events or polling to retrieve data from the various input sources.

Keyboard and mouse input is provided using the Windows Raw Input API, and joystick/gamepad support is driven by the following plug ins:

A "low-level" graphics API that sits on top of Direct 3D 11.2. Provides a simplified system to build objects such as render targets, swap chains, buffers, etc... The rendering portion of the API provides a simple mechanism to submit batched state and draw information back to the underlying D3D API.

Functionality to allow Gorgon to render onto a WPF surface. This allows interoperabilty between Gorgon and WPF.

Functionality to allow Gorgon to render onto an Avalonia surface. This allows interoperabilty between Gorgon and Avalonia.

Functionality to read and write image formats. This also contains functionality to use a fluent interface to manipulate images for things like cropping, scaling, etc...

Gorgon uses codecs to read/write images and includes codecs for the following formats:

  • DDS - Direct Draw Surface
  • TGA - Truevision Targa
  • PNG - Portable Network Graphics
  • JPG - Joint Photographic Experts Group
  • BMP - Windows Bitmap
  • GIF - Graphic Interchange Format (supports animated gifs as well)

In additon to the support above, applications can extend the support for file formats by adding their own custom codec plug in to read/write in their desired format(s).

An extensive bitmap font creation interface (within the graphics module) that supports kerning, outlining of font glyphs, and other customizations to help generate impressive looking text.

Currently Gorgon supports reading and writing of font files through codecs. Support is included for:

  • GorFont: A proprietary binary format for Gorgon.
  • BmFont: A popular font file type created by Andreas Jönsson (Note: this support is limited to the text based file format at this time).

In addition to the support above, applications can introduce their own codecs to read/write whatever font types they wish by extending the GorgonFontCodec type. (Plug in support is pending at this time)

A 2D renderer that sits on top of the graphics module to make developing 2D games/applications much easier. It supports:

  • Sprites
  • Primitives (triangles, lines, ellipses, arcs, and rectangles)
  • Text rendering
  • A shader based effects system

All of these are provided using batched rendering, similar to MonoGame for maximum performance.

IO functionality for serializing sprite and polysprite data to and from various formats using codecs.

An animation module that allows the creation and playback of key framed animations for various types of objects.

Animation controllers for the 2D renderer are provided by the Gorgon.Animation.Gorgon2D assembly.

A flexible content editor to allow for the creation and editing of content.

  • Supports a plug in based architecture to allow developers to extend the editor indefinitely.
  • Supports file management of content by using a simple tree layout for folders and files.
  • Comes with an image editor plug in which allows users to add depth slices to 3D images (I have yet, for the life of me to find anything on the web that does this), mip maps and array indices, and other simple functions.
  • Comes with a sprite editor plug in which allows users to clip sprites from an image and store them as a file.
  • Comes with an animation editor plug in for animating sprites.
  • Can output the files as a packed file. The type of file that be written out is provided via plug in support (currently only supports the proprietary Gorgon packed file format).
  • Can import packed files using file system plug ins (currently has support for zip and the proprietary Gorgon packed file formats - included with Gorgon as file system plug ins).

What's required?

To compile the library

See the Compiling Gorgon article.

To use the library

  • You may use any .NET 8.0 enabled language (e.g. Visual Basic .NET) to write an application with Gorgon.

Source code

The develop branch contains the current development version of Gorgon 4.0.
The main branch contains the release version of Gorgon 3.2.

Acknowledgements

Gorgon uses icons from the following sources:

Oxygen https://github.com/pasnox/oxygen-icons-png
http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org.html

Icons8 http://https://icons8.com

Sprites example textures from: http://millionthvector.blogspot.com/

This following image(s) is/are not redistributable without permission from the original author.

"HotPocket.dds" by Starkiteckt https://www.artstation.com/starkiteckt

Electronics.DDS, Halifax.DDS, Handmaid.DDS and PewterPup.DDS by Colleen MacLean

Third Party True Type fonts:

Tequila by uZiMweB
A Charming Font by GemFonts
Sunset by Harold's Fonts
Monsters Attack ! by The Empire of the Claw
Grunja by Apostrophic Labs
The Bold Font by ???

gorgon's People

Contributors

azure-pipelines[bot] avatar dependabot[bot] avatar tape-worm avatar wagnerp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gorgon's Issues

Can not override WndProc function

Describe the bug
I implement to override the WndProc of Form that i used to render with Gorgon library but i can not do. It throws an error "Error creating window handle."

To Reproduce
Steps to reproduce the behavior:

  1. What did you do?
    protected override void WndProc(ref System.Windows.Forms.Message m) { // respond to messages here }
    If i remove such function, then my project just works fine
    Expected behavior
    I want to override this function to handle WM_CHAR... events
    Screenshots

    OS: Windows 10 x64 build 18362.900
    Version 1903
    Visual Studio 2017

Additional context

Error in create Font

I use this function to init two fonts for two text sprites

GorgonFontFactory _fontFactory ;
GorgonFont _SubjectNameFont;
GorgonFont _SubjectIDFont;
GorgonTextSprite _SubjectName { get; set; }
GorgonTextSprite _SubjectID { get; set; }
public void InitFont()
        {
            int[] font= new int[]{0x0000, 0x0001, 0x1EB2, 0x0003, 0x0004, 0x1EB4, 0x1EAA, 0x0007,
                                    0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
                                    0x0010, 0x0011, 0x0012, 0x0013, 0x1EF6, 0x0015, 0x0016, 0x0017,
                                    0x0018, 0x1EF8, 0x001a, 0x001b, 0x001c, 0x001d, 0x1EF4, 0x001f,
                                    0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
                                    0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
                                    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
                                    0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
                                    0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
                                    0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
                                    0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
                                    0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
                                    0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
                                    0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
                                    0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
                                    0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007f,
                                    0x1EA0, 0x1EAE, 0x1EB0, 0x1EB6, 0x1EA4, 0x1EA6, 0x1EA8, 0x1EAC,
                                    0x1EBC, 0x1EB8, 0x1EBE, 0x1EC0, 0x1EC2, 0x1EC4, 0x1EC6, 0x1ED0,
                                    0x1ED2, 0x1ED4, 0x1ED6, 0x1ED8, 0x1EE2, 0x1EDA, 0x1EDC, 0x1EDE,
                                    0x1ECA, 0x1ECE, 0x1ECC, 0x1EC8, 0x1EE6, 0x0168, 0x1EE4, 0x1EF2,
                                    0x00D5, 0x1EAF, 0x1EB1, 0x1EB7, 0x1EA5, 0x1EA7, 0x1EA8, 0x1EAD,
                                    0x1EBD, 0x1EB9, 0x1EBF, 0x1EC1, 0x1EC3, 0x1EC5, 0x1EC7, 0x1ED1,
                                    0x1ED3, 0x1ED5, 0x1ED7, 0x1EE0, 0x01A0, 0x1ED9, 0x1EDD, 0x1EDF,
                                    0x1ECB, 0x1EF0, 0x1EE8, 0x1EEA, 0x1EEC, 0x01A1, 0x1EDB, 0x01AF,
                                    0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x1EA2, 0x0102, 0x1EB3, 0x1EB5,
                                    0x00C8, 0x00C9, 0x00CA, 0x1EBA, 0x00CC, 0x00CD, 0x0128, 0x1EF3,
                                    0x0110, 0x1EE9, 0x00D2, 0x00D3, 0x00D4, 0x1EA1, 0x1EF7, 0x1EEB,
                                    0x1EED, 0x00D9, 0x00DA, 0x1EF9, 0x1EF5, 0x00DD, 0x1EE1, 0x01B0,
                                    0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x1EA3, 0x0103, 0x1EEF, 0x1EAB,
                                    0x00E8, 0x00E9, 0x00EA, 0x1EBB, 0x00EC, 0x00ED, 0x0129, 0x1EC9,
                                    0x0111, 0x1EF1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x1ECF, 0x1ECD,
                                    0x1EE5, 0x00F9, 0x00FA, 0x0169, 0x1EE7, 0x00FD, 0x1EE3, 0x1EEE
                                };

            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < font.Length; i++)
            {
                char character = Convert.ToChar(font[i]);
                sb.Append(character);
            }
            _fontFactory = new GorgonFontFactory(Graphics);

            _SubjectIDFont = _fontFactory.GetFont(new GorgonFontInfo("Segoe UI", 30f, FontHeightMode.Points, "Segoe UI 10pt")
            {
                OutlineSize = 1,
                Characters = sb.ToString(),
                FontStyle = Gorgon.Graphics.Fonts.FontStyle.Bold,
                AntiAliasingMode = FontAntiAliasMode.AntiAlias,
                OutlineColor1 = GorgonColor.Black,
                OutlineColor2 = GorgonColor.Black
            });
            _SubjectNameFont = _fontFactory.GetFont(new GorgoncFontInfo("Segoe UI", 36.0f, FontHeightMode.Points, "Segoe UI 10pt")
            {
                OutlineSize = 1,
                Characters = sb.ToString(),
                
                FontStyle = Gorgon.Graphics.Fonts.FontStyle.Bold,
                AntiAliasingMode = FontAntiAliasMode.AntiAlias,
                OutlineColor1 = GorgonColor.DarkRed,
                OutlineColor2 = GorgonColor.DarkRed
            });
            _SubjectID = new GorgonTextSprite(_SubjectIDFont)
            {
                Position = new Vector2(0, 0),
                DrawMode = TextDrawMode.OutlinedGlyphs,
                Color = new GorgonColor(System.Drawing.Color.Lime),
                Anchor = new Vector2(0.5f, 0.5f),
                Scale = new Vector2(0.8f)
            };
            _SubjectID.Position = new Vector2(Card_Size_Main.Width / 2.0f - _SubjectID.Size.Width / 2, Card_Size_Main.Height - 80);
            _SubjectID.Text = "ID999999999";

            _SubjectName = new GorgonTextSprite(_SubjectNameFont)
            {
                Position = new Vector2(0, 0),
                DrawMode = TextDrawMode.OutlinedGlyphs,
                Color = GorgonColor.Orange,
                Anchor = new Vector2(0.5f, 0.5f)
            };
            _SubjectName.Position = new Vector2(Card_Size_Main.Width / 2.0f - _SubjectName.Size.Width / 2, Card_Size_Main.Height - _SubjectName.Size.Height - 80 - _SubjectID.Size.Height);
            _SubjectName.Text = "WHO ARE YOU?";
        }

I got this error:

There was an error during the enumeration process.
The character code 0x  used by the default character is not valid.

at Gorgon.Graphics.Fonts.GorgonFont.GetLineWidth(String line, Boolean useOutline)
at Gorgon.Graphics.Fonts.GorgonFont.MeasureText(String text, Boolean useOutline, Int32 tabSpaceCount, Single lineSpacing, Nullable`1 wordWrapWidth)
at Gorgonc.Renderers.GorgonTextSprite.UpdateBounds()
at Gorgon.Renderers.GorgonTextSprite.FormatText()
at Gorgon.Renderers.GorgonTextSprite.set_Text(String value)
at JustTest.Subjects.InitFont() in C:\Users\GALAXY\Desktop\JustTest\Subjects.cs:line 256
at JustTest.Subjects..ctor(GorgonGraphics graphics, Gorgon2D renderer, GorgonSwapChain scene, Size camImageSize) in C:\Users\GALAXY\Desktop\JustTest\Subjects.cs:line 169
at JustTest.Program.Initialize() in C:\Users\GALAXY\Desktop\JustTest\Program.cs:line 427
at JustTest.Program.Main(String[] args) in C:\Users\GALAXY\Desktop\JustTest\Program.cs:line 687

But if i use only one font for both two text sprites then OK

OnAssignDirtyItem(int, GorgonStreamOutBinding)': no suitable method found to override

Hi,
I got this error when building Gorgon.Graphics.Core from latest source

OnAssignDirtyItem(int, GorgonStreamOutBinding)': no suitable method found to override

In files:
Gorgon.Graphics.Core\Pipeline\GorgonStreamOutBindings.cs
Gorgon.Graphics.Core\States\GorgonSamplerStates.cs
Gorgon.Graphics.Core\Shaders\GorgonReadWriteViewBindings.cs
Gorgon.Graphics.Core\Buffers\GorgonConstantBuffers.cs

Please have a look on it.

Thanks

Undestructible GorgonText in 2.0

TL/DR version:

GC can't collect unused instances of GorgonText.

Details:

In its constructor, GorgonText subscribes to the font's FontChanged event:
_font.FontChanged += FontChanged;
This effectively creates a reference in the font to this instance of GorgonText. Since the object never unsibscribes from this event, the reference remains there forever and GC can't collect any of the GorgonText objects while their font is alive. If you create a font at the startup of your game and reuse it all the time while the game runs, all the instances of GorgonText you've ever created with this font will remain in memory with all their internal StringBuilders and stuff.

Error when calling GorgonGraphics.EnumerateAdapters

GorgonException: There was an error during creation.
The Gorgon Graphics interface requires Windows 10 (Build 15603) or better.

Looking at example "Balls", trying to convert to VB.NET, then I get runtime error.

Expected the function to go through without a hitch, as I'm currently running Microsoft Windows [Version 10.0.17763.1039].
screenshot 8

Thank you for your work.

Can not register a device (mouse/keyboard) when my project is build in x64 mode

Describe the bug
Can not register a device (mouse, keyboard) when project is built in x64. But with AnyCpu mode, my project can run fine.

To Reproduce
Steps to reproduce the behavior:

  1. What did you do?
public partial class Form1 : Form
    {
        GorgonRawInput input;
        GorgonRawMouse mouse;
        GorgonRawKeyboard keyboard;
        public Form1()
        {
            InitializeComponent();

            input = new GorgonRawInput(this);
            mouse = new GorgonRawMouse();
            input.RegisterDevice(mouse);

        }
    }

Expected behavior
I need build my project in X64

Screenshots
ErrorInput

  • OS: Windows 10 x64 build 18362.900
  • Version 1903
  • Visual Studio 2017

Additional context
None

Editor plug in system is under documented, and kind of a mess.

The API for the editor plug in system is poorly documented, and worse, haphazard in implementation, perhaps allowing for a little too much freedom and not much in the way of direction (see differences between rendering and view functionality for sprite editor and image editor).

To mitigate this the documentation will be improved, explaining each interface and how it relates usage in plug ins. Where possible, the API will be simplified and common use case base objects will be implemented to help simplify development.

Writing a plug in for the editor will still be a non-trivial task, but with these improvements some of the work for setting up the boilerplate should make the task less of a herculean effort.

Bloom effect is not expected

I asked this question in GameDev. My goal is to apply Bloom effect on Red border of texture. I changed the Format as you said from R8G8B8A8_UNorm to R16G16B16A16_UNorm but i got unexpected result. Please have a look on my codes. Thanks:

private static Gorgon2DBloomEffect _bloomEffect;
private static GorgonTexture2DView _bloomTextur2DView;
private static GorgonRenderTarget2DView _bloomRenderTargetView2D;
		
//Init bloom effect
_bloomEffect = new Gorgon2DBloomEffect(_renderer)
{
	Threshold = 8.11f,
	BloomIntensity = 6.0f,
	BlurAmount = 60.3f,
	ColorIntensity = 10.15f,
	Color = new GorgonColor(0.8f, 0.0f, 0.0f, 1f)
};	
//Init texture, ..
GorgonCodecPng png = new GorgonCodecPng();
var CardImage = png.LoadFromFile(@"D:\\1281720.png");

_bloomTextur2DView = GorgonTexture2DView.CreateTexture(_graphics,
					  new GorgonTexture2DInfo("Shadow Texture")
					  {
						  Width = (int)CardImage.Width,
						  Height = (int)CardImage.Height,
						  Binding = TextureBinding.RenderTarget | TextureBinding.ShaderResource,
						  Usage = ResourceUsage.Default,
						  Format = BufferFormat.R16G16B16A16_UNorm
					  }, CardImage);

_bloomTextur2DView.OwnsResource = true;
_bloomRenderTargetView2D = _bloomTextur2DView.GetRenderTargetView();

//In Idle func
_graphics.SetRenderTarget(_bloomRenderTargetView2D);
         
_bloomEffect.Render((_, __, size) =>
			{
				_renderer.DrawFilledRectangle(new SharpDX.RectangleF(0, 0, _bloomTextur2DView.Width, _bloomTextur2DView.Height), GorgonColor.White, _bloomTextur2DView, new SharpDX.RectangleF(0, 0, 1, 1));
			}, _bloomRenderTargetView2D);

_graphics.SetRenderTarget(_screen.RenderTargetView);
_renderer.Begin();
int x = 20, y = 1080 - _bloomTextur2DView.Height - 40, delta_x = _bloomTextur2DView.Width + 20;
_renderer.DrawFilledRectangle(new SharpDX.RectangleF(x, y, _bloomTextur2DView.Width, _bloomTextur2DView.Height), GorgonColor.White, _bloomTextur2DView, new SharpDX.RectangleF(0f, 0f, 1f, 1f));
_renderer.End();

This is texture image:
Texture
And result of bloom effect:
NO BLOOM

Question

Hello, I have some issues with using 2 forms with a GorgonApplication. Got 2 questions..
Q1: Why is the field MainForm in GorgonApplication ReadOnly? Would there be a bug if it was to be set mid-program?

I have some code that I try to run, and it works, although it encounters a bug when I deactivate the graphics window (activate a different window by clicking on it).

This is the startup form:

Imports System.Threading
Imports Gorgon.UI

Public Class Form1
    'doing other stuff here, like normal buttons and progressbars etc...

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim t As New Thread(Sub()
                                Dim tmp As New Form2()

                                GorgonApplication.Run(tmp, AddressOf tmp.Idle)
                            End Sub)
        t.Start()
    End Sub
End Class

and the graphics form or game form:

Public Class Form2
    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Initialize()
    End Sub

    Private Sub Initialize()
        'initializing graphics and 2d interface here
    End Sub

    Public Function Idle() As Boolean
        'drawing and other things here
        Return True
    End Function
End Class

I can start it up, click the button in Form1, it starts up the game form, then I'd draw whatever and play the game, then exit by pressing either exit button or possibly having a button in-game, then I'd be free to start up the game with the same button in Form1.

My problem occurs the 2nd time I start up the game form. If I start it up the 2nd time, then deactivate the entire application, so not activate the startup form, but actually activating a different window (or desktop) it crashes because the first game form that was passed to GorgonApplication.Run has been disposed. (it seems to me atleast.)

Q3: I do not understand why this error is happening. Do you understand? Please explain to me.

Q4: Is there something I need to do when deactivating the window or unfocusing?

I have not seen an example where you have an already open form, then try to start a GorgonApplication.

I have attached this solution.
WindowsApp1.zip

Thank you again!

Firework effect

I love Gorgon library. Please add Firework effect in the next release. Thanks

Add a means in the editor exclude folders from packed files.

Need a means in the editor exclude folders from packed files. This will allow us only package what we want, while keeping working files in the project file system.One way we could do this is set up a special directory that is used as an ignore area. This could be customized based on user preference.

We could also do our own take on a .gitignore file which will allow us to specify which directories are ignored.

One certainty is that we'll only ignore directories. This will keep things somewhat simple.

Port to .NET 5

This is pretty trivial to do for most of the API. However, the editor is going to be the tricky part since it relied on a 3rd party library (Krypton) to do the ribbon and docking. That, as of yet, has not been converted to .NET Core 3.0.

The other pain is that the Windows Forms editor is only in preview and a shadow of its former self. We may have to wait until .NET 5 before releasing a fully converted project.

This will be done in multiple passes:

  1. Convert projects to .NET Core 3 projects with the bare minimum code changes required to execute.
  2. Begin updating the code to take advantage of C# 8.0/.NET Core 3 features where it makes sense to do so across all of the APIs.
  3. Update editor and related plugins to use .NET Core 3/.NET 5 on the assumption that Krypton will be updated at that time.

When these passes are done the .NET 4.7.2 version of Gorgon will be frozen and will no longer be updated. The .NET Core 3.0/.NET 5 version will be the primary release build at that time.

Shadow example runs very slow

The shadowing example (TheShadowGn0s, god I'm an idiot.. who says that) is running very slowly when blurring is turned on.

This is due to a memory leak in the Gaussian blur effect regarding temporary render targets.

Add editor API usage example

Add an example that shows how to load content from an editor project (and/or packfile) into a standalone application using the functionality given by the editor API.

Terrible performance when saving packed file in Editor.

When we save an Editor project as a packed file it takes forever with some file types. This seems to be a problem stemming from the use of the SharpZipLib assembly.

Saving a 16 MB DDS file took approximately 3 minutes. Way too long.

Investigate and find a way to bring this down to something more reasonable, but still maintain compatibility with our file format.

Add GUI controls to graphics library

Dear Michael Winsor,

Could you please add some UI controls in your graphics library that can display on render screen, for example: Button, Radio Buton, Check button, Slider control...

Thank you in advance, and thank you for your great library

Best regards,

Error starting any of the examples

Apologies if I've missed something obvious. This isn't a bug, but the only other option here was "feature request".

Describe the bug
Any time I run any example, I get the error "SharpDX.SharpDXException: 'HRESULT: [0x887A0004], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_UNSUPPORTED/Unsupported], Message: The specified device interface or feature level is not supported on this system."

To Reproduce
Steps to reproduce the behavior:

  1. Load solution into VS 2019,
  2. Select Sprites project (or any)
  3. Press Play

Expected behavior
For the project to run. :)

  • OS: [e.g. Windows 10 Build 17763]
    Windows 10 Pro v 1909
    DirectX 12

Thanks for any help.

Upgrade to .NET 8.0

Need to upgrade Gorgon to .NET 8.0 since .NET 6.0 is slated for EOL in November.

This will be a major upgrade, including breaking changes.

Gorgon 2.0 artefacts

Hello fella,

Firstly - thank you so much for this! I've been scouring the net for weeks trying to find a .net accessible 2D drawing library and I'm hoping I've finally found it! As per:

https://www.gamedev.net/forums/topic/699147-recommend-a-simple-net-2d-library/?tab=comments#comment-5391882

It's looking like meeting the broadest of requirements - text, image and geometry rendering. It's looking like it won't do videos, however?

Either way - it's a great project. However, I am getting some artefacts on text rendering. Video:

https://youtu.be/yYSFY5NNllo

Code:

https://pastebin.com/iaYXkJFW

Hope you can help!

(p.s. I did try downloading 3, but got lost compiling the dll - got all sorts or errors - nothing to do with your code, more my setup)

Add another tool to the editor that allows us to pack multiple images into a texture atlas.

A common method for handling sprites in the olden days of DOS was to have a separate image, sized to the width/height required for the sprite. These days that's very inefficient. But, it has some advantages when it comes to handling content creation.

We currently have a sprite texture atlas builder that uses sprites to define the texture atlas. This is fine for existing sprites, but is a major amount of work for lots of individual sprite images.

We would do this similarly to the sprite texture atlas builder by allowing the user to pick all the images they need, and then generating sprites for those images (in memory), and then running the texture atlas generator on those sprites to produce the texture atlas (and, most likely output the sprites as well - Doesn't make much sense otherwise).

Question regarding Direct3D 11.4

I am unable to find a lot of information on "Direct3D 11.4", I was hoping you could answer.

Q1: Which feature set is required for this version of D3D?

Q2: Will Gorgon be compatible with earlier versions of D3D in the future (require lower level feature sets)? The reason I ask this is because a number of people (around 10 at the moment), that is playing a game I created using Gorgon, is complaining that my game doesn't support older GPU's which should be able to handle a relatively simple 2D game.

Thanks :)

Add sprite atlas tool plug in to Editor.

Create a tool plug in that will utilize the sprite atlas generation code in the 2D API.

This should present a list of sprite files to the user and they can then select these, and set up some parameters like:

  • Max texture size.
  • Max texture array count.
  • Padding around the sprite texture region
  • Texture format (limited to supported Render Target formats).
  • Output location in the project file system.

See issue #7 for more detail.

Add animation editor to Editor

Need to build an editor that allows animation of sprites (only sprites).

It should support:

  • Texture switching (coordinates, array index and texture resource)
  • Color animation (this includes opacity)

Might add:

  • Positioning animation. This will need to be relative or else it'll be useless on multiple resolutions - will need to update the 2D animation API to support this.
  • Rotation animation.
  • Scaling animation.

Add sprite atlas generation code to 2D API.

Add a service object that allows a user to pass in a series of GorgonSprite objects to pack onto 1 or more texture atlases. Sprites will be returned that point at the new texture(s) when done.

The object should take:

  • A list of GorgonSprite objects.
  • A maximum 2D texture size.
  • A maximum array size.
  • The resulting texture format (limited to render target formats).
  • A padding so that textures won't necessarily touch each other.

When processing, this will take the sprite texture coordinates (converted to pixel coordinates), and copy that rectangle onto a destination texture. The algorithm will work similarly to the Glyph packing algorithm in GorgonFont and will try to utilize the space as best as it can. If the texture size/array size is exceeded, then a new texture should be created.

The processing method should return a data structure that contains:

  1. The texture atlas(es)
  2. The updated sprites.

Change editor file system UI

I absolutely loathe the file system interface in the editor. A tree is not very good for managing files.

Need to find a better way to present a sensible UI to manage files within the project.

Overload LoadTrueTypeFontFamily

Is your feature request related to a problem? Please describe.
I am unable to load a font from memory (embedded resource).

Describe the solution you'd like
Overload LoadTrueTypeFontFamily with the possibility of using font from memory.

Describe alternatives you've considered
I don't see another way. If this is not the case, please let me know how I would be able to load a font from memory (as an embedded resource)

Is it stable enough right now

Is the 2.0 library stable enough to be used in a game dev project, and what are the recommended requirements for running the engine?

Add an example for particle system.

Add an example that shows how to build a particle system in Gorgon.

We don't supply this functionality in the renderer because that's beyond the scope of the renderer API.

Can not resize window

Firstly, thank you so much for the Great Library.

I get problem in restore (resize) windows after making it fullscreen. The app crashes if i exit FullScreen mode.

private static FormMain Initialize()
        {
            FormMain window = InitializeForm(new Size2(1920, 1080), "FX");
            try
            {
                IReadOnlyList<IGorgonVideoAdapterInfo> videoDevices = GorgonGraphics.EnumerateAdapters();
                watch.Stop();
                var elapsedMs = watch.ElapsedMilliseconds;
                if (videoDevices.Count == 0)
                {
                    throw new GorgonException(GorgonResult.CannotCreate,
                                              Gorgon requires at least a Direct3D 11.4 capable video device.\nThere is no suitable device installed on the system.");
                }
                // Find the best video device.
                _graphics = new GorgonGraphics(videoDevices.OrderByDescending(item => item.FeatureSet).First());
                _graphics = new GorgonGraphics(videoDevices[0], FeatureSet.Level_11_0);          
                _screen = new GorgonSwapChain(_graphics,
                                              window,
                                              new GorgonSwapChainInfo("Swap Chain")
                                              {
                                                  Width = 1920, 
                                                  Height = 1080,
                                                  Format = BufferFormat.R8G8B8A8_UNorm,
                                                  UseFlipMode = true
                                              });
                // Tell the graphics API that we want to render to the "screen" swap chain.
                _graphics.SetRenderTarget(_screen.RenderTargetView);
                //Set full screen
                _screen.EnterFullScreen();

                // Initialize the renderer so that we are able to draw stuff.
                _renderer = new Gorgon2D(_graphics);

                window.KeyUp += Window_KeyUp;
                window.IsLoaded = true;
                return window;
            }
            finally
            {
                EndInit();
            }
        }


private static FullScreen = true;
private static void Window_KeyUp(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case Keys.F1:
                    ShowStatistics = !ShowStatistics;
                    break;
                case Keys.S:

                    if (FullScreen)
                        _screen.ExitFullScreen();
                    else
                        _screen.EnterFullScreen();

                    FullScreen = !FullScreen;
                    break;
                case Keys.Escape:
                    GorgonApplication.Quit();
                    break;
            }
        }

cd
In all your examples, the window is fixed size. It seems, Gorgon does not support to change window size?.
Please take your time to point me some hints. Thanks

  • Edited to reformat code block

Add font editor to Editor

Need to build an editor for creating font metadata files so users can get real time feedback on their font settings.

See v2 font editor for an idea of how this should be implemented.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.