Game Development Community

dev|Pro Game Development Curriculum

Adding sun specularity to TSE water

by Matt Vitelli · 07/11/2006 (12:03 pm) · 6 comments

Find shaders/water/waterCubeReflectRefractP.hlsl about line 108 or so find a line that reads
// 2:  This almost looks good
   /*
   bumpNorm.xy *= 2.0;
   bumpNorm = normalize( bumpNorm );

   float3 halfAng = normalize( eyeVec + IN.lightVec );
   float specular = saturate( dot( bumpNorm, halfAng) );
   specular = pow(specular, specularPower);
   OUT.col += specularColor * specular;
   */


Now either uncomment or replace it with:

// 2:  This almost looks good
   
   bumpNorm.xy *= 2.0;
   bumpNorm = normalize( bumpNorm );

   float3 halfAng = normalize( eyeVec + IN.lightVec );
   float specular = saturate( dot( bumpNorm, halfAng) );
   specular = pow(specular, specularPower);
   OUT.col += specularColor * specular;

This looks pretty neat in my opinion.

Enjoy!

-Matt Vitelli

#1
07/11/2006 (12:17 pm)
sweet! thanks.
#2
07/11/2006 (2:08 pm)
I dont see the difference.
#3
07/11/2006 (2:09 pm)
Ahh, missed the quotes.
#4
07/11/2006 (8:37 pm)
Yeah, instead of "And replace it with:" you could have just said "uncomment it." :P
#5
07/15/2006 (3:50 pm)
I mainly did it for speed. Some people just like to copy in code rather than take the time to edit. Though the edit only takes a few seconds. :P
#6
07/25/2006 (8:57 pm)
If they can't uncomment something, they shouldn't be editing it ;) Nevertheless, this is a great find =)