RSSAmplifier

Blog

The blog of Kyle Halladay

kylehalladay.comRSS feed ↗42 posts

Latest posts

Hooking and Hijacking DirectX 11 Functions In Skyrim

My last post was a deep dive into the nuts and bolts of how function hooking works, so for my next project I wanted to focus less on how hooking works, and more on how to use it to do something cool. I started looking at function hooking because I wanted to understand how ReShade works, so I decided that I’d take a baby step closer to that goal and draw a triangle across the screen in a real game.…

X64 Function Hooking by Example

I’ve spent some time recently figuring out how function hooking works. There are tons of great resources available about it, but I’ve noticed that a lot of them are really light on providing example code, and the ones that do provide code tend to link to fully mature hooking frameworks. Usually the linked projects are really impressive, but they aren’t the easiest places to learn the basics from.…

Ray Tracing In Notepad.exe At 30 FPS

A few months back, there was a post on Reddit ( link ), which described a game that used an open source clone of Notepad to handle all its input and rendering. While reading about it, I had the thought that it would be really cool to see something similar that worked with stock Windows Notepad. Then I spent way too much of my free time doing exactly that. I ended up making a Snake game and a small…

Hooking Keyboard Input To Play Snake In Notepad.exe

This is second (and last) post about my quest to make a real-time game playable in stock Notepad.exe. In the previous article , I talked through using a quick and dirty memory scanner to get access to Notepad’s on screen text buffer (and build a ray tracer that rendered into it). In this post I’m going to talk about how I handled getting user input, and finally ended up at a fully playable Snake…

Recreating An Old "Dirty Gamedev Trick"

There’s a story that pops up in my twitter feed every 6 months or so. The original version of it is from a Gamasutra article published in 2013 which contained a collection of stories of various “dirty” tricks used in previous games ( link ). There’s a lot of fun stories in the article but one stands head and shoulders above the rest in terms of awesomeness. I’ve copied the specific story below so…

I Wrote A Book About Shaders!

From the looks of my blog archive, it’s been 13 months since I dropped off the map and stopped posting. That’s because around that time I got an e-mail from Apress Books asking if I wanted to write for them. I’ve gotten several messsages like this since I started writing my blog, but this one was different in two key ways: They didn’t have a book idea in mind already, instead, they wanted to know…

A "Bind Once" Approach to Uniform Data

After figuring out how to use a global array of textures to store all the textures that are in use for a frame in a single descriptor set, I returned to my material system project and realized how much easier life would be if I could do all my descriptor set binding at the beginning of a frame, both because I’d avoid any performance overhead from doing lots of binding, and because it greatly…

Using Arrays of Textures in Vulkan Shaders

Lately I’ve been trying to wrap my head how to effectively deal with textures in Vulkan. I don’t want any descriptor sets that need to be bound on a per object basis, which means that just sticking each texture into it’s own set binding isn’t going to work. Instead, thanks to the Vulkan Fast Paths presentation from AMD, I’ve been looking into using a global array of textures that stores all my…

A Simple Device Memory Allocator For Vulkan

Last month, I posted about the material system that I’ve been trying to piece together, and talked about how the next step for that system was going to be to extend it to handle material instances. This sounded like a great next step until I started building it and realized that in order for this to work with arbitrary data, I needed to sort out how I wanted to manage allocating arbitrary amounts…

Lessons Learned While Building a Vulkan Material System

One of the things I’m noticing about learning Vulkan, is that there isn’t a lot of material out there to bridge the gap between being a complete beginner, and being able to build your own real applications. I didn’t realize how big this gap was was until I decided to start my next Vulkan project by building a material system. It was supposed to just be the first step in something bigger, but I…

Improving Vulkan Breakout

There are lots of reasons why I love the internet, but one of the big ones is that it gives me a way to learn from folks that I would never get to interact with in real life. Two weeks ago I posted about Comparing Uniform Data Transfer Methods In Vulkan , and immediately got a bunch of great suggestions from Twitter (thanks @SaschaWillems2 !), and from reddit on how I could improve things. There…

Comparing Uniform Data Transfer Methods in Vulkan

Lately I’ve been trying to wrap my head around Vulkan. As part of that, I’ve been building a small Breakout clone ( github ) as a way to see how the pieces of the API fit together in a “real” application. When I’m starting to learn a new graphics API, the thing that I try to focus on is getting used to all the different ways to send data from the CPU to the GPU. Since my Breakout clone didn’t have…

GBA By Example - Sprite Animation

(Note: This is Part 5 of my GBA by Example series. A list of my other GBA tutorials can be found here ) Whew, it’s been awhile! I know I said I’d put up another tutorial in 2 weeks…but that didn’t happen. Between shipping a game at work, and diving into Vulkan, my interest for GBA stuff definitely took a back seat. Lesson learned, don’t put a deadline on blog posts :) So far, I’ve gotten by with…

GBA By Example - Getting User Input

(Note: This is Part 5 of my GBA by Example series. A list of my other GBA tutorials can be found here ) We’ve covered an awful lot of drawing in these posts, but it takes a lot more than drawing code to make a game. One of the key parts of building something playable is letting users actually be able to interact with our code, so today I’m going to go over how to get user input on the GBA. It’s…

GBA By Example - Drawing and Moving Backgrounds

(Note: This is Part 3 of my GBA by Example series. A list of my other GBA tutorials can be found here ) It’s Tuesday, which means it’s the arbitrary day of the week I chose to post GBA stuff! Last week we got a sprite on the screen and moving around in a tiled video mode, but it still left our screen looking a little bit bare. This week we’re going to rectify that, and figure out how to work with…

GBA By Example - Drawing and Moving Sprites

(Note: This is Part 2 of my GBA by Example series. A list of my other GBA tutorials can be found here ) Last week , we were working in video mode 3, which is one of the “bitmap” video modes. These modes are named so because they use the GBA’s 96K of video memory (VRAM) to store a representation of the screen as an array of colour values. If you want to draw to pixel (0,0), you simply set the first…

GBA By Example - Drawing and Moving Rectangles

The idea of making something for GameBoy has always appealed to me. Not only was it my platform of choice when I was a little kid, but naively, it has always looked like the relaxing combination of hardware simple enough to really understand, an OS (or BIOS) that gets out of your way (no firmware updates), and a platform that’s open enough to not need to deal with jailbreaking the device, and the…

Fixeds, Floats and a Block Damage Effect

As you may have guessed from the everything that I post, I love cheesy rendering effects, and no surprise, that means that I’m a big fan of cyberpunk games, especially ones that really go over the top with effects. As such, I thought I’d spend some time this weekend building a classic glitch effect: It’s a very simple effect, but it’s also a perfect excuse to talk about using the correct precision…

A Pencil Sketch Effect

There are a handful of effects that have kicked around in my brain for awhile in a nebulous “one day, I want to build that” sort of way. Some of these include using genetic algorithms to turn images into triangles (like here ), Portals, Procedural Clouds, and the one I decided to build this weekend: Real Time Hatching (or something like it)! Real Time Hatching is the fancy (and much more concise)…

Distorting Object Shapes in Screen Space

Today I’m going to walk through a different take on the distortion effect that I presented awhile ago in the post “Screen Space Distortion and a Sci-fi Shield Effect.” This time, instead of using distortion to see “through” an object, we are going to distort the shape of objects themselves. When it’s all done, it’s going to look something like this: Pretty snazzy right? The tricky part of the…

Minimizing Mip Map Artifacts In Atlassed Textures

Since all my professional work is on mobile games, I spend a LOT of time working on tools and systems that can squeeze as much performance out of low powered hardware as possible. Perhaps unsurprisingly, one of these tools is texture atlassing, that is, packing multiple textures into a larger image, which ends up looking something like this: That Texture Atlassing is a good idea isn’t really news.…

Screen Space Distortion and a Sci-fi Shield Effect

Sometimes inspiration comes from the weirdest places. I was idly browsing reddit after work awhile ago and stumbled onto this post by user Guillaume_Langis . It was a gif of a shield effect that they had created for their game Warfleet . The comments section on that site was filled (predictably) with users asking how they effect was done, and Guillame ended up actually posting the c# and shader…

A Burning Paper Shader

After a long hiatus, I’ve decided to start posting again! And I can think of no better way to kick that off than with revisiting a cheesy old shader that I posted 2 years ago. So today we’re revisitng the “Dissolve” shader effect. I’ve seen this effect pop up more and more lately, mostly on 2D elements ( like in Hearthstone and Armello ), so today we’re going to see what we can get working on a…

Using Pixel Shaders with Deferred Lighting in Unity 4

NOTE: This article is for an old version of Unity (Unity 4...sometime in 2015) and may not run / be useful for the latest version of unity In a previous post ( link ), I talked about why surface shaders are a great way to write shaders for Unity’s Deferred Lighting rendering path, and they are. But given the choice, I’d rather write pixel shaders. Surface shaders always felt a little too much like…

OpenMP vs OpenCL - An Unfair Comparison

In the wake of my last post, I decided to get started with my path tracing project by building a small proof of concept renderer to get my feet wet both with the path tracing algorithm and with OpenMP. I was pretty happy with the output of the path tracer (shown below), but I wasn’t happy with the speed I was getting. Since this project’s entire goal is to entertain me, having to wait minutes to…

Setting Up OpenMP on Mavericks

NOTE: This article is from 2014 and will not be updated. It may or may not still be valid If you’ve ever worked with me (or talked with me for more than a half hour) it’s not a secret that I’m completely fascinated with ray and path tracers. My last project was building a relatively simple ray tracer , so I think it’s time to build a path tracer. The Blender monkey rendered in my first ray tracer…

Getting Started With Compute Shaders In Unity

NOTE: This article is for an old version of Unity (Unity 4...sometime in 2014) and probably won't run anymore, but the basic idea is still valid. I just don't want to spend time updating old posts every time Unity increments a version number I love the simplicity of vert/frag shaders; they only do one thing (push verts and colors to the screen), and they do it exceptionally well, but sometimes,…

Colouring Shadows in Unity

NOTE: This article is for an old version of Unity (Unity 4...sometime in 2014) and probably won't run anymore, but the basic idea is still valid. I just don't want to spend time updating old posts every time Unity increments a version number If you’ve ever looked for help getting different coloured shadows in your Unity game, you were probably surprised by how little there is on the forums in the…

Writing Shaders for Deferred Lighting in Unity3D

NOTE: This article is for an old version of Unity (Unity 4...sometime in 2014) and probably won't run anymore, but the basic idea is still valid. I just don't want to spend time updating old posts every time Unity increments a version number Awhile ago, I wrote a post called Writing Multi Light Pixel Shaders in Unity , and covered the basics of how to write shaders that use a whole bunch of lights…

A Spline Based Object Placement Tool

NOTE: This article is for an old version of Unity (Unity 4...sometime in 2014) and probably won't run anymore, but the basic idea is still valid. I just don't want to spend time updating old posts every time Unity increments a version number I’m convinced that one of the secrets to levelling up your Unity skills is to become very comfortable writing custom editor tools. Every project I’ve worked…

On Bacon Jam and Grilling Virtual Meat

NOTE: This article is OLD! Information in it may be out of date or outright useless, and I have no plans to update it. Beware! Weekend game jams aren’t usually my thing. Generally speaking, I like having the weekend to recharge, and spending all of one getting little sleep and feverishly working to finish a (usually) throwaway project is not usually tempting. However, last weekend Reddit hosted…

The Basics of Fresnel Shading

NOTE: This article is for an old version of Unity (Unity 4...sometime in 2014) and probably won't run anymore. Beware! I recently stumbled on the awesome article: Everything Has Fresnel (if you haven’t read it, go read it now). The main premise of the article is that real world materials are not actually as neat and tidy as programmers would like to believe, and more specifically, that virtually…

Creating GLSL Shaders at Runtime in Unity3D

NOTE: This article is for an old version of Unity (Unity 4...sometime in 2014) and probably won't run anymore. Beware! The feeling of solving a problem that seems potentially impossible is awesome. My latest project is no exception. The concept involves users being able to write shaders while the program is running, and compiling them at runtime onto objects in the scene. Normally this wouldn’t be…

Ray-Sphere Intersection with Simple Math

NOTE: This article is OLD! (From 2013!). Information in it may be out of date or outright useless, and I have no plans to update it. Beware! Lately I’ve been working on a ray tracer. It’s been going well (or at least as well as I could hope my first renderer could go), but it has been a slow process. I don’t have a formal math background - my day to day work only ever goes as far as enough linear…

Combining Pure Data and Unity

NOTE: This article is OLD! (From 2013!). Information in it may be out of date or outright useless, and I have no plans to update it. Beware! About 6 months ago, for 1GAM, Johannes and I spent a month tinkering with LibPD (the end result was Synapse). LibPD, for those of you who don’t know, is a library for working with Pure-Data , a visual programming tool for procedural audio. Out of the box, it…

Writing Multi-Light Pixel Shaders in Unity

NOTE: This article is OLD! (From 2013!). Information in it may be out of date or outright useless, and I have no plans to update it. Beware! One of the first things that people get shown when they start learning shaders is how to write a simple, single light, diffuse shader. I have yet to see a single shader tutorial out there that ever returns to this initial exercise to demonstrate how to write…

Making a Dissolve Effect with Surface Shaders

NOTE: This article is OLD! (From 2013!). Information in it may be out of date or outright useless, and I have no plans to update it. Beware! I recently posted a shader pack which creates a cool “dissolve” (for lack of a better descriptor) effect, similar to the skin of Skyrim’s dragons during their death animation. As requested by reddit, this post detail exactly what you need to know to write one…

Multi Coloured Shadows In Unity

NOTE: This article is OLD! (From 2013!). Information in it may be out of date or outright useless, and I have no plansto update it. Beware! UPDATE: I’ve posted a tutorial on how to get coloured shadows working in your project. Check it out here Lately, in my (precious little) free time, I’ve been working on a custom shadow receiver system which will give me greater control over the appearance of…

Bit Flags are Pretty Cool

NOTE: This article is OLD! (From 2013!). Information in it may be out of date or outright useless, and I have no plans on updating it. Beware! I’ve been working on prototype for (possibly) my next personal project, and one of the things I’ve needed to do a number of times is store a lot of boolean attributes on different objects. This led to some really terrible looking scripts with a whole host…

Fun With The Kinect

NOTE: This article is OLD! (From 2013!). Information in it may be out of date or outright useless, and I have no plans to update it. Beware! I’ve been playing around with the Kinect this month (I love that thing). I’ve used it in the past with some gesture control and image processing at work, but I hadn’t really considered it as an option for gamedev, mostly because I don’t have an xbox sdk. I’ve…

Unbreaking the Xcode templates in Xcode 4.5

NOTE: This article is OLD! (From 2012!). Information in it may be out of date or outright useless, and I have no plans to update it. Beware! The Xcode templates that come with Ogre 1.81 are rather frustrating to get working, especially if you don’t know what the cryptic error messages that it spits out at you mean. So I’m here today to walk you step by step through getting a basic Ogre project up…

Building Ogre 1.81 on Lion

NOTE: This article is OLD! (From 2012!). Information in it may be out of date or outright useless, and I have no plans to update it. Beware! I’ve recently decided that I need to go open source for my hobby projects, namely because I’ve reached a point where Unity Free is becoming too restrictive for my tastes, yet I’m still too poor to buy Unity Pro (one day I’ll make a game that pays for more…