Worklog for Gabriel

HLSL Shader Pack

Return to Worklogs

Finishing Up Packs 1 and 2(Posted 2006-12-09)
I think I've basically got enough shaders for Packs 1 and 2 now. I now need to tidy them up, check for any more optimizations I can make, package them up, finish up the website, setup a forum and I'm done. Or at least, I'm done to the point where I can begin, if that makes sense.

There will still be more to do, but that's the basics out of the way. I can then begin work on some more demos, some better screenshots for the site, tutorials, all that sort of thing.

Hopefully I can get to the first milestone by the end of the weekend, but that depends how much time I have available. We'll see.

Star Sentinel Tactics
Shades of Violet
TV3D Module

Slowing Down(Posted 2006-12-07)
Progress has slowed as I've not been very well and I've had a lot of other things on as well.

Today I did manage to spend a couple of hours reading up on texture splatting, and I've written a shader which implements two layer texture splatting. I should now be able to go on and write shaders to do three and four layer splatting with ease. I'm not sure if I'll go beyond four layers. Perhaps for another pack, but I think for the basics pack, it's probably overkill.

Also banged out some simple shaders to do blending operations. Just simple stuff, but people will want them. So just your ordinary lightmap, shadowmap, add, subtract, Mod4X, Mod2X, with multiple UV options. All working nicely.

Star Sentinel Tactics
Shades of Violet
TV3D Module

Shader Scene Screen(Posted 2006-12-03)
The website really needed some pictures which do a bit more than show some cubes. Now they're nice cubes, and they're bumped and lit beautifully even if I do say so myself, but they're still cubes.

This one is a bit more like it. Normal mapping ( with specular highlights ) on the marine. Parallax mapping ( with specular ) on the environment and a holographic reflection shader on the creature sneaking up on the marine.



Star Sentinel Tactics
Shades of Violet
TV3D Module

Web Design..Bleh(Posted 2006-12-02)
Spent all of today working on the site design. When I've got these shaders complete, I'll need somewhere to put them. The site design looks good, but it needs more work. Specifically it needs some sample images from the shader pack, but I can do that soon. It doesn't need a ton of content, so it's a good start. It could definitely use a forum, but I'll have a go at setting up SMF tomorrow, and adding a theme to make it look similar to the site.

As for the the shaders, I'm slowing down in ideas now. I've added some for reflections, some for holograms, some for basic texture blending, landscape. I'll probably add some shaders for metal, glass and water before I'm done.

Beyond that, I'm not sure. Perhaps procedural texture shaders? I'm not sure how popular those would be. Procedural normal maps might be interesting. They'd be gimmicky though, not the most useful of shaders. I think a few more and I'll have enough for the first two packs, and that'll do for now.

Then I just have to put together some better demos. I'm already working on getting some better media. You can only go so far with a normal-mapped cube. Sure it's a damn fine looking cube with sexy normal-mapping, per-pixel lighting and specular highlights, but it's still a damn cube.

So yeah, finish the site, better demos, more screenshots, a few more shaders, a forum, tons of promotion.. Guess I won't be getting the weekend off.

Star Sentinel Tactics
Shades of Violet
TV3D Module

Something Special Now(Posted 2006-12-01)
I finally got up the nerve to try my hand at one of the "special" shaders I had in mind to do, and it was surprisingly easy. I'm not sure why I thought it would be hard, but you don't see people doing it much so I thought it might be deceptively difficult to get working, but nope.

As far as I can make out, this is generally referred to as detail normal mapping. At a distance, it looks pretty much like a standard normal mapping shader, right?



Except there appear to be a few bumpy spots that weren't there before, right? Well let's zoom in and take a closer look.



Yes, it's using TWO normal maps ( and two diffuse maps, for that matter. ) The second normal map is tiled X ( you choose ) number of times over the top of the standard normal map, allowing you to use a detail normal map, just as you would use a detail texture to add detail to environment and landscape textures.

Of course, it has options for specular and attenuation and 1-4 lights, just like the others. I'm pretty happy with these special additions.

By the way, all the funky rainbow colors are just to show the effects, they're not mandatory. It actually looks much sexier if you use more standard colors, but it's not as obvious how many light sources you've got or where they are.

Star Sentinel Tactics
Shades of Violet
TV3D Module

WIP Screenshot(Posted 2006-11-30)
Ok, I changed my mind. Here's a screeny of a very basic normal mapping shader. The parallax mapping and the top-secret experimental one both look better and bumpier than this, but I still think this one looks pretty bumpy. Three light sources plus specular highlights on this shader. Light attenutation too.



Star Sentinel Tactics
Shades of Violet
TV3D Module

Environment Bumpmapping(Posted 2006-11-30)
I've added another five shaders for environment bumpmapping today. They essentially reflect a cubemap on your mesh, but distort the reflection using a normal map to create a sort of smoked glass effect. You can use either a static or dynamic cube map, the choice is yours. There are four to allow blending options with a base texture, and also to blend between two layers using vertex alpha.

I've also written a couple of shaders for terrains, and a couple more general purpose blending shaders. I haven't yet decided how to structure the pack(s) but I'm thinking that theming them might be more useful for the customers. Perhaps a general purpose pack with blending shaders, some simple material shaders for metals and things, and probably some water shaders since those are always popular. And then perhaps have a bumpmapping pack ( including normal, parallax and something a bit special, as well as environment bump mapping ) after that, and then perhaps some more specialized ones after that.

I might try my hand at scene/post processing shaders as well, but those are more difficult to make generic as they can be hard to fit into an unfamiliar engine. Simple ones like sepia post processing or desaturation are easy, but anything involving multiple passes like motion blue, depth of field and bloom/HDR can be very difficult for beginngers to work with. You have multiple render surfaces and those rendersurfaces can require obscure formats, and it just gets really out of hand very easily.

I'll get around to posting some screenshots soon. I'm just wanting to get as much done as I can at the moment. It's all looking very sexy though :P

Star Sentinel Tactics
Shades of Violet
TV3D Module

Parallax Mapping Too(Posted 2006-11-29)
Parallax mapping surprised me in two ways. Firstly, be being a significant improvement over normal mapping. It really does make you think you've got real geometry there, even when you wrote the shader yourself. Secondly, by being pretty easy to implement. I've got it working just like normal mapping, so all the same variations and customizations will be available.

Next? Dunno.. reflections maybe? Or terrain shaders? I'll see how I feel tomorrow. I have work commitments for the rest of today.

Star Sentinel Tactics
Shades of Violet
TV3D Module

Sixteen Normal Mapping Shaders(Posted 2006-11-28)
Ok, I've completed sixteen normal mapping shaders. I decided not to add another sixteen shaders just to use a different set of UV coordinates. It's really very easy to do if you want to, and if there's interest in the pack but people want the UV coordinate option, I can maybe write another sixteen normal mapping shaders for a second pack of shaders.

Each of the normal mapping shaders has as many tweakables as possible. You can, firstly, set your diffuse color. This is really the base color of the mesh. Like if you were using EntityColor, and how that effects textures. If you're using one of the eight shaders which also gives you specular highlights ( which looks very cool and gives that shiny metallic look which has become almost synonymous with normal mapping ) then you can also set your specular color. So even if you have a red light and a blue light, you can have green-tinted specular highlights if you want. This enables some very cool effects.

Of course, your lights can be specific ( either through shader semantics or manually passing values ) and both their position and color can be set. Being able to set the color is vital with multiple light sources, as you only really get the really sexy looking effects if you have different colored light sources. But they can be the same if you're boring. Your choice.

You can, of course, also set the light decay rate for the eight shaders which have light attenuation. This affects how fast ( or slow ) the light decays. This is nice for indoor environments where you want your lights to behave as point lights. For outdoor environments, you will probably want to use the shaders without light attenuation, where the lights effectively behave as infinite range light sources.

And, of course, you can set your diffuse ( base color ) and normal map textures. The old favourite cobblestone is the one I've been testing with and it really does have a deep bumpy effect, even if I do say so myself.

I guess I'll have a look at parallax mapping now. I always thought parallax mapping was a lot better than normal mapping, but now that I have the normal mapping working, it looks almost as good as the best parallax mapping I've seen. Perhaps I'll surprise myself with the parallax mapping too?

Star Sentinel Tactics
Shades of Violet
TV3D Module

Normal Mapping Shaders(Posted 2006-11-28)
It's already apparent that there are lots of different variations on even a basic shader, and it's hard to predict exactly what people will want.

For normal mapping, a popular one and no mistake, I'm going with one to four lights, basic normal mapping, so thats four shaders. Then another four which include light attenuation ( point lights as opposed to infinite lights ) and then another eight to repeat all that with specular highlights for each lightsource. So that's 16 shaders just for normal mapping. Ouch!

Then perhaps people might want to use different UV channels for the diffuse and normal map. If I include that for all variations, we're up to 32 shaders. Double ouch!

I suppose I don't *have* to cover all these variations, but if you're the type of guy who wants to buy a pack of shaders instead of coding your own, you don't want to have to mess with the code much, do you?

Hopefully some of the other shaders won't require so many variations.

Star Sentinel Tactics
Shades of Violet
TV3D Module