After the silence earlier in the year I'm so happy to be blogging more often, and I hope you are all enjoying it too; I can see some regulars popping by and a few new faces in the stats list; but still far too many of you are totally anonymous, drop me a comment!
A blog about my rantings, including Games, Game Development, Gaming, Consoles, PC Gaming, Role Playing Games, People, Gaming tips & cheats, Game Programming and a plethora of other stuff.
Monday, 29 August 2022
Home Engine - Bank Holiday Camera Controls & More Models
Friday, 19 August 2022
Home Engine - Set Course for Vulkan
Over the last year I've been experimenting with writing my own home game engine, initially I spent time writing my own line rendering and then a wrapper with SDL2 all using my own mathematics library as a refresher.
Wednesday, 6 October 2021
Home Engine - Loading PNG Textures into DirectX11 with SDL2
ANYONE Interested in my sharing the code to do this? Leave a comment, 10 comments and I'll blog it.
I'm using SDL2 as the background framework for providing cross platform input and window handling, but I'm writing my own renderers for various platforms (DirectX11, 12, OpenGL and Vulkan).
All of them support coloured shape and line renderering to one extent or another, so I decided to take the leap into texture mapping.
First of all I put in all the framework to represent textures in my engine in a cross platform manner, and for ease I decided to use SDL2_Image to load my pixel data. And I started with a simple PNG file I created in MSPaint....
Immediately I ran into issues, PNG is RGBA, the png I created had a transparent background as far as I knew it should all work. I swapped to RAW pixels and I was getting 4 bytes per pixel, it was only after a bunch of reading and then stepping into the SDL_Surface format did I realise the data might be whatever format but the surface was clearly 3 bytes per pixel. And funky things were happening.
My assumption that MSPaint was outputting 4 bytes per pixel was just wrong, instead it's 3 bytes, RGB. And there's no matching DXGI_FORMAT for just RGB - least none I could spot.
A quick reexport in GIMP setting the explicit pixel format to 8bpc RGBA, which then of course just worked....
Monday, 20 September 2021
Home Engine - Lines and Camera Interaction
Yes, yes, it has been a while; both here and on the YouTube channel, I've just been very busy okay?... Okay. Friends?... Friends.
So what have I been up to in code?... Well today I added line rendering to my home engine, this is still using the underlying "Triangle" raw data, so I have to always have a cleanly divisible by 3 (for the sides of a triangle) number of indices in the data, but otherwise it just seamlessly integrated.
Its using "LineList" as the underlying primitive type, which maps to the D3D11 type under.
I also noticed that these lines from 0, 0, 0 to 1, 0, 0 and 0, 1, 0 and 0, 0, 1 respectively are "backwards", that is my unbeknownst to me at some point my camera has started to spawn around in front of there my scene objects are, so I'm looking back along the Z axis not "up" along it... Am I making sense?
I also improved the camera some by linking the rotation of the camera to the mouse, which makes it super intuitive.
The failed part of the work this last month was an effort to update both the Vulkan and the OpenGL renderer implementation. This was an utter failure, the simple reason being that I've gone too long with my limited knowledge with DirectX. I'm sure the "port" to DirectX12 will be easier, but yeah, I've already gotten the other API's so far from my implementation (abstract base classes) that it's quite alien to return to them.
I'll circle back on that, maybe break down the API's with failed/broken builds until I can slowly etch away at the challenge.
Monday, 29 March 2021
Perlin Noise Terrain Chat #0
No ship diorama update.?!?!??!!? Yes, thank you for the six messages (a record for messages in just a few hours - I'm writing this one Monday night) there will be an update later this week.
So what have I been up to?... Well, I've been rewiring the conservatory, so I can work in it, and this space is to become a second office space for me, a different place to let my creative code juices flow.
The first thing I've been doing is playing about with my raw graphics engine and building terrains within the 3D space.
Now, I did a bunch of terrain generation for a Hex-bases wargame that never made it to market; many years ago, and I still have one of the early prototype screenshots here:
Its that underlying mesh I was looking at getting to, some cell by cell generated terrain that I could undulate and stitch together with seamless edges.
But before all that my graphics project needs a generator, and I decided to build the height map for this mesh with perlin noise.
This is my perlin implementation, I'll go a head and play about with generating a mesh from this, luckily I only have to generate the y value for a given x and z axis distance, so I could parallelise this quite well across my many core machines.
More to follow I guess...
