Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    42
  • comments
    7
  • views
    27482

About this blog

Full of nub.

Entries in this blog

 

Gorgon Update #9

This is a small update that contains a few more fixes and additions.

As always, to get the latest version, go to the Github Releases page and download version 3.0.87.290. As always, there is a commit log on the release stating what changes were made.
View the full article

Tape_Worm

Tape_Worm

Gorgon Update #8

This is a small update that contains a few more fixes and additions.

To get the latest version, go to the Github Releases page and download version 3.0.86.259 . As always, there is a commit log on the release stating what changes were made.   View the full article  

Tape_Worm

Tape_Worm

 

Gorgon Update #7

This update contains a few more substantial fixes and additions to the library/editor. A new example was added showing how to use the fluent interface on the 2D renderer, and 2 new operations were added to the image editor that will mark the image as using premultiplied alpha, plus an operation that allows the user to assign a discrete value to the alpha channel of an image (this is also available in the Gorgon Imaging API on the IGorgonImageBuffer type as a fluent extension method). To get the latest version, go to the Github Releases page and download version 3.0.85.244 . As always, there is a commit log on the release stating what changes were made (including many commits for the build pipelines… ugh… so ignore those).   View the full article  

Tape_Worm

Tape_Worm

C# v3.0 Release

So, after about 5 years. Version 3 is done. Well, as done as I’m going to make it. Gorgon is finally released at version 3.0.66.147 and you can download it from the Gorgon GitHub repository on the releases tab. A lot of work has been done over the last few weeks to finalize this release. Bugs fixed, examples created, documentation updated, etc… One of the new things added was an effect for HDR Bloom (yeah, I know, it can be tacky). And along with this effect, a new example was created to show off a bunch of functionality (including the aforementioned bloom effect) all in one place. The ever predictable space scene. Now, I’m sure there’s still a ton of bugs and I’m aware of some performance issues in particular the editor application and saving packed files. Any issues can be filed on the GitHub repository issues tab. So what’s next? Well, I’ve spent a massive amount of time on this, especially in the last year and I really need a break. So I’ll be stepping away from this for a few weeks. Of course, if there are any bugs I’ll be sure to deal with them. I’ve been checking the issues tab on the repo for years now, I probably won’t be stopping any time soon. So yeah, there it is. Download it, give it a spin, and let me know what you find.   View the full article  

Tape_Worm

Tape_Worm

Screenshots

Just a quick update to let anyone who’s listening (all 0 of you – and the Russian spambots) know that the screenshot gallery has been updated with new images from v3. If you’re interested in seeing what Gorgon can do for you, you might want to pop in there and have a gander.   View the full article  

Tape_Worm

Tape_Worm

Editor v3

So, the radio silence is now over, at least for this post. I’ve been toiling away on creating an editor for Gorgon so people can edit sprites, and images (somewhat).   A little about the editor The editor is similar to the one in v2 in that it is completely plug in driven. That is, almost all functionality is based on plug ins, and without any plug ins the editor is nothing more than a file manager. The advantage of this is that end users can write their own plug ins for their own content. For example, if you’re making a game that uses a tile map, you’ll likely want a tile map editor. Instead of writing your own full fledged editor, and trying to make it work with the Gorgon file system, you could write a plug in for the Gorgon editor that allows you to create tile maps. All file system manipulation is taken care of, and with default plug ins, even sprite creation and image handling is all in the same place as your tile editor. Where this version differs from 2.0 is … well, pretty much everything else. The previous incarnation opened up a packed file and copied the contents to a temp folder, and when you worked on the content, it’d alter the file in the temp directory. When you saved the project, it’d repack the file with the updated content. This has proven to be less than performant. The new editor works more like Unity now, in that you pick a folder on your hard drive and you use that for editing your content. The folder is no longer temporary, so you can use it directly in your applications, or, should you want a packed file, you can export it as a packed file using the Gorgon packed file format (a plug in, a developer could create one that writes zip files if they so choose). You can also import packed files using the default plug ins for the Gorgon packed file format, or zip files. Plug ins Obviously, the editor is useless without plug ins. So, Gorgon (as of this writing) comes with 2 plug ins out of the box. The image editor, and the sprite editor. As time and energy allow, more will be added as development continues. Image Editor The image editor, with a volume texture loaded. It even has a volume rendering preview. The image editor is a bit of a misnomer. You don’t actually paint on the image/texture like you would in Paint.Net or Photoshop. It’s mostly a viewer, but there is some editing functionality like changing the image type, image format, updating array slices, mip levels and, if you have a 3D (volume) texture: depth slices. As you can see in the screenshot above, there’s a volume texture loaded with Perlin noise (and some alterations done by me – that’s the black line) with a nifty volume rendering preview to show how the texture will look. I’ve yet to see any image editor handle volume textures, so this is particularly handy. Adding array index data, mip data, and depth data is easily done by dragging an image into the image area on the screen. You can drag from the file explorer on the right hand side, or you can drag from Windows Explorer. If you have a texture cube, it will even change the view to the typical cross format and you can drop an image into each face, and it will also support multiple image cubes in the same texture (by having an array count that is a multiple of 6). If you want to edit the image data (i.e. paint some pixels), then Gorgon will take the current array index/mip level/depth slice and export it as a PNG file and load it into the editor associated with PNG files. When you are done editing, the image will automatically update in the editor. When images are imported into the editor, they are converted to DDS format. Why? Well: DDS is a ubiquitous format and has been around forever and designed for textures exclusively. It supports every texel format. It supports DXt compression – This is very useful when you have a lot of image data to load into the GPU. And it’s just easier to deal with one file format instead of trying to guess which format should be used when loading/saving image data. Now, with that said, images imported into the editor will be converted from their native format into DDS. So you can import any image file format supported by Gorgon, and, of course, by any image codec plug in you supply (this is supported, but no image codec plug in management is available in the editor yet – soon). Sprite Editor The sprite editor. The sprite editor allows you to clip out sprites from image/texture files and save those clipping coordinates, and other metadata into a file that can be read back and used. This saves a lot of grief if you’re trying to build up a bunch of sprites by not having to copy them out by hand. Sprites can be clipped in the usual way by dragging and resizing a rectangle around on the screen. And if you need pixel level accuracy, you can bring up the Manual Input window and enter the coordinates in by hand. You can also clip sprites by using a fixed size selection rectangle. But, you’re not limited to just drawing a rectangle to get at your sprite data. You can also use the sprite picker to click on a sprite in the image, and the sprite editor will do its best to determine the bounds for that sprite and surround it with a tight fitting rectangle. Or, if you want some spacing, you can also pad the rectangle by a specified number of pixels. The picker works by using a masking color/alpha value as means to locate the boundaries. When you click on the sprite it starts sampling the image in multiple directions and if it hits the masking color/alpha value, it stops and takes that as a minimum/maximum bound area. It then continues this process until the full extents are found (it’s basically a dumb flood fill). This masking color/alpha value can be modified by the user. Sprites can also have their corners (vertices) moved independently to allow skewing of the sprite using a corner offset editor. Other functions like altering the sprite color (or individual sprite corner/vertex color), and anchor point editing are also available. And the texture wrapping functionality changes the view to show what each wrapping mode along the X and Y axes would look like, and allows you to apply wrapping to the sprite (be aware though, that if you’re using a texture atlas, then the results will differ from the editor view). Sprites can also be imported into the editor like images, and by using plug ins, external formats can be loaded and converted into the Gorgon sprite file format. Currently this import process supports Gorgon v1, v2 and v3 sprite files. What’s next Well, there’s a few things that need to go in. Such as plug in management support for sprites and images so users can bring in other formats not supported natively by Gorgon. Also, a tool to clip multiple sprites from a texture atlas using a grid, and a sprite atlas creation utility. Ideally, I’d like to have a Font editor and Animation editor in there. But those will take some time to get off the ground. And the Animation editor is higher priority for me, so that one would be tackled first. Anyway, that’s it. The most current commits on the v3.0 branch on Github have the updated editor code, so feel free to check it out. And report any bugs you find on the Github issues page.   View the full article  

Tape_Worm

Tape_Worm

 

Gorgon v3 – Animation

I got the rework of the animation system for v3 done and up on the git hubs.  Naturally, I took this awesome video of it. It’s a music video. But not just any music video. A very bad, cheesy 80’s music video (the best kind). Of course, the music is metal \m/ (done, very poorly, by yours truly). Anyway, that’s all.   View the full article  

Tape_Worm

Tape_Worm

 

Font editor

It's been a very long time since I've made an update here. I've been working steadily on the font editor module for the Gorgon editor and it's finally nearing completion (the last 99% of 99% of 99% etc...).
I'm quite proud of this thing. It's supports a pretty well rounded suite of functionality for designing a bitmap font for use with Gorgon. Besides the usual standard stuff like font outlines, font faces, styles, etc... it also supports glyph brushes, custom glyphs, glyph advancement and offset editing and custom kerning pair tables.
Here's a few images:



These show the glyph gradient brush and the custom glyph functionality. Images showing the outline effects can be found in the gallery.
There are 4 supported glyph brush types in the editor:
Solid - Basic coloured brush.
Gradient - An editor linear gradient brush.
Texture - A brush that paints each glyph using the defined texture.
Pattern - Various patterns.

The custom glyph stuff is basically like clipping a sprite from a larger image. And since glyphs can proportional, you obviously need to adjust it so that there's no overlap (unless you want it) with other glyphs in the text. You can clip your custom glyph and adjust its advancement and offset until it mixes in well with your text. If you want really precise control, you can also define kerning pairs (not finished yet) to get better placement depending on the surrounding characters.
And finally, there's a secondary outline colour. This allows us to create interesting effects with the glyphs like glowing letters or hollow letters.
It's come a long way since I last did an update. And I'm pleased with the what I've managed to do with the editor at this point. As always, the code is available on the subversion repository if you want to give it a test run.

Source

Tape_Worm

Tape_Worm

 

Cameras

In the 2.x version of Gorgon I wanted to add cameras. It was most tedious before when you wanted to translate an entire scene by an arbitrary amount. So when I started this thing, I created an Orthographic camera object. The previous version of Gorgon used an Orthographic camera internally and this was never exposed to the user. But in this case, I exposed the camera so that the user can define their own viewing mechanism.
There's more info and a video inside...

For the last few days I've been perfecting my camera object, particularly the Orthographic camera, so that you can define any coordinate system you need. By default, Gorgon uses a screen space coordinate system. This is a comfortable system that many users are familiar with: 0,0 is the upper left, and Width, Height is the lower right. But sometimes that just doesn't cut it. What if you want everything relative and resolution independent? Well with the new camera object you can define your viewing area using a relative unit system by telling it to use -1, -1 as the upper left and 1,1 as the lower right (this would be a rectangle with an offset of -1, -1 and width and height of 2). Now when you place a sprite and assign it the coordinate of 0.5f, 0.5f, it will place it 480x320 on a 640x480 screen or at 768x576 on a 1024x768 screen. Perfect when your resolution is no longer at a fixed size.
So that's nice. But wait, there's more:

What's that in the video? Well, there's also a perspective camera. For those instances where you want to add a 3D component to your sprites. Using the perspective camera, the Depth property now sends the sprite deeper into the view space and perspective is correctly applied to the movement of the camera relative to the objects. In the video we see the ship pushed into the background and when we move the camera, the ship moves in perspective.
Also note that everything is relative to the camera. If you follow the green icon (and not the mouse cursor arrow), you'll notice that the ship is moving relative to the camera. In the code, only the camera is changing position. The ship is at the exact same coordinates it was assigned and was never moved. This is where a camera really shines.
So, I know it's been ages since I typed anything here. But as you can see, I'm still working on Gorgon. The refactoring process is nearly complete, and the 2D portion is nearly done. Once the editor is cleaned up and finished it'll be ready for release... I hope. I can't give an estimate on when that will be. It certainly won't be soon as I am only one man.

Source

Tape_Worm

Tape_Worm

 

More the editor

Here's a another screenshot of the editor. This time with the Font editor plug-in in action. Note that this is very very very incomplete and may not look like this when everything is said and done.


Source

Tape_Worm

Tape_Worm

 

The editor

So I've been busy working on building the editor for creating the content for Gorgon. I know I posted a screenshot of a very old initial version of the editor way back:

Ugly.
Anyway, I totally scrapped that old thing and restarted. And here's a more up to date (but not even close to being done) screen shot:

A little better.
This new editor is going to be a replacement for all the tools in the previous version of Gorgon. It will handle file management duties (File System Editor in v1.x), sprite editing (Sprite Editor in v1.x) and atlasing (Atlas tool in v1.x). It will also add font editing. The big thing about this editor is that it's entirely plug-in based. Meaning that the font editor, sprite editor, etc... are/will be DLLs that are loaded/unloaded as needed. What this means for you: You can write your own plug-in modules for it. Want to build a map editor and integrate it with the rest of your content? With the plug-in system in the editor, you can write your own map editor and host it right in the editor interface (if anything the minimized tedium of having to write UI code is worth it). Want to write out your content data as encrypted data? You can extend the file writing functionality to write out encrypted file data.
Unlike the sprite editor in the previous version, the files are no longer saved as loose files on your hard drive that require a separate utility (file system editor) to pack into a single compressed file. This editor now outputs data as a packed file (of course, this can be modified with a plug-in) so you don't have to come up with a strategy to update your content, allowing you to edit directly. This is where it takes over from the file system editor and like the old file system editor this one is capable of importing files by either clicking on an Import menu item, or dragging and dropping directly from explorer. And, obviously, there'll be a way to extract the files to your harddrive should you wish to do so.
I have several plans for plug-in modules for the editor including a sprite editor, image editor (a very very very very simple editor, use photoshop or paint.net if you want high detail stuff), a font editor and a shader editor (maybe).
FYI, the window will look like that in Windows 7 as well (i.e. no aero glass). I've modified it to look like the Zune window by including a new object in Gorgon.Common.Dll called ZuneForm. Basically you inherit this form instead of a System.Windows.Forms.Form and then you get a Zune-looking window.

Source

Tape_Worm

Tape_Worm

 

DEATH TO D3DX!

FINALLY. I'VE FINALLY DONE IT! It took weeks of work, but I managed to exorcise D3DX from Gorgon. Behold my video playing an animated GIF using a 2D texture array:

I've provided extensive info after the jump thingy.
In case you're wondering (and you know that you are), I used the D3DX utility library to handle some horrible jobs in Gorgon. Namely saving and loading textures and importing GDI+ (System.Drawing) bitmaps into textures. But with the abomination that is Windows 8, and DirectX 11.1 (which, just to be clear, Gorgon is NOT using), D3DX has been left to rot. Fine by me, one less dependency (and hopefully no more d3dx4312318793728.dll was not found errors).
So, how am I performing texture loading/saving? Well, being the daft bastard that I am, I created a rather complicated (for me) imaging system to handle loading, saving and manipulation of image data. The last part is underlined because Gorgon 1.x had very limited capability in that area. It's all based on the toolkit code in SharpDX by Alexandre Mutel and the DirectXTex library by Chuck Walbourn. I seriously wouldn't have been able to get anywhere if those guys hadn't done as much work as they did.
That said, it was still no walk in the park. The SharpDX toolkit code is fairly basic, and the DirectXTex library is in C++ (I now remember exactly why I don't use that bastard of a language anymore).
With all that said, here's what's new with texture loading/saving:
Image data is now manipulated through the GorgonImageData object. This allows us direct access to the pixels of an image on any texture array (or depth slice if using volume textures) index and mip map level. It breaks the indices and mips into parts that can be indexed like a collection and provides data streams to allow reading/writing of data into those buffers. All requisite information is included, such as row pitch, slice pitch (= image width * height * bytes/pixel). All in all, it makes accessing the data pretty easy.
Images can be loaded directly into the image data using FromFile/Stream methods. This is pretty straightforward. Image data can also be saved to a file/stream.
The image data object can perform conversion on several (but not all) formats. Plus it'll do resizing of images.
That's the image data object... is that a texture? No, it is not a texture. It is the data that a texture can use however. You may create textures by loading them directly from a file/stream, or into an image data object and then pass that image data object into the texture creation methods. Or even create an empty texture and copy the data in later. The two object types are related, but different. One is for low level image manipulation, the other is for dumping that image data into your video card.

Codecs... Gorgon now has several objects called codecs. These are used to decode/encode image data from a file/stream. Codec objects are passed to load/save methods whenever texture or image data objects are loaded/saved. Currently Gorgon has support for:

DDS - This was a bastard to write.
TGA
GIF - This was a bastard too
PNG
TIFF
BMP
WMP


Codecs are objects. Not enumeration types like the previous versions of Gorgon. Why? Because each codec has a set of properties which allow you to alter how images are decoded and encoded based on the codec you're using. This allows us to do transformation of image data as it's brought in.
Codecs are custom objects. That is, you, yes you, can write your own by inheriting from GorgonImageCodec and you'll be able to save/load your very own file format. Because the world needs more file formats.


Currently GIF, PNG, BMP, WMP, and TIFF are using the Windows Imaging Component API to encode/decode the data for those file formats. This requires that WIC be installed on your system if you plan on using those formats. However, this shouldn't be an issue because Windows 7 should have it installed already. Also, because codecs can be created by users, you can always write your own PNG codec and not use my crappy version.
Anyway, that's about as much as I care to babble on about this.

Source

Tape_Worm

Tape_Worm

 

<p><img class="alignleft size-full wp-image-8" ...

So I’ve been adding examples to the new version of Gorgon for the last week or so.  The latest one shows how to use the new input system to use a Raw Input mouse, keyboard and joystick (if present, and is actually not using Raw Input as such).  It’s a pretty silly example, but shows how to get the input plug-ins loaded, how to create an input factory and how to create the objects used to represent the various input devices. You want pictures though.  I have one.  And it is here.
View the full article

Tape_Worm

Tape_Worm

 

Boing!

Well, it's been a while. I've been busy. You've been busy.
Anyway, I actually took some time to test out a piece of functionality for the new version of Gorgon. This new version of Gorgon will have a graphics API separate from the 2D renderer (the 2D renderer uses the graphics API however). This is unlike the previous version where the renderer was pretty much all you had access to. I had a user ask me a long time ago if it were possible to access the underlying renderer to render 3D along with the 2D. At first, it did not, but I did hack in a way to access SlimDX directly through a plug-in and it was awful.
So, in this version I decided to give the developer access to the full graphics API under the renderer. This allows the user to switch between 2D graphics and whatever they want. And here's the results of my intense labour pain:

Yep, it's a clone of the old Amiga demo "Boing". As you can see, there are 2D elements (the text and the logo) along with the 3D elements (which were all done manually I might add, Gorgon does NOT have a 3D renderer so don't get too excited). I've decided to include the code as an example program for the new Gorgon.
Rejoice.

Source

Tape_Worm

Tape_Worm

 

Gorgon in text mode

Yep. Console window actually. Exciting. Just a silly example program showing how to use some of the functionality from the common library.
You can go back to sleep now.

Text mode. Now you too can write state-of-the-art adventure games. N, E, LOOK, INV, instant death... good times.

Source

Tape_Worm

Tape_Worm

 

Dual monitor stuff

So here's a screenshot of the dual monitor code in action:

It's not much to look at, but it was a major pain in the ass to get working, and does indeed work. Basically you create 2 forms, and 2 swap chains and set both swap chains to full screen and then add some special code to handle cases where focus is lost/restored on the primary form.
Gorgon would normally handle focus loss to reset your full screen mode for you when focus is returned (this is due to a bug in WinForms and DXGI). And that's all well and good, but this code really doesn't work well with multiple monitor situations. So, there's a flag to tell Gorgon to turn off the automatic mode reset on focus, and that will let you, the user, handle the transition when dealing with multiple monitors. It's not an ideal situation, but it works
It's a bit complicated to set up, but there'll be an example included with Gorgon on how to use dual monitor setups that'll guide you through the process.

Source

Tape_Worm

Tape_Worm

 

Look at my balls

So, I've been quite busy lately with a new job and such. And as a consequence I haven't had any time for Gorgon recently. But I finally sat down this evening and did a little work (not much mind you, and certainly nothing of note) on Gorgon 2.x.
I've uploaded the Ball Demo to the site so people can have a look at it. I'd appreciate any feedback (please post the feedback to the forums, thank you).
Please note the following before running it:
It'll probably crash. It's in development after all.
You NEED Windows Vista Service Pack 2, or Windows 7 (Windows 8 -might- work, but don't count on it).
It will run on Direct 3D 9 capable video devices. However, it requires Direct X 11 be installed on the system (hence the OS requirements).

To run it, just run the BallDemo.exe and pray (oh, and ensure that the zip file isn't 'blocked' by Windows, .NET assemblies hate that shit). It defaults to windowed mode with a resolution of 1280x800 although you can modify the BallDemo.config file to change to a resolution you like.
Let me know what your performance is like.

Source

Tape_Worm

Tape_Worm

 

Issues with installing SlimDX Mar 2009 (2.0.7.41)

Apparently there's an issue with Gorgon installing SlimDX. When the installer runs, it is supposed to detect whether the March 2009 SP1 (v2.0.7.41) SlimDX assemblies are installed. If they are not, then it will install SlimDX for you. However, it has come to my attention that the Gorgon install has not been installing SlimDX.
The issue is with the March 2009 SP1 SlimDX end user runtime installer (Gorgon runs this when it installs). Apparently it's not working, and even though I've tried to download it from the SlimDX site it still refuses to run (for me) and claims that the installer is invalid.
If you're having issues running Gorgon applications because it can't find the v2.0.7.41 SlimDX assemblies:
"Could not load file or assembly 'SlimDX, Version=2.0.7.41, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9? or one of its dependencies. The system cannot find the file specified."
Then install the SlimDX March 2009 SP1 Developer SDK from here and all should be well again.

Source

Tape_Worm

Tape_Worm

 

Gorgon

There's a new version of Gorgon uploaded. There's not a huge amount in this release regarding the actual graphics library, just a few bug fixes.
However, there are two important changes:
The project/solution files for the library source code were converted to Visual Studio 2010. This means that in order to compile the Gorgon library, you will need Visual Studio 2010. The library still uses .NET 3.5 SP1, so Visual Studio 2008 will continue to work when using the library assembly.
Most important of all: There's been a new library added called GSound (Gorgon Sound). Written by ShadowDust702. New forums have been added to reflect this new addition.

You can download Gorgon from here.

Source

Tape_Worm

Tape_Worm

 

Editors

I decided to take a break from writing the library, and have been working on the editor. Here's a screen shot of the font editor in semi-action. Please note that this is very preliminary and there's not a lot going on here.


Source

Tape_Worm

Tape_Worm

 

More text stuff.

Here's a sample of text rendering in Gorgon 2.0 (Dorian). It's rendering 16,019 characters, animated with shadowing (which doubles the character count), plus the FPS counter. When it renders the text, it renders with kerning information (provided the font has any) so the output should be properly spaced. And while it's doing this, it's scaling the text to pump up the fill rate.
All that at ~75 FPS, that's not too bad hey?
In this particular "demo" you can see that I'm able to compress and expand the lines of text. This is possible because of the new "LineSpacing" property in the text object. This allows the user to set line spacing by setting a multiplier. For example, a LineSpacing of 2.0 will give you double spacing and 0.5 will only move the lines half way.
Anyway, I'm still plowing through all of this. And I'm pretty happy with the results.

Source

Tape_Worm

Tape_Worm

 

Gorgon v1.x

I'm updating the solution and projects for Gorgon 1.x in the Subversion respository to use Visual Studio 10 . The current binary release still uses Visual Studio 2008 and will continue to do so until a new release is put up.
If you are freaking out over this because it'll somehow be the end of everything you love and hold dear, stop whining and get the express version of VS 2010 here.
Please note Gorgon still uses .NET 3.5 SP1 and you can use the binaries with Visual Studio 2008. Again, you only need Visual Studio 2010 to compile the source for Gorgon. I cannot stress that enough.

Source

Tape_Worm

Tape_Worm

 

Text output and Fonts

Sweet merciful fark. That was painful.
I just spent the last 4 evenings/nights writing Gorgon's font system and it was not fun. And, of course, I'm still nowhere near done (still have to create the TextSprite object, and other the font effects like gradients and GDI+ image brushes). But, I got it working. Not only that, unlike the previous incarnation, it actually implements kerning properly (well, approximated kerning, I'm not dicking around with actual kerning. fark that.) One of the things about the 1.x font/text rendering that I absolutely hated was while it was worked, every now and again (especially on smaller fonts), it'd screw up and a letter would appear slightly (or not so slightly) shifted. Quite annoying. Here's a screen shot showing how awful it was compared to GDI+ and how awesome v2 is going to be (click to expand it):

Gorgon/GDI+ text comparison
Note that all text is the same font: Arial, 9.0 point, Bolded and Antialiased. Also note that v2.0 is nearly (but not quite pixel perfect) identical to the GDI+ DrawString version. I think that's a slight improvement.
After our forum member, ravl, had issues with Gorgon's fonts and DPI on his game, I decided to rethink how fonts are handled in Gorgon. Currently, the fonts are generated on the fly by copying the glyphs from a GDI+ font object (via DrawString) to a GDI+ bitmap and arranged on that bitmap to use the space as effectively as possible. Then that bitmap is copied to a Texture (or textures) and then the TextSprite uses those textures to draw the glyphs. This is all well and good, however, if the DPI is different on someone elses monitor, the font that's created on your monitor may be smaller/larger than the font when it's displayed on someone elses monitor. That's annoying. And, because I thought "Hey, no one will ever need to load/save these fonts because you can generate them on the fly!", you can't, well, save or load these fonts as bitmap fonts.
Enter Gorgon v2 fonts. These font objects will now be able to be persisted as-is as bitmap fonts. No more worrying about DPI, if it's 24 pixels high on your monitor, it'll be 24 pixels high on theirs. Gorgon v1 originally did fonts this way, but I had issues with kerning that I could never quite get past (until now), so I dropped it in favor of this scheme. It works well enough, except when it doesn't (see image above). However, what if you do care about font scaling? Well, no worries, I got that covered too. Gorgon will allow you to create these fonts in code like you could before.
I decided to forego putting the font object in the 2D library. I didn't want to tie it to the 2D stuff because really it's all just texturing and crap and no real geometry. So, it resides in the main graphics library as part of the textures object group (after all, it is essentially a very specialized texture). However, the TextSprite will be part of the 2D library.
My plans are to make the font completely customizable, and to that effect, custom glyphs can be added with custom textures. So if you wanted a giant flaming skull in the shape of an 'A' or some shit, you can do that and still keep your regular font. Kerning is customizable as is glyph advancement as well. I'm also going to make an editor for fonts so that building a font won't be a chore. But that's in the future.
Anyway. It's progress.

Source

Tape_Worm

Tape_Worm

 

Yet more shaders

Here's another bundled effect, the Gaussian Blur shader:
If you see any stuttering, blame Fraps, I was getting over 1000 FPS while it was blurring and running.

Source

Tape_Worm

Tape_Worm

Sign in to follow this  
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!