Gemi Games

Indie Games Developer

Pixel Shaders FTW

4 Comments

Ah pixel shaders.  I am by no means an expert on them but what you can do with them is only really limited to your imagination and your math ability.  They can do anything from simple things such as adjusting the colours of a scene to complex algorithms for normal mapped refractions through liquids.  Once I basically understood how to use this powerful tool, I quickly realised how much I didn’t know about them and what a huge world of weird and wonderful effects pixel shaders hold.
Pixel shaders (and graphics programming in general) are still relatively new to me.  I entered into game design from a level editing background where I use to spend countless hours in front of Unreal Tournament’s editor creating arenas for me to fight against bots or for the far too occasional lan set up with a few friends.  After numerous attempts at trying to actually finish a full map, it wasn’t until Portal 1 came out before I managed to release my first full map, turned map pack, into the wild.

I loved the simple, clean, pureness that embodies the gameplay in Portal and how you had to think very differently in designing a Portal map than say a Doom, UT or any other game map for that matter.  As far back as I can remember I’ve always wanted to make games and I use to naively think that making a game was just about laying the core gameplay, graphics and make a bunch of levels.  After creating a short demo platformer and many small prototypes I have come to discover that making a game is a vast undertaking involving so many different areas from other entertainment mediums.  Now however, the time is right to undertake that task of fully realising a video game for a proper release on the PC and a console (Xbox 360).

Anyway now to some meat and potatoes 🙂  I’ve slightly changed the blur shader applied to light shadows to achieve a much smoother effect with very little extra computational work.  The problem before was that after blurring horizontally I didn’t input the result into the vertical blur pass and this give the shadows a few strange characteristics.

Below shows before and after:

comparison_amount2

Blur amount = 2

comparison_amount4

Blur amount = 4

The result is a much smoother and more evenly distributed blur.  As you can see on the left examples, shadows whose angles are close to either axis receive very little blur and angles closer to diagonals get a pretty satisfactory blur.  This is all fixed now the horizontal pass correctly outputs its result to the vertical pass.

I also consolidated all the post processing effects into a single shader which allows the game to have different post processing effects simultaneously active at a time.  This would allow me to mix things up and create more varied levels.

Last but certainly not least is a new render pass for the graphics and that is overlay blended textures for the world tile layers.  As I said in my previous post, the world tiles have large and relatively boring coloured gradients and as such I’ve added the ability to display a large detailed texture onto the gradients to give the world a more solid feel and make the levels look a little more interesting.  I’ve played around with a few different textures and added the feature into the editor as well as a slider to control how strong the overlay is.  Here’s what I got so far in before and after:

First Level Screenshot

Before

FirstOverlay

After

I’ve boosted the intensity of the lights a tad to give the sun rays more power but other than that I think the new overlay pass adds some nice detail where before it was a just a gradient.

Hope you like the new change and I promise I’ll have a gameplay video as soon as I can 🙂

Cheers.

Advertisements

4 thoughts on “Pixel Shaders FTW

  1. I agree, pixel shaders are great stuff. They add such dynamic continuity. Simplistic art becomes something much deeper when those sorts of effects are layered on correctly. Always made me wonder why Minecraft didn’t take advantage of shaders, since they add so much without taking away the integrity of the pixels underneath.

    Like

    • Yeh, it is strange Minecraft doesn’t have shaders at least by now. Even something simple like a colour correction would’ve been a nice touch. I’ve seen a mod floating around somewhere that adds some shadows and I think some other effects.

      I really liked your post Anyone Can Make Beautiful Games by the way. It’s made me aware that I should monitor my colours and sprites more closely. It’s also made me think about whether or not to keep the overlay effect on my game because I feel that it looks slightly odd compared to the clean style of the rest.

      I noticed your games each have a very complete and complementary look even though there not very complex and I was wondering if you have any thoughts about the graphics of mine good or bad?

      Like

      • I think what’s most important is that you decide on a theme and go with it. It looks like you’re aiming for a more minimal style but can’t decide exactly what that means. It’s definitely on its way, but I think it might need more focus.

        I would suggest you limit yourself to one or two specific things and then run with it. For instance, you could take away the detail in the trees, background, and ground objects and then coat them all in very strong texture (like the one you just posted). You could go the other way and get rid of all texture. Limit yourself. You’ll find a much stronger style that way.

        In my opinion the grassy texture you have on the basic green block is really stylized and interesting. I wonder what the game would be like if you limited your visual elements to basic shapes and colors and a texture which suggests the object but has that very 2D overlaid look.

        That said, I’m liking where it’s going so far. The shadows give the composition a nice contrast and the texture brings a lot of great repetition.

        Just some thoughts, take them or leave them 🙂 I’ll be interested to see where this goes.

        Ryan

        Like

      • Very helpful, thanks a lot Ryan. You made a lot of good points and make a lot of sense.

        I’ve experimented a bit on having a more focused look and I decided to strip down the graphics to its bare essentials + minimal detailing. I’m not skilled enough yet to flesh out the game with full detailing like grass, rocks etc… and get a nice cohesive whole. Anywhere within an acceptable timespan anyway 😀

        The object sprites that have remained will need some adjustments and I think I’ll play around with everything having consistent but irregular stroke lines and see how that goes.

        Anyway man, thanks again for your excellent advice and I look forward to more posts on your blog.

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s