Thread: DirectX Shaders
View Single Post
Old 30-11-2008, 02:02 AM   #36
Buzzy
Quadcore
 
Buzzy's Avatar
 
 
Join Date: Nov 2004
Location: Pittsburgh
Posts: 1,416
Thanks: 3
Thanked 29 Times in 25 Posts
Awards Showcase
Threedy Top Poster - Silver: Contributing to the forums with 1,000+ posts - Issue reason: Target reached! Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! The Golden Eye: Producing art worthy of being linked from the frontpage of either forums or 3DTotal.com - Issue reason: 'Bronze Age Barbarian' was linked from the frontpage! The Golden Eye: Producing art worthy of being linked from the frontpage of either forums or 3DTotal.com - Issue reason: Art work was linked from the frontpage! The Golden Eye: Producing art worthy of being linked from the frontpage of either forums or 3DTotal.com - Issue reason: Starlet thread was linked from the frontpage! The Golden Eye: Producing art worthy of being linked from the frontpage of either forums or 3DTotal.com - Issue reason: DomWar4 work was linked from the frontpage! The Golden Grenade IV: For participating in the Dominance War IV and successfully finishing, well done soldier! - Issue reason: For participating in the Dominance War IV and successfully finishing, well done soldier! Thumbs up!:  - Issue reason: For doing a great job in helping out! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! Low Poly Game Art - Silver: 2nd place in low poly challenge! - Issue reason: 2nd place in low poly challenge! Low Poly Game Art - Bronze: 3rd place in a low poly challenge! - Issue reason: 3rd place in a low poly challenge 
Total Awards: 11
Ok, I got a solid reflection shader working. It required me to come up with completely new math for alot of things, but its working well so far.

Shader_Donze_Env.fx

Shader_Donze_Env_NoShadows.fx

There is one interesting new feature to be aware of - I have set this up so that the alpha channel of the normal map is a used as a reflectivity map. So, by painting parts of the normal map alpha darker, you can mask out the reflections.

You may be wondering why I keep using all of these alpha channels for this stuff rather than just having separate maps. Well, by using an alpha channel, you can fit this info into a pre-exsisting map rather than have a whole new map. This helps performance for two reasons. First, fewer maps means less memory required. Additionally, when you have extra maps, the GPU has to read information from each of those maps which takes time, slowing framerate. Its pretty standard in the industry to try and cram as much info in as few maps as possible.
Buzzy is offline   Reply With Quote