Big Lebowski
n00b
- Joined
- Aug 9, 2004
- Messages
- 22
http://www.beyond3d.com/forum/viewtopic.php?t=14874&postdays=0&postorder=asc&start=220
I got a response from Carmack:
Quote:
Our specular function isn't a POW function, it matches the bias / scale calculations done on the NV10/NV20/R200 paths.
This of course explains why it doesn't look exactly the same. This is also a good thing. Now we don't even need to use a POW function, but we'll be fine with a MAD_SAT, which make it even faster. Got 21% boost in the timedemo with this. Now I still don't know exactly what exponent he's approximating, or if he's using different lookup tables for different materials, but I've tried this and it seems to look the same, but our fellow artifact hunters may want to verify that.
Code:
MAD_SAT R1, specular, 4.0, -3.0;
If that causes artifacts for someone, maybe approximating a lower exponent will do it:
Code:
MAD_SAT R1, specular, 3.0, -2.0;
------------------------------------------------------------------------------------------------------
http://www.beyond3d.com/forum/viewtopic.php?t=14874&postdays=0&postorder=asc&start=220
I've tuned it a bit more to try to get exactly the same output as the original shader, and come to the conclusion that this is pretty darn close even when comparing screenshots.
Code:
MAD_SAT R1, specular, 5.0, -4.0;
So I've put that into the tweak file:
http://esprit.campus.luth.se/~humus/temp/doom3PerformanceTweak.rar
Comparison shots:
With tweak:
http://esprit.campus.luth.se/~humus/temp/shot00017.jpg
Without tweak:
http://esprit.campus.luth.se/~humus/temp/shot00018.jpg
High-res .png files (1MB+):
http://esprit.campus.luth.se/~humus/temp/shot00017.png
http://esprit.campus.luth.se/~humus/temp/shot00018.png
I got a response from Carmack:
Quote:
Our specular function isn't a POW function, it matches the bias / scale calculations done on the NV10/NV20/R200 paths.
This of course explains why it doesn't look exactly the same. This is also a good thing. Now we don't even need to use a POW function, but we'll be fine with a MAD_SAT, which make it even faster. Got 21% boost in the timedemo with this. Now I still don't know exactly what exponent he's approximating, or if he's using different lookup tables for different materials, but I've tried this and it seems to look the same, but our fellow artifact hunters may want to verify that.
Code:
MAD_SAT R1, specular, 4.0, -3.0;
If that causes artifacts for someone, maybe approximating a lower exponent will do it:
Code:
MAD_SAT R1, specular, 3.0, -2.0;
------------------------------------------------------------------------------------------------------
http://www.beyond3d.com/forum/viewtopic.php?t=14874&postdays=0&postorder=asc&start=220
I've tuned it a bit more to try to get exactly the same output as the original shader, and come to the conclusion that this is pretty darn close even when comparing screenshots.
Code:
MAD_SAT R1, specular, 5.0, -4.0;
So I've put that into the tweak file:
http://esprit.campus.luth.se/~humus/temp/doom3PerformanceTweak.rar
Comparison shots:
With tweak:
http://esprit.campus.luth.se/~humus/temp/shot00017.jpg
Without tweak:
http://esprit.campus.luth.se/~humus/temp/shot00018.jpg
High-res .png files (1MB+):
http://esprit.campus.luth.se/~humus/temp/shot00017.png
http://esprit.campus.luth.se/~humus/temp/shot00018.png