Tag: shader

Early thoughts on Shader Graph

I’ve started working a bit with the new Shader Graph in Unity (mostly because I’ve started using URP) so I just want to share some early observations. TL;DR I’m a bit leery of Shader Graph right now and am finding I’d rather just write the shaders manually as I have been.

Continue reading “Early thoughts on Shader Graph”

Transparency with Depth Sorting

A classic rendering problem in realtime 3D graphics is overlapping transparent surfaces. Well, I recently wrote a shader for Unity that renders alpha transparency with correct depth sorting. My solution isn’t unique, but I don’t see a lot of people talking about it, so hopefully this will help people out.

The depth sorting in this shader still only works well for hard-edged cutouts, but you can mix cutouts with smooth semi-transparency in the alpha channel, and any rendering glitches will be restricted to only the semi-transparent parts. This is a huge improvement over having those rendering glitches apply to the entire model, and hopefully my explanations give you a full appreciation for the tradeoffs being made.

Continue reading “Transparency with Depth Sorting”

Working on an RPG: Generating the Map

I’m now over a month into the basic RPG I mentioned in the last post, so a bunch of systems are in place. In my last post I talked a lot about the narrative system Ink, but this time I want to get back to what is a frequent topic on my devlog: procedural generation of maps. Here is what I came up with for the map of city regions:

rpg-regions-map

(The weird batches of horizontal lines are actually lines of text. That’s just to test applying textures to quads strewn about the map, and will eventually be replaced with images of buildings and trees.)

Continue reading “Working on an RPG: Generating the Map”

Outline Both Squares and Hexes

So I’ve been experimenting a lot lately with rendering lines on the ground, for the map in strategy and tactics games. Last post I already had this effect working for a square grid, but it wouldn’t work for hex grids because it was dependent on drawing pixels to match the grid. I ended that post by brainstorming ways to support hex grids, and have had great success working on the problem since then.

I uploaded a WebGL demo to try, and here’s a video showing the territory outlines shader working on both square and hex grids:

Continue reading “Outline Both Squares and Hexes”

Shader that renders Border Outlines

Merry Almost-Christmas! I normally do a blog post every month on the 25th, but I wanted to do this one a few days before then because of the holidays.

Last month I had described my plan to render border lines on the ground (think territory in a strategy game, or movement ranges for tactics games). Here’s an image showing the result of my experimentation:

8 inner-fade

Hey, looks pretty good if I do say so myself! That’s a smoothly glowing outline drawn on the ground, surrounding a discrete region of a square grid, with the outline nicely rounded at the corners.

Continue reading “Shader that renders Border Outlines”

Border Lines on a Strategy Map

Happy Thanksgiving!

A couple months ago I was noodling on techniques for displaying the map in a strategy or tactics game. Well, lately I’ve been thinking a lot about one specific aspect of how those maps work: representing borders on the map.

I’m talking about the colored lines on the ground in this screenshot:

Continue reading “Border Lines on a Strategy Map”

Terrain from a Convex Hull and Triplanar Mapping

As I pointed out last month, I’m putting my personal projects on a hiatus for a while. Instead, I’m going to talk a bit about interesting game dev and graphics stuff that’s come up at work. Naturally I can’t blab too many details about our internal projects at PEAK6, but I do want to point out some of the publicly available technologies and/or resources.

The project I’m currently working on has involved a witch’s brew of proc gen techniques. I want to focus on two in particular: convex hulls, and triplanar mapping.

Continue reading “Terrain from a Convex Hull and Triplanar Mapping”