Traditional DirectX lighting models define ambient lighting as coming from all directions, and is added as a constant on all surfaces regardless of the geometry. Ambient occlusion acts as a factor to ambient lighting to take into account the cavities and concave areas in a model, or how much a surface is hidden from its environment.
StaticAmbientOcclusion.rar [6.8 Mb] – VB 2005 (VS.NET 2005)
Continue reading Static Ambient Occlusion
SkyGradient.rar [818kb] – VB 2005 (VS.NET 2005)
I had a request from the same MMORPG developer which asked me for Non-Reflective Water to make a simpler version of my old “HLSL Sky Demo”, which I haven’t put on my blog yet because I’m not all that proud of the code.
Basically, I was asked to copy Worlds Of Warcraft’s skies; so make a tweakable gradient-based day sky solution, that renders fast and looks good, and most importantly that behaves well in huge worlds with big height variations.
Continue reading Realtime Gradient Sky
Bloom.rar [10mb] – C# 2.0 (VS.NET 2005)
After seeing a couple of people using nVidia’s Bloom shader and be dissatisfied with its looks and perfomance, and more importantly because my employer asked me to do it, I made a Bloom shader from scratch.
It is highly customizable, supports FSAA and supports Pixel Shaders 2.0 up to 3.0.
Continue reading Bloom
TV3DProfiler.rar [49kb] – Visual Basic.NET 2005
You like the profiler in TV3D 6.5, but you’d like to do the same with your own application code? Hate the fact that what it reports is not tweakable or modifyable in any way? Here’s my own implementation of a profiler, which imitates the built-in one but has definable profiles and now categories, and is braindead-simple to use.
Continue reading Displayable Profiler
A follow-up to this article with clarifications and corrections to the “real-world considerations” can be found here.
I researched gaussian blur while trying to smooth my Variance Shadow Maps (for the Shadow Mapping sample) and made a pretty handy reference that some might like… I figure I’d post it for my first “Tips” blog post. :)
The full article contains a TV3D 6.5 sample with optimized Gaussian Blur and Downsampling shaders, and shows how to use them properly in TV3D. The article also contains an Excel reference sheet on how to calculate gaussian weights.
Update : I added a section about tap weight maximization (which gives an equal luminance to all blur modes) and optimal standard deviation calculation.
Continue reading Gaussian Blur Experiments
SoftStencils.rar [776Kb] – C# 2.0 (VS.NET 2005)
This demo demonstrates a technique that fellow forum user kTech proposed in the Beta Discussion forum to smooth otherwise hard stencil shadows. It uses screen-space blur of the shadow pass to smoothen things out.
Continue reading Soft Stencil Shadows
Both downloads are Visual Basic.NET 2005 projects.
Refraction.rar [408Kb] – Simpler first version
Refraction_v2.rar [665Kb] – Second version, now with backface rendering (double-sided refraction) and more test models
A specular-capable, normal-mapped, double-sided refraction shader that can be applied to pretty much any TVMesh, originally asked by forum user WEst.
Continue reading Double-Sided Bumped Refraction
NonReflectiveWater.rar [7.9Mb] – C# 2.0 (VS.NET 2005)
I had a request from a MMORPG developer to make a lightweight water shader that doesn’t need a reflection rendersurface, yet looks acceptable.
It looks nowhere as shiny as the reflective water shader or even TV’s built-in water, but it runs a zillion times faster because it doesn’t do any parallaxing, nor specular bumpmapping, nor perspective projection… Its implementation is alot simpler as well.
Continue reading Non-Reflective Water
HeightBasedLandscape.rar [152Kb] – C# 2.0 (VS.NET 2005)
A über-simple landscape shader that maps a color ramp to a landscape’s height. Basically, it demonstrates that shaders on landscapes is possible, and can be a nice addition to a visual landscape editor.
Continue reading Landscape Height-Based Coloring
HLSLBluePlanet.rar [8.9Mb] – C# 2.0 (VS.NET 2005)
This demo is the remake of an old 6.2 demo I had made to test materials and lighting. I was always decieved by that lack of proper bump-mapping in 6.2… so I remade it in 6.5 with custom shaders, very high-resolution textures and normal-maps, and even the moon!
Continue reading The Blue Planet