Latest ArticlesEngine Architecture #1
Static Shadows #1
Paint on Mesh
A Tale of the Internet
Displacement Shader Jul 30, 2006
I've decided to begin posting some documentation for Kingdoms Creator on this web site. I haven't done this before since it's not a public program, so there really isn't any strong reason for me to do so. But because there is a chance I might need to someday, I figured the sooner the better. I'm starting with the 3DKC Displacement Pixel Shader Doc. The page includes a screenshot of the shader results and the input maps.
If you're designing a program, using other similar programs or reading about how other similar programs work can be quite helpful. I actually haven't used a game editor other than my own in a long time ( I probably should ), but sometimes I look through online documentation. For example maybe I see a few engines that allow you to color code level chunks and objects by how many lights hit them to help you optimize the level. That sounds like a good idea, and is not too hard to implement, so I add it to my debug options. So I guess what I'm trying to say is this article is mainly me trying to pass off a link to the 3DKC documentation as a tutorial =)
Displacement Pixel Shader TypesThere are lots of terms used for pixel shaders in this family. Off the top of my head I can think of Per-Pixel Displacement, Virtual Displacement Mapping, Relief Mapping, Parallax Mapping, and Parallax Occlusion Mapping. As far as I know there's no general agreement on *exactly* what many of these mean. One big difference between shaders in this family is whether or not they support occlusion. By my definitions Parallax Mapping is the only one that I'd assume doesn't. On the rendering page for 3DKC, I first named my shader Virtual Displacement mapping, but then I changed the name to Parallax Occlusion Mapping, just to put occlusion in the name. (Displacement shader could also refer to displacing the actual geometry instead of just the texture coordinates, but I'm not using it that way in this article.)
Quality can also differ, within a single shader as well as between different methods, but generally higher quality means a slower shader. For a little demo you can use very high-quality, and even support self-shadowing( which I haven't tried. ) But for a full game, especially if the target lights-per-surface is high, speed is more important.
Link3DKC Displacement Pixel Shader Doc