// EMERGENT GAME TECHNOLOGIES PROPRIETARY INFORMATION // // This software is supplied under the terms of a license agreement or // nondisclosure agreement with Emergent Game Technologies and may not // be copied or disclosed except in accordance with the terms of that // agreement. // // Copyright (c) 1996-2008 Emergent Game Technologies. // All Rights Reserved. // // Emergent Game Technologies, Chapel Hill, North Carolina 27517 // http://www.emergent.net ;LuminanceTransfer ;Take the diffuse color after modulating in the base map and compute the ;luminance. Use that value to make a dependent read of the transfer texture. ps_1_4 def c0, 0.299f, 0.587f, 0.114f, 1.0f texld r1, t1 ;sample base map texcrd r0.rgb, t0.rgb ;grab the color from t1 mul_sat r0.rgb, r0, r1 ;modulate base texture by VC dp3 r0, c0, r0 ;use dp3 to do luminance convert phase texld r0, r0 ;dependent lookup of the transfer ramp