Phong: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
Phong is a rendering technique introduced to the Source Engine with Half-Life 2: Episode One | Phong is a rendering technique introduced to the Source Engine with Half-Life 2: Episode One and looks best on a normal mapped model with some bit of specularity. | ||
__TOC__ | __TOC__ | ||
==VMT Parameters== | ==VMT Parameters== | ||
"$phong" "1" Enables Phong effect<br> | * "$phong" "1" Enables Phong effect<br> | ||
"$phongboost" "X" Increases the overall phong effect by X factor, default seems to be 1<br> | * "$phongboost" "X" Increases the overall phong effect by X factor, default seems to be 1<br> | ||
"$phongfresnelranges" "[1 3 | * "$phongfresnelranges" "[1 3 6]" higher numbers result in more visible highlights, but need clarification on its relation to rgb color<br> | ||
"$phongexponenttexture" " | * "$phongexponenttexture" "path/filename_exp.vmt"<br> Mask to determine where phong is applied on a texture, white = phong, black = none, unneeded if a normal map alpha channel is used. | ||
"$phongexponent" "1 | * "$phongexponent" "0" contrast, (0-1) higher = sharper phong. lower = smoother, Default 0 <br> | ||
"$phongalbedotint" "1"<br> | * "$phongalbedotint" "1" unknown, but commonly included<br> | ||
==Exponent Map== | ==Exponent Map== | ||
The Phong shader automatically uses the normal maps alpha channel if available to determine where to apply the phong effect, just as specular mapping with $normalmapenvmask does. However if you do not use a normal map alpha channel already you can save space by creating a simple exp map: A common technique would be to copy the main texture vtf to a new image, desaturate the image and then proceed to mask out areas with black for no shine, and darken those that need more subtle shine. When finished reduce the image size and save as a compressed texture with no alpha. You can afford to reduce the resolution and compress the exp texture: A scaled down 256^2 exp map is sufficient for a 1024^2 texture. | |||
==External Links== | |||
Since valve has offered no documentation a lot of this information can be credited to user experimentation and tutorials such as | |||
http://www.fpsbanana.com/tuts/1921 | |||
Hopefully this knowledge will continue to be expanded on, this is a wiki guys! | |||
<!--<br clear=all> | <!--<br clear=all> |
Revision as of 16:05, 4 December 2006
Phong is a rendering technique introduced to the Source Engine with Half-Life 2: Episode One and looks best on a normal mapped model with some bit of specularity.
VMT Parameters
- "$phong" "1" Enables Phong effect
- "$phongboost" "X" Increases the overall phong effect by X factor, default seems to be 1
- "$phongfresnelranges" "[1 3 6]" higher numbers result in more visible highlights, but need clarification on its relation to rgb color
- "$phongexponenttexture" "path/filename_exp.vmt"
Mask to determine where phong is applied on a texture, white = phong, black = none, unneeded if a normal map alpha channel is used. - "$phongexponent" "0" contrast, (0-1) higher = sharper phong. lower = smoother, Default 0
- "$phongalbedotint" "1" unknown, but commonly included
Exponent Map
The Phong shader automatically uses the normal maps alpha channel if available to determine where to apply the phong effect, just as specular mapping with $normalmapenvmask does. However if you do not use a normal map alpha channel already you can save space by creating a simple exp map: A common technique would be to copy the main texture vtf to a new image, desaturate the image and then proceed to mask out areas with black for no shine, and darken those that need more subtle shine. When finished reduce the image size and save as a compressed texture with no alpha. You can afford to reduce the resolution and compress the exp texture: A scaled down 256^2 exp map is sufficient for a 1024^2 texture.
External Links
Since valve has offered no documentation a lot of this information can be credited to user experimentation and tutorials such as http://www.fpsbanana.com/tuts/1921
Hopefully this knowledge will continue to be expanded on, this is a wiki guys!
This article is a stub. You can help by adding to it.