// 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 //--------------------------------------------------------------------------- // HDRScene_SampleAvgLum.nsf // Implements all the techniques necessary to perform "HDR Lighting". // 1) Average scene luminance calculation // 2) Bright-pass filtering // 3) "Bloom" operations (via downsizing/gauss blurring) // 4) Final scene compositing // // Based directly on concepts from the Microsoft DirectX9 SDK "HDR Lighting" // sample. // //--------------------------------------------------------------------------- NSFShader HDRScene_SampleAvgLum { Global_Attributes { Attrib_Point2 gakSampleOffsets[16] Hidden 0.0,0.0 } PackingDef packing { PD_Stream 0 PDP_Position 0 PDT_Float3 PDP_TexCoord0 7 PDT_Float2 } Implementation HLSL_VS20_PS20 { "This implementation requires hardware that supports vertex shader v2.0 and pixel shader v2.0" Requirements { Platform = DX9|XENON VSVersion = v2.0 PSVersion = v2.0 UserVersion = v0.0 UsesNIRenderState = true UsesNILightState = false } PackingDef packing RenderStates { Lighting = false } Pass Single_Pass { VSProgram "HDRScene.hlsl" VSMain vs_2_0 PSProgram "HDRScene.hlsl" SampleLumInitial ps_2_0 VS_Constantmap { CM_Defined WorldViewProj WorldViewProj 0 } PS_Constantmap { CM_Global gakSampleOffsets 0 0 } Sampler 0 BaseLinearClampSampler { TSS_Texture = NTM_Base TSAMP_AddressU = TADDR_Clamp TSAMP_AddressV = TADDR_Clamp TSAMP_AddressW = TADDR_Clamp TSAMP_MagFilter = TEXF_Linear TSAMP_MinFilter = TEXF_Linear TSAMP_MipFilter = TEXF_Linear } } } Implementation PS3CG { "This is a Cg implementation compatible with PS3" Requirements { Platform = PS3 UsesNIRenderState = true UsesNILightState = false } PackingDef packing RenderStates { Lighting = false } Pass Single_Pass { VSProgram "HDRScene_SampleAvgLum.cg" vmain vs_2_0 PSProgram "HDRScene_SampleAvgLum.cg" fmain ps_2_0 VS_Constantmap { CM_Defined WorldViewProj WorldViewProj 0 } PS_Constantmap { CM_Global gakSampleOffsets 0 0 } Sampler 0 BaseLinearClampSampler { TSS_Texture = NTM_Base TSAMP_AddressU = TADDR_Clamp TSAMP_AddressV = TADDR_Clamp TSAMP_AddressW = TADDR_Clamp TSAMP_MagFilter = TEXF_Linear TSAMP_MinFilter = TEXF_Linear TSAMP_MipFilter = TEXF_None } } } }