//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // //===========================================================================// #include "tier0/platform.h" #include "tier0/progressbar.h" #include "bitmap/float_bm.h" #include "mathlib/mathlib.h" #include "tier1/strtools.h" #include "tier2/tier2.h" #include "tier0/memdbgon.h" static float RangeAdjust( float x ) { return (2*(x-.5)); } static float saturate_and_square( float x ) { x=max(0.f,min(1.f, x) ); return x * x; } #define OO_SQRT_3 0.57735025882720947f static Vector bumpBasis[3] = { Vector( 0.81649661064147949f, 0.0f, OO_SQRT_3 ), Vector( -0.40824833512306213f, 0.70710676908493042f, OO_SQRT_3 ), Vector( -0.40824821591377258f, -0.7071068286895752f, OO_SQRT_3 ) }; void main(int argc,char **argv) { InitCommandLineProgram( argc, argv ); if (argc != 2) { printf("format is 'normal2ssbump filename.tga\n"); } else { ReportProgress( "reading src texture",0,0 ); FloatBitMap_t src_texture(argv[1]); for(int y=0;y