website templates

Shogun3D's Coding Page

Welcome to blueshogun96 AKA Shogun3D's coding page!

Unfortunately, I lost the majority of my Direct3D and OpenGL code samples in a fairly recent hard drive failure! I have to spend time writing some new samples and what not, as well as gather any other samples I have laying around scattered throughout other hard drives.

Right now, I'm trying to reclaim the work I have lost and write even better and more exciting code!

Bump Refraction

  1. Platform(s): Windows
  2. Language: C++
  3. APIs: Direct3D9
  4. Developent Time: About a week

This is one of my favourite GPU effects! I found it in the old NVSDK and I wanted to preserve the effect by porting it to use Direct3D9. I had to rewrite parts of the vertex/pixel shaders in order for it to work. I should have rewritten the entire shaders to use HLSL instead of the old assembly vertex/pixel shaders (maybe I'll do that later). There are a few other enhancements such as proper texture filtering on the appropirate texture stages and NVPerfHUD detection code.

If you download this source package, you'll notice that there are two .exe files, one with NVHS in the filename, and one without. For those who don't know, NVIDIA had created a handful of customized texture formats (encodable via FOURCC). The NVHS texture format is a special bumpmap texture format that allows NVIDIA users to have bumpmap textures with 16-bits per component instead of 8-bits while using D3DFMT_Q8W8V8U8. I personally haven't seen any visual differences personally. This texture format is only supported on early GeForce Ti cards (3 and 4, IIRC), but that's not why I made 2 seperate .exe files. For some NVIDIA users, the driver will claim to support this texture format by successfully creating any textures using it. When this happens, the effect doesn't work properly and just looks flat. Therefore I created 2 .exe files to guarantee you can see the texture effect in action.