Jump to content

  • Log In with Google      Sign In   
  • Create Account


Forum is going away

  Posted by , 07 June 2015 - - - - - - · 558 views

<p><a href="http://tape-worm.net/wblog/wp-content/uploads/2015/06/Gorgon_2.x_Logo_Full.png"><img class="aligncenter wp-image-649 size-full" src="http://tape-worm.net/wblog/wp-content/uploads/2015/06/Gorgon_2.x_Logo_Full.png" alt="Gorgon" width="620" height="124" /></a></p>
<p>Since it’s pretty dead there (not that that’s unexpected, I hardly update the site), I will be shutting down the forums.</p>
<p>They will be locked into a read-only mode so that any information required is still available.</p>
<p>If you have a pressing Gorgon issue, I recommend using the <a href="https://github.com/Tape-Worm/Gorgon/issues" target="_blank">Github repository</a>, or leaving a comment on the blog (the git hub site is preferable however).</p>
<p>As for Gorgon: Believe it or not, I still work on it. Just at an incredibly slow pace. Similar to time dilation in a black hole or something magical like that.</p>


Git hub

  Posted by , 13 November 2014 - - - - - - · 556 views

<p><a href="http://tape-worm.net/wblog/wp-content/uploads/2008/10/sitelogo.png"><img class="alignleft size-full wp-image-8" src="http://tape-worm.net/wblog/wp-content/uploads/2008/10/sitelogo.png" alt="sitelogo" width="355" height="116" /></a>I’ve finally given in and become a lemming and followed the rest of the planet to git hub. So, from this point forward, Gorgon’s source code will be hosted at Git Hub. The source code currently hosted in the Subversion repository at Google code will remain as-is indefinitely. This means that in order to get the most up-to-date version of Gorgon, you will have to go to the git hub repository.</p>
<p>And here’s the link (also posted on the right side bar over there):</p>
<p><a title="Git Hubs" href="https://github.com/Tape-Worm/Gorgon">https://github.com/Tape-Worm/Gorgon</a></p>


Font editor

  Posted by , 31 March 2014 - - - - - - · 675 views
Gorgon, Direct3D 11, SharpDX, C# and 2 more...
Posted ImageIt’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:

Posted Image
Posted Image

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.



  Posted by , 10 September 2013 - - - - - - · 320 views
Gorgon, Direct3D 11, SharpDX, C# and 2 more...
Posted ImageIn 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 480×320 on a 640×480 screen or at 768×576 on a 1024×768 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.


More the editor

  Posted by , 27 March 2013 - - - - - - · 279 views
Gorgon, Direct3D 11, SharpDX, C# and 2 more...
Posted ImageHere’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.

Posted Image


The editor

  Posted by , 25 March 2013 - - - - - - · 237 views
Gorgon, Direct3D 11, SharpDX, C# and 2 more...
Posted ImageSo 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:

Posted Image

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:

Posted Image

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.



  Posted by , 22 February 2013 - - - - - - · 242 views
Gorgon, Direct3D 11, SharpDX, C# and 2 more...
Posted ImageFINALLY. 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.



  Posted by , 30 December 2012 - - - - - - · 198 views
Gorgon, Direct3D 11, SharpDX, C# and 2 more...
Posted ImageWell, 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.


Gorgon in text mode…

  Posted by , 12 September 2012 - - - - - - · 152 views
Gorgon, Direct3D 11, SharpDX, C# and 2 more...
Posted ImageYep. 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.
Posted Image
Text mode. Now you too can write state-of-the-art adventure games. N, E, LOOK, INV, instant death… good times.


Dual monitor stuff

  Posted by , 12 August 2012 - - - - - - · 148 views
Gorgon, Direct3D 11, SharpDX, C# and 2 more...
Posted ImageSo here’s a screenshot of the dual monitor code in action:
Posted Image
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.


January 2017 »

1516 17 18192021

Recent Entries

Recent Comments