Starting program: /home/lucas/projects/planeshift/psclient --verbose [Thread debugging using libthread_db enabled] [New Thread 0x7ffff63a4710 (LWP 9240)] [New Thread 0x7ffff5ba3710 (LWP 9241)] Traceback (most recent call last): File "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.2200.3-gdb.py", line 9, in from gobject import register File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in import gdb.backtrace ImportError: No module named backtrace [New Thread 0x7fffdfba8710 (LWP 9242)] [New Thread 0x7fffdf186710 (LWP 9243)] Program received signal SIGSEGV, Segmentation fault. 0x00007ffff683dbd2 in strlen () from /lib/libc.so.6 #0 0x00007ffff683dbd2 in strlen () from /lib/libc.so.6 #1 0x00007ffff68063cc in vfprintf () from /lib/libc.so.6 #2 0x00007ffff68a7049 in __vsnprintf_chk () from /lib/libc.so.6 #3 0x00007fffde69cab9 in vsnprintf (fmt=0x7fffde730725 "line %u, char %u: error: %s\n") from /usr/lib64/dri/r300_dri.so #4 make_error_string (fmt=0x7fffde730725 "line %u, char %u: error: %s\n") at program_parse.y:2612 #5 0x00007fffde69cb51 in yyerror (locp=0x7fffffff22fc, state=0x7fffffff6cb0, s=0x7fffde731a78 "invalid texture image unit selector") from /usr/lib64/dri/r300_dri.so #6 0x00007fffde6a052d in yyparse (state=0x7fffffff6cb0) from /usr/lib64/dri/r300_dri.so #7 0x00007fffde6a0bb2 in _mesa_parse_arb_program (ctx=0xd498e0, target=34820, str=0x2b2b120 "!!ARBfp1.0\n# cgc version 2.2.0010, build date Sep 29 2009\n# command line args: -q -profile arbfp1 -entry fragmentMain -O3 -DPROFILE_ARBFP1 -DVERT_PROFILE_ARBVP1 -DFRAG_PROFILE_ARBFP1 -DFRAGMENT_PROGRA"..., len=11122, state=0x7fffffff6cb0) from /usr/lib64/dri/r300_dri.so #8 0x00007fffde69c066 in _mesa_parse_arb_fragment_program (ctx=0xd498e0, target=, str=0x2b2b120, len=11122, program=0x2b03d40) at shader/arbprogparse.c:83 #9 0x00007fffde5df06b in _mesa_ProgramStringARB (target=34820, format=, len=11122, string=0x2b2b120) at shader/arbprogram.c:475 #10 0x00007fffe703d97d in ?? () from /opt/nvidia-cg-toolkit/lib/libCgGL.so #11 0x00007fffe701ac42 in ?? () from /opt/nvidia-cg-toolkit/lib/libCgGL.so #12 0x00007fffe701dca2 in cgGLLoadProgram () from /opt/nvidia-cg-toolkit/lib/libCgGL.so #13 0x00007fffe71db383 in CS::Plugin::GLShaderCg::csShaderGLCGCommon::DefaultLoadProgram (this=0x7fffd64621a8, cgResolve=, programStr=0x2b1aa70 "#define PARAM__clip_out_packed_distances1_UNUSED\n#define PARAM_vertexToFragment_color_dir3_5_UNUSED\n#define PARAM_vertexToFragment_Normal_1_UNUSED\n#define PARAM_vertexToFragment_litColor_6_UNUSED\n#def"..., _type=, customLimitsPair=, flags=) at /home/lucas/projects/cs/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cgcommon.cpp:346 #14 0x00007fffe71c1838 in CS::Plugin::GLShaderCg::csShaderGLCGFP::TryCompile (this=0x7fffd64621a8, loadFlags=5, limits=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cgfp.cpp:251 #15 0x00007fffe71c363d in CS::Plugin::GLShaderCg::csShaderGLCGFP::Compile (this=0x7fffd64621a8, cache=0x7fffca907548, tag=0x7fffffffbac0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cgfp.cpp:113 #16 0x00007fffe86f3a3d in CS::Plugin::XMLShader::csXMLShaderTech::LoadProgram (this=, resolve=0x0, node=, variant=, cacheTo=0x7fffca907548, cacheInfo=..., tag=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shadertech.cpp:1346 #17 0x00007fffe86fa096 in CS::Plugin::XMLShader::csXMLShaderTech::LoadPass (this=0x24299f0, node=0x7fffcac6c350, pass=0x7fffcab7a4b0, variant=3449, cacheFile=0x7fffd6fa1368, cacheTo=0x7fffca90dbb0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shadertech.cpp:210 #18 0x00007fffe86fb79f in CS::Plugin::XMLShader::csXMLShaderTech::Load (this=0x24299f0, ldr_context=, node=0x7fffcab69f00, parentSV=, variant=3449, cacheTo=0x7fffca90dbb0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shadertech.cpp:1630 #19 0x00007fffe870c571 in CS::Plugin::XMLShader::csXMLShader::GetTicketForTech (this=0x7fffcab6b400, modes=, stack=, eval=, lightCount=, techNum=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1368 #20 0x00007fffe870cab4 in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffcab6b400, modes=..., stack=..., eval=0x7fffca90d978, lightCount=0, tvi=2) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1414 #21 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffcab6b400, modes=..., stack=..., eval=0x7fffca90d978) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #22 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffcab6b400, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #23 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffd67ad3f0, modes=..., stack=..., eval=0x7fffcad62d48, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #24 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffd67ad3f0, modes=..., stack=..., eval=0x7fffcad62d48) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #25 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffd67ad3f0, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #26 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffd77d1988, modes=..., stack=..., eval=0x7fffd6f9f888, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #27 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffd77d1988, modes=..., stack=..., eval=0x7fffd6f9f888) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #28 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffd77d1988, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #29 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffd6463a38, modes=..., stack=..., eval=0x7fffd64659b8, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #30 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffd6463a38, modes=..., stack=..., eval=0x7fffd64659b8) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #31 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffd6463a38, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #32 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffd6963170, modes=..., stack=..., eval=0x7fffd64607a8, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #33 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffd6963170, modes=..., stack=..., eval=0x7fffd64607a8) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #34 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffd6963170, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #35 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffe76d7f48, modes=..., stack=..., eval=0x7fffe76db970, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #36 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffe76d7f48, modes=..., stack=..., eval=0x7fffe76db970) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #37 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffe76d7f48, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #38 0x00007fffdda42329 in void CS::RenderManager::ForEachMeshNode::ContextNode, CS::Meta::CompositeFunctorType2, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers>, CS::RenderManager::ShaderSVSetup, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers> > >(CS::RenderManager::RenderTree::ContextNode&, CS::Meta::CompositeFunctorType2, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers>, CS::RenderManager::ShaderSVSetup, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers> >&) () from /home/lucas/projects/cs/rm_unshadowed.so #39 0x00007fffdda4fa42 in void CS::RenderManager::SetupStandardTicket::ContextNode, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers>(CS::RenderManager::RenderTree::ContextNode&, iShaderManager*, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers const&) () from /home/lucas/projects/cs/rm_unshadowed.so #40 0x00007fffdda5c0ac in CS::Plugin::RMUnshadowed::StandardContextSetup, CS::RenderManager::MultipleRenderLayer>::operator()(CS::RenderManager::RenderTree::ContextNode&, CS::RenderManager::StandardPortalSetup, CS::Plugin::RMUnshadowed::StandardContextSetup, CS::RenderManager::MultipleRenderLayer> >::ContextSetupData&) () from /home/lucas/projects/cs/rm_unshadowed.so #41 0x00007fffdda37b2a in CS::Plugin::RMUnshadowed::RMUnshadowed::RenderView (this=0x7fffe43c7ff8, view=0x7fffd71ed040) at /home/lucas/projects/cs/plugins/rendermanager/unshadowed/unshadowed.cpp:235 #42 0x00007fffdda3607a in CS::Plugin::RMUnshadowed::RMUnshadowed::PrecacheView (this=0x150, view=0x7fffde730735) at /home/lucas/projects/cs/plugins/rendermanager/unshadowed/unshadowed.cpp:272 #43 0x00007fffe8ef4d7a in csSector::PrecacheDraw (this=0x7fffd21ace80) at /home/lucas/projects/cs/plugins/engine/3d/sector.cpp:300 #44 0x0000000000652a50 in pawsObjectView::ContinueLoad (this=0x7fffe2011f30) at src/common/paws/pawsobjectview.cpp:155 #45 0x0000000000684cd4 in PawsManager::LoadObjectViews (this=0x10e10c0) at src/common/paws/pawsmanager.cpp:836 #46 0x00000000004a2acc in psEngine::Initialize (this=0x10d79d0, level=-562886859) at src/client/psengine.cpp:711 #47 0x00000000004dde8f in pawsSplashWindow::Draw (this=0x7fffe068a450) at src/client/gui/pawssplashwindow.cpp:56 #48 0x000000000065907f in pawsWidget::DrawChildren (this=0x7fffe0686e10) at src/common/paws/pawswidget.cpp:1335 #49 0x000000000051ebae in psMainWidget::DrawChildren (this=0x150) at src/client/gui/psmainwidget.cpp:518 #50 0x00000000006850ce in PawsManager::Draw (this=0x10e10c0) at src/common/paws/pawsmanager.cpp:628 #51 0x00000000004ad498 in psEngine::EventHandler2D::HandleEvent(iEvent&) () #52 0x00007ffff76f987c in csEventTree::Dispatch (this=0xa3f670, e=...) at /home/lucas/projects/cs/libs/csutil/cssubscription.cpp:576 #53 0x00007ffff76f9ce0 in csEventTree::Notify (this=0xa3f670) at /home/lucas/projects/cs/libs/csutil/cssubscription.cpp:546 #54 0x00007ffff769b184 in csEventQueue::Notify (this=0x7fffffff1bc0, name=) at /home/lucas/projects/cs/libs/csutil/cseventq.cpp:240 #55 0x00007ffff769b4c2 in csEventQueue::Process (this=0x7ffff7f91728) at /home/lucas/projects/cs/libs/csutil/cseventq.cpp:256 #56 0x00007ffff7727e66 in csDefaultRunLoop (r=0x7ffff7fcf8f8) at /home/lucas/projects/cs/libs/csutil/generic/runloop.cpp:99 #57 0x00000000004a36ac in main (argc=, argv=) at src/client/psengine.cpp:1920 #0 0x00007ffff683dbd2 in strlen () from /lib/libc.so.6 #1 0x00007ffff68063cc in vfprintf () from /lib/libc.so.6 #2 0x00007ffff68a7049 in __vsnprintf_chk () from /lib/libc.so.6 #3 0x00007fffde69cab9 in vsnprintf (fmt=0x7fffde730725 "line %u, char %u: error: %s\n") from /usr/lib64/dri/r300_dri.so #4 make_error_string (fmt=0x7fffde730725 "line %u, char %u: error: %s\n") at program_parse.y:2612 #5 0x00007fffde69cb51 in yyerror (locp=0x7fffffff22fc, state=0x7fffffff6cb0, s=0x7fffde731a78 "invalid texture image unit selector") from /usr/lib64/dri/r300_dri.so #6 0x00007fffde6a052d in yyparse (state=0x7fffffff6cb0) from /usr/lib64/dri/r300_dri.so #7 0x00007fffde6a0bb2 in _mesa_parse_arb_program (ctx=0xd498e0, target=34820, str=0x2b2b120 "!!ARBfp1.0\n# cgc version 2.2.0010, build date Sep 29 2009\n# command line args: -q -profile arbfp1 -entry fragmentMain -O3 -DPROFILE_ARBFP1 -DVERT_PROFILE_ARBVP1 -DFRAG_PROFILE_ARBFP1 -DFRAGMENT_PROGRAM_LEVEL=0x200 -DVENDOR_OTHER -DPROGRAM_TYPE_FRAGMENT -po MaxLocalParams=1024 -po MaxTexIndirections=4 -po NumInstructionSlots=96 -po NumMathInstructionSlots=64 -po NumTemps=256 -po NumTexInstructionSlots=32\n#vendor NVIDIA Corporation\n#version 2.2.0.10\n#profile arbfp1\n#program fragmentMain\n#semantic fragmentMain.fragmentIn\n#semantic _clip_out_packed_distances1\n#semantic _clip_out_packed_distances2\n#semantic objectToWorld\n#semantic lightProps\n#semantic lightPropsSM\n#var float2 vertexToFragment.texCoord_0 : $vin.TEX0 : TEX0 : 0 : 1\n#var float2 vertexToFragment.texCoordLM_2 : $vin.TEX1 : TEX1 : 0 : 1\n#var float3 vertexToFragment.eyeDirectionTangent_15 : $vin.TEX2 : TEX2 : 0 : 1\n#var float4x4 fragmentIn.ModelView : state.matrix.modelview : , 4 : 1 : 0\n#var float4x4 fragmentIn.objectToWorld : : c[0], 4 : 1 : 0\n#var float4 fragmentIn.eyePosWorld : : c[4] : 1 : 0\n#var sampler2D fragmentIn.texHeight : : : 1 : 0\n#var float4 fragmentIn.texHeight_Cg_WTF : : : 1 : 0\n#var float fragmentIn.heightMapScale : : : 1 : 0\n#var float2 fragmentIn.sampleLimits : : : 1 : 0\n#var sampler2D fragmentIn.texDiffuse : : texunit 6 : 1 : 1\n#var float4 fragmentIn.texDiffuse_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.texNormal : : : 1 : 0\n#var float4 fragmentIn.texNormal_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.texNormalCompressed : : : 1 : 0\n#var float4 fragmentIn.texNormalCompressed_Cg_WTF : : : 1 : 0\n#var float4 fragmentIn.color_modulation : : c[5] : 1 : 1\n#var float fragmentIn.mixModeAlpha : : c[6] : 1 : 1\n#var sampler2D fragmentIn.texAO : : : 1 : 0\n#var float4 fragmentIn.texAO_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.lightmap_dir1 : : texunit 0 : 1 : 1\n#var float4 fragmentIn.lightmap_dir1_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.lightmap_dir2 : : texunit 1 : 1 : 1\n#var float4 fragmentIn.lightmap_dir2_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.lightmap_dir3 : : texunit 2 : 1 : 1\n#var float4 fragmentIn.lightmap_dir3_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.directions1 : : texunit 3 : 1 : 1\n#var float4 fragmentIn.directions1_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.directions2 : : texunit 4 : 1 : 1\n#var float4 fragmentIn.directions2_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.directions3 : : texunit 5 : 1 : 1\n#var float4 fragmentIn.directions3_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.texSpecular : : texunit 7 : 1 : 1\n#var float4 fragmentIn.texSpecular_Cg_WTF : : : 1 : 0\n#var float3 fragmentIn.specular : : c[7] : 1 : 1\n#var float3 fragmentIn.combinedAmbient : : : 1 : 0\n#var float3 fragmentIn.dynamicAmbient : : c[8] : 1 : 1\n#var sampler2D fragmentIn.lightmap : : texunit 8 : 1 : 1\n#var float4 fragmentIn.lightmap_Cg_WTF : : : 1 : 0\n#var float4 fragmentIn.hdrScale : : c[9] : 1 : 1\n#var sampler2D fragmentIn.fogTex : : : 1 : 0\n#var float4 fragmentIn.fogTex_Cg_WTF : : : 1 : 0\n#var float4 fragmentIn.fogColor : : : 1 : 0\n#var float fragmentIn.fogFadeEnd : : : 1 : 0\n#var float fragmentIn.fogFadeStart : : : 1 : 0\n#var float fragmentIn.fogLimit : : : 1 : 0\n#var float4 _clip_out_packed_distances1 : : : -1 : 0\n#var float4 _clip_out_packed_distances2 : : : -1 : 0\n#var float4x4 objectToWorld : : , 4 : -1 : 0\n#var int lightProps.count : : : -1 : 0\n#var float4 lightProps.posWorld[0] : : : -1 : 0\n#var float4 lightProps.posWorld[1] : : : -1 : 0\n#var float4 lightProps.posWorld[2] : : : -1 : 0\n#var float4 lightProps.posWorld[3] : : : -1 : 0\n#var float4 lightProps.posWorld[4] : : : -1 : 0\n#var float4 lightProps.posWorld[5] : : : -1 : 0\n#var float4 lightProps.posWorld[6] : : : -1 : 0\n#var float4 lightProps.posWorld[7] : : : -1 : 0\n#var float4x4 lightProps.transform[0] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[1] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[2] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[3] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[4] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[5] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[6] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[7] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[0] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[1] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[2] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[3] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[4] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[5] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[6] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[7] : : , 4 : -1 : 0\n#var float3 lightProps.colorDiffuse[0] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[1] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[2] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[3] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[4] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[5] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[6] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[7] : : : -1 : 0\n#var float3 lightProps.colorSpecular[0] : : : -1 : 0\n#var float3 lightProps.colorSpecular[1] : : : -1 : 0\n#var float3 lightProps.colorSpecular[2] : : : -1 : 0\n#var float3 lightProps.colorSpecular[3] : : : -1 : 0\n#var float3 lightProps.colorSpecular[4] : : : -1 : 0\n#var float3 lightProps.colorSpecular[5] : : : -1 : 0\n#var float3 lightProps.colorSpecular[6] : : : -1 : 0\n#var float3 lightProps.colorSpecular[7] : : : -1 : 0\n#var float4 lightProps.attenuationVec[0] : : : -1 : 0\n#var float4 lightProps.attenuationVec[1] : : : -1 : 0\n#var float4 lightProps.attenuationVec[2] : : : -1 : 0\n#var float4 lightProps.attenuationVec[3] : : : -1 : 0\n#var float4 lightProps.attenuationVec[4] : : : -1 : 0\n#var float4 lightProps.attenuationVec[5] : : : -1 : 0\n#var float4 lightProps.attenuationVec[6] : : : -1 : 0\n#var float4 lightProps.attenuationVec[7] : : : -1 : 0\n#var float lightProps.falloffInner[0] : : : -1 : 0\n#var float lightProps.falloffInner[1] : : : -1 : 0\n#var float lightProps.falloffInner[2] : : : -1 : 0\n#var float lightProps.falloffInner[3] : : : -1 : 0\n#var float lightProps.falloffInner[4] : : : -1 : 0\n#var float lightProps.falloffInner[5] : : : -1 : 0\n#var float lightProps.falloffInner[6] : : : -1 : 0\n#var float lightProps.falloffInner[7] : : : -1 : 0\n#var float lightProps.falloffOuter[0] : : : -1 : 0\n#var float lightProps.falloffOuter[1] : : : -1 : 0\n#var float lightProps.falloffOuter[2] : : : -1 : 0\n#var float lightProps.falloffOuter[3] : : : -1 : 0\n#var float lightProps.falloffOuter[4] : : : -1 : 0\n#var float lightProps.falloffOuter[5] : : : -1 : 0\n#var float lightProps.falloffOuter[6] : : : -1 : 0\n#var float lightProps.falloffOuter[7] : : : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[0] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[1] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[2] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[3] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[4] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[5] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[6] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[7] : : , 4 : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[0] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[1] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[2] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[3] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[4] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[5] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[6] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[7] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[0] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[1] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[2] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[3] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[4] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[5] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[6] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[7] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[0] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[1] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[2] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[3] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[4] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[5] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[6] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[7] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMapNoise : : : -1 : 0\n#var float4 fragmentMain.color0 : $vout.COLOR0 : COL : -1 : 1\n#var float fragmentMain.depth : $vout.DEPTH : : -1 : 0\n#const c[10] = 2 1 32 0\n#const c[11] = -0.40824801 0.70710701 0.57735002 -0.70710701\n#const c[12] = 0.81649703 0 0.57735002\n#default _clip_out_packed_distances1 = 0 0 0 0\n#default _clip_out_packed_distances2 = 0 0 0 0\nPARAM c[13] = { program.local[0..9],\n\t\t{ 2, 1, 32, 0 },\n\t\t{ -0.40824801, 0.70710701, 0.57735002, -0.70710701 },\n\t\t{ 0.81649703, 0, 0.57735002 } };\nTEMP R0;\nTEMP R1;\nTEMP R2;\nTEMP R3;\nTEMP R4;\nTEMP R5;\nTEMP R6;\nTEMP R7;\nTEMP R8;\nTEMP R9;\nTEX R3.yw, fragment.texcoord[1], texture[5], 2D;\nTEX R0, fragment.texcoord[0], texture[6], 2D;\nTEX R1.xyz, fragment.texcoord[1], texture[8], 2D;\nTEX R2.xyz, fragment.texcoord[0], texture[7], 2D;\nTEX R8.yw, fragment.texcoord[1], texture[4], 2D;\nTEX R5.yw, fragment.texcoord[1], texture[3], 2D;\nTEX R6.xyz, fragment.texcoord[1], texture[0], 2D;\nTEX R4.xyz, fragment.texcoord[1], texture[2], 2D;\nTEX R7.xyz, fragment.texcoord[1], texture[1], 2D;\nMAD R3.zw, R3.xyyw, c[10].x, -c[10].y;\nMUL R0, R0, c[5];\nMUL R0.w, R0, c[6].x;\nDP3 R1.w, fragment.texcoord[2], fragment.texcoord[2];\nMUL R2.xyz, R2, c[7];\nMUL R1.xyz, R1, c[10].x;\nMOV R5.z, R3;\nMAD R5.xy, R5.ywzw, c[10].x, -c[10].y;\nMAD R8.xy, R8.ywzw, c[10].x, -c[10].y;\nMOV R8.z, R3.w;\nRSQ R1.w, R1.w;\nDP3_SAT R3.x, R5, c[11];\nDP3_SAT R3.z, R5, c[11].xwzw;\nDP3_SAT R3.y, R5, c[12];\nMUL R3.xyz, R3, R3;\nMUL R9.xyz, R3.y, R7;\nMAD R9.xyz, R3.x, R6, R9;\nMAD R3.xyz, R3.z, R4, R9;\nMAD R5.xyz, -R1.w, fragment.texcoord[2], R5;\nMUL R2.xyz, R0.w, R2;\nDP3_SAT R9.x, R8, c[11];\nDP3_SAT R9.z, R8, c[11].xwzw;\nDP3_SAT R9.y, R8, c[12];\nMUL R9.xyz, R9, R9;\nMUL R7.xyz, R7, R9.y;\nMAD R7.xyz, R6, R9.x, R7;\nMAD R6.xyz, -R1.w, fragment.texcoord[2], R8;\nDP3 R2.w, R6, R6;\nRSQ R1.w, R2.w;\nDP3 R2.w, R5, R5;\nMUL_SAT R1.w, R1, R6.z;\nRSQ R2.w, R2.w;\nPOW R1.w, R1.w, c[10].z;\nMAD R4.xyz, R4, R9.z, R7;\nMUL_SAT R2.w, R2, R5.z;\nMUL R4.xyz, R4, R1.w;\nPOW R1.w, R2.w, c[10].z;\nMAD R3.xyz, R3, R1.w, R4;\nMUL R2.xyz, R3, R2;\nMUL R2.xyz, R2, c[10].x;\nMUL R0.xyz, R0, R0.w;\nADD R1.xyz, R1, c[8];\nMOV R2.w, c[10];\nMOV R1.w, c[10].y;\nMAD R0, R1, R0, R2;\nMAD result.color.xyz, R0, c[9].y, c[9].w;\nMOV result.color.w, R0;\nEND\n# 56 instructions, 10 R-regs\n", len=11122, state=0x7fffffff6cb0) from /usr/lib64/dri/r300_dri.so #8 0x00007fffde69c066 in _mesa_parse_arb_fragment_program (ctx=0xd498e0, target=, str=0x2b2b120, len=11122, program=0x2b03d40) at shader/arbprogparse.c:83 #9 0x00007fffde5df06b in _mesa_ProgramStringARB (target=34820, format=, len=11122, string=0x2b2b120) at shader/arbprogram.c:475 #10 0x00007fffe703d97d in ?? () from /opt/nvidia-cg-toolkit/lib/libCgGL.so #11 0x00007fffe701ac42 in ?? () from /opt/nvidia-cg-toolkit/lib/libCgGL.so #12 0x00007fffe701dca2 in cgGLLoadProgram () from /opt/nvidia-cg-toolkit/lib/libCgGL.so #13 0x00007fffe71db383 in CS::Plugin::GLShaderCg::csShaderGLCGCommon::DefaultLoadProgram (this=0x7fffd64621a8, cgResolve=, programStr=0x2b1aa70 "#define PARAM__clip_out_packed_distances1_UNUSED\n#define PARAM_vertexToFragment_color_dir3_5_UNUSED\n#define PARAM_vertexToFragment_Normal_1_UNUSED\n#define PARAM_vertexToFragment_litColor_6_UNUSED\n#define PARAM_vertexToFragment_Tangent_7_UNUSED\n#define PARAM_vertexToFragment_position_world_12_UNUSED\n#define PARAM_vertexToFragment_position_object_11_UNUSED\n#define PARAM_vertexToFragment_color_dir1_3_UNUSED\n#define PARAM_vertexToFragment_position_screen_10_UNUSED\n#define PARAM__clip_out_packed_distances2_UNUSED\n#define PARAM_vertexToFragment_Bitangent_8_UNUSED\n#define PARAM_vertexToFragment_position_camera_13_UNUSED\n#define PARAM_vertexToFragment_color_dir2_4_UNUSED\n#define PARAM_vertexToFragment_eyeDirectionObj_14_UNUSED\n#define PARAM_vertexToFragment_fogTC_16_UNUSED\n#define _INITIALIZE_UNUSED_V2F\n#ifdef PROGRAM_TYPE_VERTEX\n struct _ClipPlanes\n {\n uniform float4 plane0;\n uniform float4 plane1;\n uniform float4 plane2;\n uniform float4 plane3;\n uniform float4 plane4;\n uniform float4 plane5;\n uniform float4 packedDists0;\n uniform float4 packedDists1;\n };\n _ClipPlanes _clipPlanes;\n\n #if (defined(VERT_PROFILE_VP40) || defined(VERT_PROFILE_GP4VP))\n #define _CLIP_OUTPUT(N) out varying float _clip_ ## N : CLP ## N;\n #define _CLIP_OUTPUT_UNUSED(N) float _clip_ ## N;\n #else\n #define _CLIP_OUTPUT(N)\n #define _CLIP_OUTPUT_UNUSED(N)\n #ifndef PARAM__clip_out_packed_distances1_UNUSED\n out varying float4 _clip_out_packed_distances1 : TEXCOORD7;\n #endif\n #ifndef PARAM__clip_out_packed_distances2_UNUSED\n out varying float4 _clip_out_packed_distances2 : TEXCOORD6;\n #endif\n #endif\n#else\n #if !((defined(VERT_PROFILE_VP40) || defined(VERT_PROFILE_GP4VP)))\n #ifndef PARAM__clip_out_packed_distances1_UNUSED\n in varying float4 _clip_out_packed_distances1 : TEXCOORD7;\n #else\n float4 _clip_out_packed_distances1 = float4(0);\n #endif\n #ifndef PARAM__clip_out_packed_distances2_UNUSED\n in varying float4 _clip_out_packed_distances2 : TEXCOORD6;\n #else\n float4 _clip_out_packed_distances2 = float4(0);\n #endif\n #endif\n#endif\n\n#ifdef PROGRAM_TYPE_VERTEX\n #define _CLIP_COMPUTE_DIST(N, CLIP_POS) \\\n float _clip_dist ## N = dot (_clipPlanes.plane ## N, CLIP_POS); \\\n _clip_dist ## N -= (N < 4) \\\n\t? _clipPlanes.packedDists0[N] \\\n\t: _clipPlanes.packedDists1[N-4];\n #define _CLIP_COMPUTE_DIST_CD(N, CLIP_POS, CLIP_DIST) \\\n float _clip_dist ## N = dot (_clipPlanes.plane ## N, CLIP_POS); \\\n _clip_dist ## N -= CLIP_DIST;\n #define _CLIP_UNUSED(N) \\\n float _clip_dist ## N = 0;\n#else\n#endif\n\n#ifdef PROGRAM_TYPE_VERTEX\n#define _CLIP_COMPUTE_DISTS(P_Eye, P_World, P_Object) \\\n_CLIP_COMPUTE_DIST_CD(0, P_World, 0.000000) \\\n_CLIP_COMPUTE_DIST(1, P_Eye) \\\n_CLIP_COMPUTE_DIST(2, P_Eye) \\\n_CLIP_UNUSED(3) \\\n_CLIP_UNUSED(4) \\\n_CLIP_UNUSED(5) \n_CLIP_OUTPUT(0)\n_CLIP_OUTPUT(1)\n_CLIP_OUTPUT(2)\n_CLIP_OUTPUT_UNUSED(3)\n_CLIP_OUTPUT_UNUSED(4)\n_CLIP_OUTPUT_UNUSED(5)\n#endif\n\n#ifdef PROGRAM_TYPE_FRAGMENT\n#define _CLIP_TO_DISTS \\\nclip (_clip_out_packed_distances1); \n#endif\n\n#ifdef PROGRAM_TYPE_VERTEX\n #if (defined(VERT_PROFILE_VP40) || defined(VERT_PROFILE_GP4VP))\n #define APPLY_CLIPPING_VP(P_Eye, P_World, P_Object) \\\n _CLIP_COMPUTE_DISTS(P_Eye, P_World, P_Object) \\\n _clip_0 = _clip_dist0; \\\n _clip_1 = _clip_dist1; \\\n _clip_2 = _clip_dist2; \\\n _clip_3 = _clip_dist3; \\\n _clip_4 = _clip_dist4; \\\n _clip_5 = _clip_dist5;\n #define APPLY_CLIPPING_VP_POSINV(P_Eye, P_World, P_Object) APPLY_CLIPPING_VP(P_Eye, P_World, P_Object)\n #else\n #define APPLY_CLIPPING_VP_POSINV(P_Eye, P_World, P_Object)\n #if defined(VENDOR_ATI)\n #define APPLY_CLIPPING_VP(P_Eye, P_World, P_Object) APPLY_CLIPPING_VP_POSINV(P_Eye, P_World, P_Object)\n #else\n #ifndef PARAM__clip_out_packed_distances1_UNUSED\n #define _CLIP_PACK_DISTS_1 \\\n _clip_out_packed_distances1.x = _clip_dist0; \\\n _clip_out_packed_distances1.y = _clip_dist1; \\\n _clip_out_packed_distances1.z = _clip_dist2; \\\n _clip_out_packed_distances1.w = _clip_dist3;\n #else\n #define _CLIP_PACK_DISTS_1\n #endif\n #ifndef PARAM__clip_out_packed_distances2_UNUSED\n #define _CLIP_PACK_DISTS_2 \\\n _clip_out_packed_distances2.x = _clip_dist4; \\\n _clip_out_packed_distances2.y = _clip_dist5; \\\n _clip_out_packed_distances2.z = 0; \\\n _clip_out_packed_distances2.w = 0;\n #else\n #define _CLIP_PACK_DISTS_2\n #endif\n #define APPLY_CLIPPING_VP(P_Eye, P_World, P_Object) \\\n _CLIP_COMPUTE_DISTS(P_Eye, P_World, P_Object) \\\n _CLIP_PACK_DISTS_1 \\\n _CLIP_PACK_DISTS_2\n #endif\n #endif\n#else\n #define APPLY_CLIPPING_FP_POSINV\n #if ((defined(VERT_PROFILE_VP40) || defined(VERT_PROFILE_GP4VP)))\n #define APPLY_CLIPPING_FP\n #else\n #if defined(VENDOR_ATI)\n #define APPLY_CLIPPING_FP APPLY_CLIPPING_FP_POSINV\n #else\n #define APPLY_CLIPPING_FP _CLIP_TO_DISTS\n #endif\n #endif\n#endif\n\n//@@UNUSED? PARAM_vertexToFragment_texCoord_0_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_Normal_1_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_texCoordLM_2_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_color_dir1_3_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_color_dir2_4_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_color_dir3_5_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_litColor_6_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_Tangent_7_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_Bitangent_8_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_9_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_screen_10_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_object_11_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_world_12_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_camera_13_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_eyeDirectionObj_14_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_eyeDirectionTangent_15_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_fogTC_16_UNUSED\n\n\n#ifndef __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n#define __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n\n/*\n objectToWorld transform, set by the position snippet.\n Global variable instance of an (as usual) privately pulled input\n as objectToWorld may be set in different ways (notably in instanced\n vs 'normal' rendering) which only the position snippet really\n knows.\n */\nfloat4x4 objectToWorld;\n\nvoid SetGlobalObjectToWorld (float4x4 o2w)\n{\n objectToWorld = o2w;\n}\n\n#endif // __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n \n\n\n#ifndef __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n#define __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n\n/*\n objectToWorld transform, set by the position snippet.\n Global variable instance of an (as usual) privately pulled input\n as objectToWorld may be set in different ways (notably in instanced\n vs 'normal' rendering) which only the position snippet really\n knows.\n */\nfloat4x4 objectToWorld;\n\nvoid SetGlobalObjectToWorld (float4x4 o2w)\n{\n objectToWorld = o2w;\n}\n\n#endif // __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n \n\n\n#ifndef __DIRECTIONAL_LMS_CG_INC__\n#define __DIRECTIONAL_LMS_CG_INC__\n\nfloat3 ComputeDLMCoeff (float3 direction)\n{\n /* These should really match up with those in lighter2... */\n float3 base[3] = \n { \n float3 (/* -1/sqrt(6) */ -0.408248, /* 1/sqrt(2) */ 0.707107, /* 1/sqrt(3) */ 0.577350),\n float3 (/* sqrt(2/3) */ 0.816497, 0, /* 1/sqrt(3) */ 0.577350),\n float3 (/* -1/sqrt(6) */ -0.408248, /* -1/sqrt(2) */ -0.707107, /* 1/sqrt(3) */ 0.577350)\n };\n\n float3 coeff = float3 (saturate (dot (direction, base[0])),\n saturate (dot (direction, base[1])),\n saturate (dot (direction, base[2])));\n return coeff * coeff;\n}\n\nfloat3 ComputeDLMColor (float3 direction, float3 baseColor[3])\n{\n float3 coeff = ComputeDLMCoeff (direction);\n return (coeff.x * baseColor[0]\n + coeff.y * baseColor[1]\n + coeff.z * baseColor[2]);\n}\n\n#endif // __DIRECTIONAL_LMS_CG_INC__\n \n\n\n#ifndef __LIGHTFUNCS_CG_INC__\n#define __LIGHTFUNCS_CG_INC__\n\n#define MAX_LIGHTS 8\n\nhalf Attenuation_Linear (float d, float invLightRadius)\n{\n return (half)(saturate (1 - d * invLightRadius));\n}\n\nhalf Attenuation_Inverse (float d)\n{\n return 1/d;\n}\n\nhalf Attenuation_Realistic (float d)\n{\n return 1/(d*d);\n}\n\nhalf Attenuation_CLQ (float d, float3 coeff)\n{\n return 1/(dot (float3 (1, d, d*d), float3 (coeff)));\n}\n\nhalf Light_Spot (half3 surfToLight, half3 lightDir, half falloffInner, half falloffOuter)\n{\n return smoothstep (falloffOuter, falloffInner, dot (surfToLight, lightDir));\n}\n\n\nstruct LightProperties\n{\n // Number of lights provided\n int count;\n // Light world-space position\n float4 posWorld[MAX_LIGHTS];\n // Transformation from light space to world space\n float4x4 transform[MAX_LIGHTS];\n // Transformation from world space to light space\n float4x4 transformInv[MAX_LIGHTS];\n // Diffuse color\n float3 colorDiffuse[MAX_LIGHTS];\n // Specular color\n float3 colorSpecular[MAX_LIGHTS];\n // Attenuation vector (XYZ are CLQ coefficients; W is light radius)\n float4 attenuationVec[MAX_LIGHTS];\n // Cosine of inner falloff angle\n float falloffInner[MAX_LIGHTS];\n // Cosine of outerr falloff angle\n float falloffOuter[MAX_LIGHTS];\n};\nLightProperties lightProps;\n\ninterface LightSpace\n{\n half3 GetDirection();\n half3 GetSurfaceToLight();\n float GetLightDistance ();\n};\n\nstruct LightSpaceWorld : LightSpace\n{\n half3 dir;\n half3 surfToLight;\n float lightDist;\n\n void Init (int lightNum, float4 surfPositionWorld)\n {\n float4 pos = lightProps.posWorld[lightNum];\n float4x4 lightTransform = lightProps.transform[lightNum];\n float3 lightDirW = mul (lightTransform, float4 (0, 0, 1, 0)).xyz;\n dir = lightDirW;\n /* Compute distance between surface and light with float precision to\n avoid precision issues with GF6 (see trac #561). */\n float3 surfToLightF = (pos - surfPositionWorld).xyz;\n lightDist = length (surfToLightF);\n surfToLight = normalize (surfToLightF);\n }\n half3 GetDirection() { return dir; }\n half3 GetSurfaceToLight() { return surfToLight; }\n float GetLightDistance () {return lightDist; }\n};\n\nstruct LightSpaceTangent : LightSpace\n{\n half3 dir;\n half3 surfToLight;\n float lightDist;\n \n void InitVP (int lightNum, \n", ' ' , "float4x4 world2tangent, float4 surfPositionWorld,\n", ' ' , "out half3 vp_dir, out float3 vp_surfToLight)\n {\n float4 pos = lightProps.posWorld[lightNum];\n float4x4 lightTransform = lightProps.transform[lightNum];\n float4 lightDirW = mul (lightTransform, float4 (0, 0, 1, 0));\n vp_dir = mul (world2tangent, lightDirW).xyz;\n vp_surfToLight = mul (world2tangent, float4 ((pos - surfPositionWorld).xyz, 0)).xyz;\n }\n\n void Init (half3 vp_dir, float3 vp_surfToLight)\n {\n dir = vp_dir;\n lightDist = length (vp_surfToLight);\n surfToLight = normalize (vp_surfToLight);\n }\n half3 GetDirection() { return dir; }\n half3 GetSurfaceToLight() { return surfToLight; }\n float GetLightDistance () {return lightDist; }\n};\n\ninterface Shadow\n{\n half GetVisibility();\n};\n\nstruct ShadowNone : Shadow\n{\n half GetVisibility() { return 1; }\n};\n\ninterface ShadowShadowMap /*: Shadow*/\n{\n half GetVisibility();\n\n void InitVP (int lightNum, float4 surfPositionWorld,\n", ' ' , "float3 normWorld,\n", ' ' , "out float4 vp_shadowMapCoords,\n", ' ' , "out float vp_gradientApprox);\n void Init (int lightNum, float4 vp_shadowMapCoords, float vp_gradient);\n};\n\nstruct ShadowShadowMapNone : ShadowShadowMap\n{\n half GetVisibility() { return 1; }\n \n void InitVP (int lightNum, float4 surfPositionWorld,\n", ' ' , "float3 normWorld,\n", ' ' , "out float4 vp_shadowMapCoords,\n", ' ' , "out float vp_gradientApprox) {}\n void Init (int lightNum, float4 vp_shadowMapCoords, float vp_gradient) {}\n};\n\nstruct ShadowShadowShadowMapWrapper : Shadow\n{\n ShadowShadowMap shadow;\n \n half GetVisibility() { return shadow.GetVisibility(); }\n};\n\nstruct LightPropertiesShadowMap\n{\n // Transformation from light to shadow map space\n float4x4 shadowMapTF[MAX_LIGHTS];\n // Shadow map\n sampler2D shadowMap[MAX_LIGHTS];\n // Shadow map pixel size + dimensions\n float4 shadowMapPixels[MAX_LIGHTS];\n float4 shadowMapUnscale[MAX_LIGHTS];\n \n sampler2D shadowMapNoise;\n};\nLightPropertiesShadowMap lightPropsSM;\n\ninterface Light\n{\n half3 GetIncidence();\n half GetAttenuation();\n};\n\nstruct LightDirectional : Light\n{\n half3 dir;\n \n void Init (LightSpace space)\n {\n dir = -space.GetDirection();\n }\n half3 GetIncidence() { return dir; }\n half GetAttenuation() { return 1; }\n};\n\nstruct LightPoint : Light\n{\n half3 dir;\n \n void Init (LightSpace space)\n {\n dir = space.GetSurfaceToLight();\n }\n half3 GetIncidence() { return dir; }\n half GetAttenuation() { return 1; }\n};\n\nstruct LightSpot : Light\n{\n half3 dir;\n half spot;\n \n void Init (LightSpace space, half3 normal, half falloffInner, half falloffOuter)\n {\n dir = -space.GetDirection();\n spot = Light_Spot (space.GetSurfaceToLight(), dir, falloffInner, falloffOuter);\n }\n half3 GetIncidence() { return dir; }\n half GetAttenuation() { return spot; }\n};\n\n\nLight GetCurrentLight (LightSpace lightSpace, int lightNum, half3 surfNormal)\n{\n\n LightPoint lp;\n lp.Init (lightSpace);\n return lp;\n\n}\n\n\nvoid ComputeLight (LightSpace lightSpace, Light light, \n", ' ' , "half3 eyeToSurf, half3 surfNormal,\n", ' ' , "half surfShininess, \n", ' ' , "float3 lightDiffuse, float3 lightSpecular,\n", ' ' , "float4 lightAttenuationVec,\n", ' ' , "half shadowFactor,\n", ' ' , "out float3 d, out float3 s)\n{\n half3 L = light.GetIncidence();\n half3 H = normalize (lightSpace.GetSurfaceToLight() - eyeToSurf);\n half spot = light.GetAttenuation();\n \n float4 lightCoeff = lit (dot (surfNormal, L), dot (surfNormal, H),\n surfShininess);\n \n float lightDist = lightSpace.GetLightDistance();\n half attn;\n float invAttnRadius = lightAttenuationVec.w;\n if (invAttnRadius > 0)\n attn = Attenuation_Linear (lightDist, invAttnRadius);\n else\n attn = Attenuation_CLQ (lightDist, lightAttenuationVec.xyz);\n \n attn *= shadowFactor;\n\n d = lightDiffuse * lightCoeff.y * spot * attn;\n s = lightSpecular * lightCoeff.z * spot * attn;\n}\n\n#endif // __LIGHTFUNCS_CG_INC__\n \n\n\n#ifndef __DIRECTIONAL_LMS_CG_INC__\n#define __DIRECTIONAL_LMS_CG_INC__\n\nfloat3 ComputeDLMCoeff (float3 direction)\n{\n /* These should really match up with those in lighter2... */\n float3 base[3] = \n { \n float3 (/* -1/sqrt(6) */ -0.408248, /* 1/sqrt(2) */ 0.707107, /* 1/sqrt(3) */ 0.577350),\n float3 (/* sqrt(2/3) */ 0.816497, 0, /* 1/sqrt(3) */ 0.577350),\n float3 (/* -1/sqrt(6) */ -0.408248, /* -1/sqrt(2) */ -0.707107, /* 1/sqrt(3) */ 0.577350)\n };\n\n float3 coeff = float3 (saturate (dot (direction, base[0])),\n saturate (dot (direction, base[1])),\n saturate (dot (direction, base[2])));\n return coeff * coeff;\n}\n\nfloat3 ComputeDLMColor (float3 direction, float3 baseColor[3])\n{\n float3 coeff = ComputeDLMCoeff (direction);\n return (coeff.x * baseColor[0]\n + coeff.y * baseColor[1]\n + coeff.z * baseColor[2]);\n}\n\n#endif // __DIRECTIONAL_LMS_CG_INC__\n \n\n\nstruct vertex2fragment\n{\n void dummy() {}\n#ifdef HAVE_ARB_color_buffer_float\n#define _V2F_AUTOSEMANTIC_0\t: COLOR1\n#define _V2F_AUTOSEMANTIC_1\t: COLOR0\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_0\n#define _V2F_AUTOSEMANTIC_CURRENT\t0\n#else\n#define _V2F_AUTOSEMANTIC\n#endif\n#ifndef PARAM_vertexToFragment_texCoord_0_UNUSED\n varying float2 texCoord_0 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_Normal_1_UNUSED\n varying float3 Normal_1 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_texCoordLM_2_UNUSED\n varying float2 texCoordLM_2 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_color_dir1_3_UNUSED\n varying float3 color_dir1_3 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_color_dir2_4_UNUSED\n varying float3 color_dir2_4 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_color_dir3_5_UNUSED\n varying float3 color_dir3_5 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_litColor_6_UNUSED\n varying float3 litColor_6 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_Tangent_7_UNUSED\n varying float3 Tangent_7 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_Bitangent_8_UNUSED\n varying float3 Bitangent_8 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_position_9_UNUSED\n varying float4 position_9 : POSITION;\n#endif\n#ifndef PARAM_vertexToFragment_position_screen_10_UNUSED\n varying float4 position_screen_10 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_position_object_11_UNUSED\n varying float4 position_object_11 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_position_world_12_UNUSED\n varying float4 position_world_12 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_position_camera_13_UNUSED\n varying float4 position_camera_13 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_eyeDirectionObj_14_UNUSED\n varying float3 eyeDirectionObj_14 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_eyeDirectionTangent_15_UNUSED\n varying float3 eyeDirectionTangent_15 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_fogTC_16_UNUSED\n varying float2 fogTC_16 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#undef _V2F_AUTOSEMANTIC_0\n#undef _V2F_AUTOSEMANTIC_1\n#undef _V2F_AUTOSEMANTIC\n};\n\nstruct FragmentInput\n{\n void dummy() {}\n uniform float4x4 ModelView : state.matrix.modelview;\n uniform float4x4 objectToWorld;\n uniform float4 eyePosWorld;\n uniform sampler2D texHeight;\n uniform float4 texHeight_Cg_WTF;\n uniform float heightMapScale;\n uniform float2 sampleLimits;\n uniform sampler2D texDiffuse;\n uniform float4 texDiffuse_Cg_WTF;\n uniform sampler2D texNormal;\n uniform float4 texNormal_Cg_WTF;\n uniform sampler2D texNormalCompressed;\n uniform float4 texNormalCompressed_Cg_WTF;\n uniform float4 color_modulation;\n uniform float mixModeAlpha;\n uniform sampler2D texAO;\n uniform float4 texAO_Cg_WTF;\n uniform sampler2D lightmap_dir1;\n uniform float4 lightmap_dir1_Cg_WTF;\n uniform sampler2D lightmap_dir2;\n uniform float4 lightmap_dir2_Cg_WTF;\n uniform sampler2D lightmap_dir3;\n uniform float4 lightmap_dir3_Cg_WTF;\n uniform sampler2D directions1;\n uniform float4 directions1_Cg_WTF;\n uniform sampler2D directions2;\n uniform float4 directions2_Cg_WTF;\n uniform sampler2D directions3;\n uniform float4 directions3_Cg_WTF;\n uniform sampler2D texSpecular;\n uniform float4 texSpecular_Cg_WTF;\n uniform float3 specular;\n uniform float3 combinedAmbient;\n uniform float3 dynamicAmbient;\n uniform sampler2D lightmap;\n uniform float4 lightmap_Cg_WTF;\n uniform float4 hdrScale;\n uniform sampler2D fogTex;\n uniform float4 fogTex_Cg_WTF;\n uniform float4 fogColor;\n uniform float fogFadeEnd;\n uniform float fogFadeStart;\n uniform float fogLimit;\n};\n\nstruct FragmentOutput\n{\n float4 color0 : COLOR0;\n float depth : DEPTH;\n};\n\nFragmentOutput fragmentMain (vertex2fragment vertexToFragment, FragmentInput fragmentIn)\n{\n float4 outputColor_0;\n float4 result_1;\n float4 foggedColor_2;\n float4 surfaceWithGlow_3;\n float4 result_4;\n float4 outputColor_5;\n float3 diffuseColor_6;\n float3 specularColor_7;\n float4 result_8;\n float3 ambient_9;\n float3 specularColor_10;\n float4 outputColor_11;\n float3 o_normal_12;\n float3 eyeDirectionWorld_13;\n float3 specular_14;\n float occlusionFactor_15;\n float2 result_16;\n float normalmap_alpha_17;\n float4 surfaceColorOut_18;\n float4 position_19;\n float4 position_world_20;\n float4 position_object_21;\n float4 position_camera_22;\n float3 normal_23;\n float3 o_normal_24;\n float3 eyeDirectionTangent_25;\n int output_26;\n int output_27;\n float4 surfaceColor_28;\n float2 texCoordOffset_29;\n float3 eyeDirectionWorld_30;\n float3 eyeDirectionObj_31;\n float3 eyeDirectionTangent_32;\n float3 eyeDirectionObj_33;\n float3 output_34;\n float3 output_35;\n float3 output_36;\n float3 output_37;\n float3 output_38;\n float3 output_39;\n float4 output_40;\n float4 output_41;\n float3 output_42;\n float3 output_43;\n float4 in_Hposition;\n float4x4 in_ModelViewProj;\n float4x4 in_ModelView;\n float4x4 in_objectToWorld;\n float4x4 in_ModelViewIT;\n float4 in_eyePosWorld;\n float2 in_texCoord;\n float3 in_Normal;\n sampler2D in_texHeight;\n float in_heightMapScale;\n float2 in_sampleLimits;\n sampler2D in_texDiffuse;\n sampler2D in_texNormal;\n sampler2D in_texNormalCompressed;\n float4 in_color_modulation;\n float in_mixModeAlpha;\n float2 in_texCoordLM;\n sampler2D in_texAO;\n float3 in_color_dir1;\n float3 in_color_dir2;\n float3 in_color_dir3;\n sampler2D in_lightmap_dir1;\n sampler2D in_lightmap_dir2;\n sampler2D in_lightmap_dir3;\n sampler2D in_directions1;\n sampler2D in_directions2;\n sampler2D in_directions3;\n sampler2D in_texSpecular;\n float3 in_specular;\n float3 in_combinedAmbient;\n float3 in_dynamicAmbient;\n float3 in_litColor;\n sampler2D in_lightmap;\n sampler2D in_texGlow;\n float4 in_hdrScale;\n float3 in_Tangent;\n float3 in_Bitangent;\n bool normal_23_attr_perfragment;\n bool specular_14_attr_perfragment;\n bool output_41_attr_perfragment;\n bool diffuseColor_6_attr_perfragment;\n bool specularColor_7_attr_perfragment;\n bool output_40_attr_perfragment;\n bool surfaceColor_28_attr_perfragment;\n bool surfaceColorOut_18_attr_perfragment;\n bool normalmap_alpha_17_attr_perfragment;\n bool specularColor_10_attr_perfragment;\n bool occlusionFactor_15_attr_perfragment;\n bool ambient_9_attr_perfragment;\n bool outputColor_5_attr_perfragment;\n bool result_4_attr_perfragment;\n {\n float4 Hposition;\n in_Hposition = Hposition;\n }\n\n {\n float4x4 ModelViewProj;\n in_ModelViewProj = ModelViewProj;\n }\n\n {\n float4x4 ModelView;\n\n ModelView = fragmentIn.ModelView;\n in_ModelView = ModelView;\n }\n\n {\n float4x4 objectToWorld;\n\n objectToWorld = fragmentIn.objectToWorld;\n in_objectToWorld = objectToWorld;\n }\n\n {\n float4x4 ModelViewIT;\n in_ModelViewIT = ModelViewIT;\n }\n\n {\n float4 eyePosWorld;\n\n eyePosWorld = fragmentIn.eyePosWorld;\n in_eyePosWorld = eyePosWorld;\n }\n\n {\n float2 texCoord;\n #ifndef PARAM_vertexToFragment_texCoord_0_UNUSED\n texCoord = vertexToFragment.texCoord_0;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n texCoord = float2(0);\n #endif\n #endif\n in_texCoord = texCoord;\n }\n\n {\n float3 Normal;\n #ifndef PARAM_vertexToFragment_Normal_1_UNUSED\n Normal = vertexToFragment.Normal_1;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n Normal = float3(0);\n #endif\n #endif\n in_Normal = Normal;\n }\n\n {\n sampler2D texHeight;\n\n texHeight = fragmentIn.texHeight;\n in_texHeight = texHeight;\n }\n\n {\n float heightMapScale;\n\n heightMapScale = fragmentIn.heightMapScale;\n in_heightMapScale = heightMapScale;\n }\n\n {\n float2 sampleLimits;\n\n sampleLimits = fragmentIn.sampleLimits;\n in_sampleLimits = sampleLimits;\n }\n\n {\n sampler2D texDiffuse;\n\n texDiffuse = fragmentIn.texDiffuse;\n in_texDiffuse = texDiffuse;\n }\n\n {\n sampler2D texNormal;\n\n texNormal = fragmentIn.texNormal;\n in_texNormal = texNormal;\n }\n\n {\n sampler2D texNormalCompressed;\n\n texNormalCompressed = fragmentIn.texNormalCompressed;\n in_texNormalCompressed = texNormalCompressed;\n }\n\n {\n float4 color_modulation;\n\n color_modulation = fragmentIn.color_modulation;\n in_color_modulation = color_modulation;\n }\n\n {\n float mixModeAlpha;\n\n mixModeAlpha = fragmentIn.mixModeAlpha;\n in_mixModeAlpha = mixModeAlpha;\n }\n\n {\n float2 texCoordLM;\n #ifndef PARAM_vertexToFragment_texCoordLM_2_UNUSED\n texCoordLM = vertexToFragment.texCoordLM_2;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n texCoordLM = float2(0);\n #endif\n #endif\n in_texCoordLM = texCoordLM;\n }\n\n {\n sampler2D texAO;\n\n texAO = fragmentIn.texAO;\n in_texAO = texAO;\n }\n\n {\n float3 color_dir1;\n #ifndef PARAM_vertexToFragment_color_dir1_3_UNUSED\n color_dir1 = vertexToFragment.color_dir1_3;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n color_dir1 = float3(0);\n #endif\n #endif\n in_color_dir1 = color_dir1;\n }\n\n {\n float3 color_dir2;\n #ifndef PARAM_vertexToFragment_color_dir2_4_UNUSED\n color_dir2 = vertexToFragment.color_dir2_4;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n color_dir2 = float3(0);\n #endif\n #endif\n in_color_dir2 = color_dir2;\n }\n\n {\n float3 color_dir3;\n #ifndef PARAM_vertexToFragment_color_dir3_5_UNUSED\n color_dir3 = vertexToFragment.color_dir3_5;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n color_dir3 = float3(0);\n #endif\n #endif\n in_color_dir3 = color_dir3;\n }\n\n {\n sampler2D lightmap_dir1;\n\n lightmap_dir1 = fragmentIn.lightmap_dir1;\n in_lightmap_dir1 = lightmap_dir1;\n }\n\n {\n sampler2D lightmap_dir2;\n\n lightmap_dir2 = fragmentIn.lightmap_dir2;\n in_lightmap_dir2 = lightmap_dir2;\n }\n\n {\n sampler2D lightmap_dir3;\n\n lightmap_dir3 = fragmentIn.lightmap_dir3;\n in_lightmap_dir3 = lightmap_dir3;\n }\n\n {\n sampler2D directions1;\n\n directions1 = fragmentIn.directions1;\n in_directions1 = directions1;\n }\n\n {\n sampler2D directions2;\n\n directions2 = fragmentIn.directions2;\n in_directions2 = directions2;\n }\n\n {\n sampler2D directions3;\n\n directions3 = fragmentIn.directions3;\n in_directions3 = directions3;\n }\n\n {\n sampler2D texSpecular;\n\n texSpecular = fragmentIn.texSpecular;\n in_texSpecular = texSpecular;\n }\n\n {\n float3 specular;\n\n specular = fragmentIn.specular;\n in_specular = specular;\n }\n\n {\n float3 combinedAmbient;\n\n combinedAmbient = fragmentIn.combinedAmbient;\n in_combinedAmbient = combinedAmbient;\n }\n\n {\n float3 dynamicAmbient;\n\n dynamicAmbient = fragmentIn.dynamicAmbient;\n in_dynamicAmbient = dynamicAmbient;\n }\n\n {\n float3 litColor;\n #ifndef PARAM_vertexToFragment_litColor_6_UNUSED\n litColor = vertexToFragment.litColor_6;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n litColor = float3(0);\n #endif\n #endif\n in_litColor = litColor;\n }\n\n {\n sampler2D lightmap;\n\n lightmap = fragmentIn.lightmap;\n in_lightmap = lightmap;\n }\n\n {\n sampler2D texGlow;\n in_texGlow = texGlow;\n }\n\n {\n float4 hdrScale;\n\n hdrScale = fragmentIn.hdrScale;\n in_hdrScale = hdrScale;\n }\n\n {\n float3 Tangent;\n #ifndef PARAM_vertexToFragment_Tangent_7_UNUSED\n Tangent = vertexToFragment.Tangent_7;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n Tangent = float3(0);\n #endif\n #endif\n\n #if FRAGMENT_PROGRAM_LEVEL >= 0x200\n // Renormalize, as interpolation will have denormalized it\n Tangent = normalize (Tangent);\n #endif\n in_Tangent = Tangent;\n }\n\n {\n float3 Bitangent;\n #ifndef PARAM_vertexToFragment_Bitangent_8_UNUSED\n Bitangent = vertexToFragment.Bitangent_8;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n Bitangent = float3(0);\n #endif\n #endif\n\n #if FRAGMENT_PROGRAM_LEVEL >= 0x200\n // Renormalize, as interpolation will have denormalized it\n Bitangent = normalize (Bitangent);\n #endif\n in_Bitangent = Bitangent;\n }\n\n {\n int output;\n output = 0;output_27 = output;\n }\n\n {\n float4 Hposition;\n float4x4 ModelViewProj;\n float4x4 ModelView;\n float4x4 objectToWorld;\n float4 position;\n float4 position_world;\n float4 position_object;\n float4 position_camera;\n float4 position_screen;\n Hposition = in_Hposition;\n ModelView = in_ModelView;\n objectToWorld = in_objectToWorld;\n ModelViewProj = in_ModelViewProj;\n #ifndef PARAM_vertexToFragment_position_9_UNUSED\n position = vertexToFragment.position_9;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position = float4(0);\n #endif\n #endif\n #ifndef PARAM_vertexToFragment_position_screen_10_UNUSED\n position_screen = vertexToFragment.position_screen_10;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position_screen = float4(0);\n #endif\n #endif\n #ifndef PARAM_vertexToFragment_position_object_11_UNUSED\n position_object = vertexToFragment.position_object_11;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position_object = float4(0);\n #endif\n #endif\n #ifndef PARAM_vertexToFragment_position_world_12_UNUSED\n position_world = vertexToFragment.position_world_12;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position_world = float4(0);\n #endif\n #endif\n #ifndef PARAM_vertexToFragment_position_camera_13_UNUSED\n position_camera = vertexToFragment.position_camera_13;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position_camera = float4(0);\n #endif\n #endif\n\n APPLY_CLIPPING_FP_POSINV;\n\n /* The objectToWorld transform is needed in other places, so there is a \n\t global variable for it. Set that */\n\n SetGlobalObjectToWorld (objectToWorld);\n position = position_screen;\n position_object_21 = position_object;\n position_camera_22 = position_camera;\n position_world_20 = position_world;\n position_19 = position;\n }\n\n {\n float4 position;\n float4x4 ModelViewIT;\n float3 eyeDirectionObj;\n position = position_object_21;\n ModelViewIT = in_ModelViewIT;\n #ifndef PARAM_vertexToFragment_eyeDirectionObj_14_UNUSED\n eyeDirectionObj = vertexToFragment.eyeDirectionObj_14;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n eyeDirectionObj = float3(0);\n #endif\n #endif\n eyeDirectionObj_33 = eyeDirectionObj;\n }\n\n {\n float3 Normal;\n float3 Tangent;\n float3 Bitangent;\n float3 input;\n float3 output;\n Tangent = in_Tangent;\n Normal = in_Normal;\n input = eyeDirectionObj_33;\n Bitangent = in_Bitangent;\n\n #if FRAGMENT_PROGRAM_LEVEL >= 0x200\n float3x3 obj2tang;\n obj2tang[0] = Tangent;\n obj2tang[1] = Bitangent;\n obj2tang[2] = Normal;\n output = mul (obj2tang, input);\n #else\n /* PS1.x can't do matrix mul ...\n Leave 'output' deliberately undefined to catch (undesired) uses of it */\n\n #endif\n output_34 = output;\n }\n\n {\n float3 eyeVecT;\n float3 eyeDirectionTangent;\n eyeVecT = output_34;\n #ifndef PARAM_vertexToFragment_eyeDirectionTangent_15_UNUSED\n eyeDirectionTangent = vertexToFragment.eyeDirectionTangent_15;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n eyeDirectionTangent = float3(0);\n #endif\n #endif\n eyeDirectionTangent_32 = eyeDirectionTangent;\n }\n\n {\n float4 position;\n float4 eyePosWorld;\n float3 eyeDirectionWorld;\n eyePosWorld = in_eyePosWorld;\n position = position_world_20;\n\n eyeDirectionWorld = (position - eyePosWorld).xyz;\n eyeDirectionWorld_30 = eyeDirectionWorld;\n }\n\n {\n float3 input;\n float3 output;\n input = eyeDirectionObj_33;\n\n output = mul (objectToWorld, float4 (input, 0)).xyz;\n output_35 = output;\n }\n\n {\n float2 texCoord;\n float3 Normal;\n float3 eyeVec;\n float3 eyeVecW;\n sampler2D texHeight;\n float heightMapScale;\n float2 sampleLimits;\n float2 texCoordOffset;\n eyeVecW = output_35;\n Normal = in_Normal;\n texCoord = in_texCoord;\n texHeight = in_texHeight;\n heightMapScale = in_heightMapScale;\n eyeVec = eyeDirectionTangent_32;\n sampleLimits = in_sampleLimits;\n\n float2 offset = float2(0, 0);\n\n\n texCoordOffset = texCoord + offset;\n texCoordOffset_29 = texCoordOffset;\n }\n\n {\n float2 texCoord;\n sampler2D texNormal;\n sampler2D texNormalCompressed;\n float3 normal;\n bool normal_attr_perfragment;\n texNormalCompressed = in_texNormalCompressed;\n texCoord = texCoordOffset_29;\n texNormal = in_texNormal;\n\n normal = half3 (0, 0, 1);\n normal_attr_perfragment = false;\n normal_23 = normal;\n normal_23_attr_perfragment = normal_attr_perfragment;\n }\n\n {\n float3 i_normal;\n float3 o_normal;\n i_normal = normal_23;\n\n o_normal = i_normal;\n o_normal_24 = o_normal;\n }\n\n {\n float3 Normal;\n float3 Tangent;\n float3 Bitangent;\n float3 input;\n float3 output;\n Tangent = in_Tangent;\n input = o_normal_24;\n Normal = in_Normal;\n Bitangent = in_Bitangent;\n\n float3x3 obj2tang;\n obj2tang[0] = Tangent;\n obj2tang[1] = Bitangent;\n obj2tang[2] = Normal;\n output = mul (input, obj2tang);\n output_38 = output;\n }\n\n {\n float2 texCoordLM;\n float2 result;\n texCoordLM = in_texCoordLM;\n\n result = texCoordLM;\n result_16 = result;\n }\n\n {\n float3 input;\n float3 output;\n input = eyeDirectionTangent_32;\n\n output = normalize (input);\n output_37 = output;\n }\n\n {\n float3 color_dir1;\n float3 color_dir2;\n float3 color_dir3;\n float2 texCoordLM;\n float3 eyeToSurf;\n float3 normal;\n bool normal_attr_perfragment;\n sampler2D lightmap_dir1;\n sampler2D lightmap_dir2;\n sampler2D lightmap_dir3;\n sampler2D directions1;\n sampler2D directions2;\n sampler2D directions3;\n float3 specular;\n bool specular_attr_perfragment;\n color_dir2 = in_color_dir2;\n color_dir3 = in_color_dir3;\n normal = o_normal_24;\n eyeToSurf = output_37;\n texCoordLM = in_texCoordLM;\n lightmap_dir1 = in_lightmap_dir1;\n lightmap_dir2 = in_lightmap_dir2;\n lightmap_dir3 = in_lightmap_dir3;\n directions1 = in_directions1;\n directions2 = in_directions2;\n directions3 = in_directions3;\n color_dir1 = in_color_dir1;\n normal_attr_perfragment = false;\n\n float3 spec = float3(0);\n float3 baseLit[3];\n\n baseLit[0] = tex2D (lightmap_dir1, texCoordLM).rgb;\n baseLit[1] = tex2D (lightmap_dir2, texCoordLM).rgb;\n baseLit[2] = tex2D (lightmap_dir3, texCoordLM).rgb;\n\n\n float2 rawdir1 = tex2D (directions1, texCoordLM).ga * 2 -float2(1);\n float2 rawdir2 = tex2D (directions2, texCoordLM).ga * 2 -float2(1);\n float2 rawdir3 = tex2D (directions3, texCoordLM).ga * 2 -float2(1);\n\n float3 lightDir;\n lightDir.xy = rawdir1;\n lightDir.z = rawdir3.x;\n\n float3 speccol = 2 * ComputeDLMColor (lightDir, baseLit);\n\n float3 H = normalize (-eyeToSurf + lightDir);\n spec += (pow (saturate (dot (normal, H)), 32) * speccol);\n\n lightDir.xy = rawdir2;\n lightDir.z = rawdir3.y;\n\n speccol = 2 * ComputeDLMColor (lightDir, baseLit);\n\n H = normalize (-eyeToSurf + lightDir);\n spec += (pow (saturate (dot (normal, H)), 32) * speccol);\n\n specular = spec;\n specular_attr_perfragment = true;\n specular_14 = specular;\n specular_14_attr_perfragment = specular_attr_perfragment;\n }\n\n {\n float3 input;\n float4 output;\n bool output_attr_perfragment;\n input = specular_14;\n output_attr_perfragment = specular_14_attr_perfragment;\n\n output = float4 (input, 1);\n output_41 = output;\n output_41_attr_perfragment = output_attr_perfragment;\n }\n\n {\n float3 input;\n float3 output;\n input = output_38;\n\n output = mul (objectToWorld, float4 (input, 0)).xyz;\n output_39 = output;\n }\n\n {\n float3 eyeToSurf;\n float4 positionW;\n float3 normal;\n int lightOffset;\n int maxLights;\n int minLights;\n float3 diffuseColor;\n bool diffuseColor_attr_perfragment;\n float3 specularColor;\n bool specularColor_attr_perfragment;\n normal = output_39;\n minLights = int (0);\n positionW = position_world_20;\n lightOffset = output_27;\n maxLights = output_27;\n eyeToSurf = eyeDirectionWorld_30;\n\n diffuseColor = float3(0);\n specularColor = float3(0);\n half3 myEyeToSurf = eyeToSurf;\n myEyeToSurf = normalize (eyeToSurf);\n\n for (int l = 0;l < maxLights;l++)\t \n {\n int i = lightOffset + l;\n if ((i >= minLights) && (i >= lightProps.count)) break;\n\n LightSpaceWorld lightSpace;\n lightSpace.Init (i, positionW);\n\n Light light = GetCurrentLight (lightSpace, i, normal);\n float4 lightAttenuationVec = lightProps.attenuationVec[i];\n float3 d, s;\n ComputeLight (lightSpace, light, myEyeToSurf, normal, 32,\t lightProps.colorDiffuse[i], lightProps.colorSpecular[i],\t lightAttenuationVec, 1, d, s);\n\n diffuseColor += d;\n specularColor += s;\n }\n diffuseColor_attr_perfragment = true;\n specularColor_attr_perfragment = true;\n diffuseColor_6 = diffuseColor;\n specularColor_7 = specularColor;\n specularColor_7_attr_perfragment = specularColor_attr_perfragment;\n diffuseColor_6_attr_perfragment = diffuseColor_attr_perfragment;\n }\n\n {\n float3 input;\n float4 output;\n bool output_attr_perfragment;\n input = specularColor_7;\n output_attr_perfragment = specularColor_7_attr_perfragment;\n\n output = float4 (input, 1);\n output_40 = output;\n output_40_attr_perfragment = output_attr_perfragment;\n }\n\n {\n float4 a;\n float4 b;\n float4 result;\n a = output_40;\n b = output_41;\n\n result = a+b;\n result_8 = result;\n }\n\n {\n float4 input;\n float3 output;\n input = result_8;\n\n output = input.rgb;\n output_42 = output;\n }\n\n {\n float2 texCoord;\n sampler2D texDiffuse;\n float4 surfaceColor;\n bool surfaceColor_attr_perfragment;\n texDiffuse = in_texDiffuse;\n texCoord = texCoordOffset_29;\n\n surfaceColor = tex2D (texDiffuse, texCoord);\n surfaceColor_attr_perfragment = true;\n surfaceColor_28 = surfaceColor;\n surfaceColor_28_attr_perfragment = surfaceColor_attr_perfragment;\n }\n\n {\n float4 surfaceColorIn;\n bool surfaceColorIn_attr_perfragment;\n float4 color_modulation;\n float4 surfaceColorOut;\n bool surfaceColorOut_attr_perfragment;\n surfaceColorIn = surfaceColor_28;\n color_modulation = in_color_modulation;\n surfaceColorIn_attr_perfragment = surfaceColor_28_attr_perfragment;\n\n surfaceColorOut.rgba = surfaceColorIn.rgba * color_modulation.rgba;\n surfaceColorOut_attr_perfragment = surfaceColorIn_attr_perfragment;\n surfaceColorOut_18 = surfaceColorOut;\n surfaceColorOut_18_attr_perfragment = surfaceColorOut_attr_perfragment;\n }\n\n {\n float4 inputColor;\n float mixModeAlpha;\n float4 outputColor;\n inputColor = surfaceColorOut_18;\n mixModeAlpha = in_mixModeAlpha;\n\n outputColor.rgb = inputColor.rgb;\n outputColor.a = inputColor.a * mixModeAlpha;\n outputColor_11 = outputColor;\n }\n\n {\n float2 texCoord;\n sampler2D texNormal;\n float normalmap_alpha;\n bool normalmap_alpha_attr_perfragment;\n texCoord = texCoordOffset_29;\n texNormal = in_texNormal;\n\n normalmap_alpha_attr_perfragment = false;\n normalmap_alpha = 1;\n normalmap_alpha_17 = normalmap_alpha;\n normalmap_alpha_17_attr_perfragment = normalmap_alpha_attr_perfragment;\n }\n\n {\n float normalMapAlpha;\n bool normalMapAlpha_attr_perfragment;\n float2 texCoord;\n sampler2D texSpecular;\n float4 surfaceColorWithAlpha;\n bool surfaceColorWithAlpha_attr_perfragment;\n float3 specular;\n float3 specularColor;\n bool specularColor_attr_perfragment;\n texSpecular = in_texSpecular;\n normalMapAlpha = normalmap_alpha_17;\n surfaceColorWithAlpha = outputColor_11;\n texCoord = texCoordOffset_29;\n specular = in_specular;\n surfaceColorWithAlpha_attr_perfragment = true;\n normalMapAlpha_attr_perfragment = normalmap_alpha_17_attr_perfragment;\n\n specularColor = tex2D (texSpecular, texCoord).rgb * specular;\n specularColor_attr_perfragment = true;\n float weirdCoef = (normalMapAlpha+1)/2;\n specularColor *= weirdCoef;\n specularColor *= surfaceColorWithAlpha.a;\n specularColor_10 = specularColor;\n specularColor_10_attr_perfragment = specularColor_attr_perfragment;\n }\n\n {\n float2 texCoord;\n sampler2D texAO;\n float occlusionFactor;\n bool occlusionFactor_attr_perfragment;\n texCoord = result_16;\n texAO = in_texAO;\n\n occlusionFactor = 1;\n occlusionFactor_attr_perfragment = false;\n occlusionFactor_15 = occlusionFactor;\n occlusionFactor_15_attr_perfragment = occlusionFactor_attr_perfragment;\n }\n\n {\n float3 combinedAmbient;\n float3 dynamicAmbient;\n float occlusionFactor;\n bool occlusionFactor_attr_perfragment;\n float3 litColor;\n float3 color_dir1;\n float3 color_dir2;\n float3 color_dir3;\n float2 texCoordLM;\n float3 normal;\n bool normal_attr_perfragment;\n sampler2D lightmap;\n sampler2D lightmap_dir1;\n sampler2D lightmap_dir2;\n sampler2D lightmap_dir3;\n float3 ambient;\n bool ambient_attr_perfragment;\n color_dir2 = in_color_dir2;\n occlusionFactor = occlusionFactor_15;\n color_dir3 = in_color_dir3;\n texCoordLM = result_16;\n lightmap = in_lightmap;\n lightmap_dir1 = in_lightmap_dir1;\n combinedAmbient = in_combinedAmbient;\n lightmap_dir2 = in_lightmap_dir2;\n lightmap_dir3 = in_lightmap_dir3;\n litColor = in_litColor;\n normal = normal_23;\n dynamicAmbient = in_dynamicAmbient;\n color_dir1 = in_color_dir1;\n normal_attr_perfragment = normal_23_attr_perfragment;\n occlusionFactor_attr_perfragment = occlusionFactor_15_attr_perfragment;\n\n float3 ambient_dynamic = dynamicAmbient * occlusionFactor;\n float3 ambient_static;\n\n // Utilize directional LM/colors only if normal is changed per-fragment\n if (normal_attr_perfragment)\t \n {\n float3 baseLit[3];\n\n baseLit[0] = tex2D (lightmap_dir1, texCoordLM).rgb;\n baseLit[1] = tex2D (lightmap_dir2, texCoordLM).rgb;\n baseLit[2] = tex2D (lightmap_dir3, texCoordLM).rgb;\n\n ambient_static = 2 * ComputeDLMColor (normal, baseLit);\n ambient_attr_perfragment = true;\n }\n else\t \n // Use plain ol' less detailed lighting otherwise\t \t \n {\n\n ambient_static = 2 * tex2D (lightmap, texCoordLM).rgb;\n ambient_attr_perfragment = true;\n\n }\n ambient = ambient_dynamic + ambient_static;\n ambient_9 = ambient;\n ambient_9_attr_perfragment = ambient_attr_perfragment;\n }\n\n {\n float4 surfaceColor;\n bool surfaceColor_attr_perfragment;\n float4 outputColor;\n bool outputColor_attr_perfragment;\n surfaceColor = outputColor_11;\n surfaceColor_attr_perfragment = true;\n\n outputColor = surfaceColor;\n outputColor.rgb *= surfaceColor.a;\n outputColor_attr_perfragment = surfaceColor_attr_perfragment;\n outputColor_5 = outputColor;\n outputColor_5_attr_perfragment = outputColor_attr_perfragment;\n }\n\n {\n float3 lightDiffuse;\n bool lightDiffuse_attr_perfragment;\n float3 lightSpecular;\n bool lightSpecular_attr_perfragment;\n float4 surfaceDiffuse;\n bool surfaceDiffuse_attr_perfragment;\n float3 surfaceSpecular;\n bool surfaceSpecular_attr_perfragment;\n float3 ambient;\n bool ambient_attr_perfragment;\n float4 result;\n bool result_attr_perfragment;\n surfaceSpecular = specularColor_10;\n lightDiffuse = diffuseColor_6;\n lightSpecular = output_42;\n ambient = ambient_9;\n surfaceDiffuse = outputColor_5;\n ambient_attr_perfragment = ambient_9_attr_perfragment;\n lightDiffuse_attr_perfragment = diffuseColor_6_attr_perfragment;\n lightSpecular_attr_perfragment = false;\n surfaceDiffuse_attr_perfragment = outputColor_5_attr_perfragment;\n surfaceSpecular_attr_perfragment = specularColor_10_attr_perfragment;\n\n result = float4 (ambient + lightDiffuse, 1)*surfaceDiffuse + float4 (surfaceSpecular*lightSpecular, 0);\n result_attr_perfragment = ambient_attr_perfragment || surfaceDiffuse_attr_perfragment\t|| lightDiffuse_attr_perfragment\t|| surfaceSpecular_attr_perfragment\t|| lightSpecular_attr_perfragment;\n result_4 = result;\n result_4_attr_perfragment = result_attr_perfragment;\n }\n\n {\n float2 texCoord;\n sampler2D texGlow;\n float4 surfaceColor;\n float4 surfaceWithGlow;\n texGlow = in_texGlow;\n texCoord = result_16;\n surfaceColor = result_4;\n\n surfaceWithGlow = surfaceColor;\n surfaceWithGlow_3 = surfaceWithGlow;\n }\n\n {\n float4 litColor;\n float4 eyePos;\n float4 foggedColor;\n float2 fogTC;\n litColor = surfaceWithGlow_3;\n eyePos = position_camera_22;\n #ifndef PARAM_vertexToFragment_fogTC_16_UNUSED\n fogTC = vertexToFragment.fogTC_16;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n fogTC = float2(0);\n #endif\n #endif\n\n foggedColor = litColor;\n foggedColor_2 = foggedColor;\n }\n\n {\n float4 a;\n float4 hdrScale;\n float4 result;\n hdrScale = in_hdrScale;\n a = foggedColor_2;\n\n result = float4 (a.rgb*hdrScale.y+hdrScale.w, a.a);\n result_1 = result;\n }\n\n {\n float4 outputColor;\n outputColor = result_1;\n outputColor_0 = outputColor;\n }\n\n FragmentOutput OUT;\n OUT.color0 = outputColor_0;\n return OUT;\n}", _type=, customLimitsPair=, flags=) at /home/lucas/projects/cs/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cgcommon.cpp:346 #14 0x00007fffe71c1838 in CS::Plugin::GLShaderCg::csShaderGLCGFP::TryCompile (this=0x7fffd64621a8, loadFlags=5, limits=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cgfp.cpp:251 #15 0x00007fffe71c363d in CS::Plugin::GLShaderCg::csShaderGLCGFP::Compile (this=0x7fffd64621a8, cache=0x7fffca907548, tag=0x7fffffffbac0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cgfp.cpp:113 #16 0x00007fffe86f3a3d in CS::Plugin::XMLShader::csXMLShaderTech::LoadProgram (this=, resolve=0x0, node=, variant=, cacheTo=0x7fffca907548, cacheInfo=..., tag=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shadertech.cpp:1346 #17 0x00007fffe86fa096 in CS::Plugin::XMLShader::csXMLShaderTech::LoadPass (this=0x24299f0, node=0x7fffcac6c350, pass=0x7fffcab7a4b0, variant=3449, cacheFile=0x7fffd6fa1368, cacheTo=0x7fffca90dbb0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shadertech.cpp:210 #18 0x00007fffe86fb79f in CS::Plugin::XMLShader::csXMLShaderTech::Load (this=0x24299f0, ldr_context=, node=0x7fffcab69f00, parentSV=, variant=3449, cacheTo=0x7fffca90dbb0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shadertech.cpp:1630 #19 0x00007fffe870c571 in CS::Plugin::XMLShader::csXMLShader::GetTicketForTech (this=0x7fffcab6b400, modes=, stack=, eval=, lightCount=, techNum=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1368 #20 0x00007fffe870cab4 in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffcab6b400, modes=..., stack=..., eval=0x7fffca90d978, lightCount=0, tvi=2) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1414 #21 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffcab6b400, modes=..., stack=..., eval=0x7fffca90d978) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #22 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffcab6b400, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #23 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffd67ad3f0, modes=..., stack=..., eval=0x7fffcad62d48, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #24 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffd67ad3f0, modes=..., stack=..., eval=0x7fffcad62d48) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #25 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffd67ad3f0, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #26 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffd77d1988, modes=..., stack=..., eval=0x7fffd6f9f888, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #27 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffd77d1988, modes=..., stack=..., eval=0x7fffd6f9f888) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #28 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffd77d1988, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #29 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffd6463a38, modes=..., stack=..., eval=0x7fffd64659b8, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #30 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffd6463a38, modes=..., stack=..., eval=0x7fffd64659b8) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #31 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffd6463a38, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #32 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffd6963170, modes=..., stack=..., eval=0x7fffd64607a8, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #33 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffd6963170, modes=..., stack=..., eval=0x7fffd64607a8) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #34 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffd6963170, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #35 0x00007fffe870cc0d in CS::Plugin::XMLShader::csXMLShader::GetTicketForTechVar (this=0x7fffe76d7f48, modes=..., stack=..., eval=0x7fffe76db970, lightCount=0, tvi=0) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1449 #36 0x00007fffe870ce38 in CS::Plugin::XMLShader::csXMLShader::GetTicketNoSetupInternal (this=0x7fffe76d7f48, modes=..., stack=..., eval=0x7fffe76db970) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1487 #37 0x00007fffe870ced3 in CS::Plugin::XMLShader::csXMLShader::GetTicket (this=0x7fffe76d7f48, modes=..., stack=...) at /home/lucas/projects/cs/plugins/video/render3d/shader/shadercompiler/xmlshader/shader.cpp:1501 #38 0x00007fffdda42329 in void CS::RenderManager::ForEachMeshNode::ContextNode, CS::Meta::CompositeFunctorType2, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers>, CS::RenderManager::ShaderSVSetup, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers> > >(CS::RenderManager::RenderTree::ContextNode&, CS::Meta::CompositeFunctorType2, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers>, CS::RenderManager::ShaderSVSetup, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers> >&) () from /home/lucas/projects/cs/rm_unshadowed.so #39 0x00007fffdda4fa42 in void CS::RenderManager::SetupStandardTicket::ContextNode, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers>(CS::RenderManager::RenderTree::ContextNode&, iShaderManager*, CS::RenderManager::LightSetup, CS::RenderManager::MultipleRenderLayer, CS::RenderManager::ShadowNone, CS::RenderManager::MultipleRenderLayer> >::PostLightingLayers const&) () from /home/lucas/projects/cs/rm_unshadowed.so #40 0x00007fffdda5c0ac in CS::Plugin::RMUnshadowed::StandardContextSetup, CS::RenderManager::MultipleRenderLayer>::operator()(CS::RenderManager::RenderTree::ContextNode&, CS::RenderManager::StandardPortalSetup, CS::Plugin::RMUnshadowed::StandardContextSetup, CS::RenderManager::MultipleRenderLayer> >::ContextSetupData&) () from /home/lucas/projects/cs/rm_unshadowed.so #41 0x00007fffdda37b2a in CS::Plugin::RMUnshadowed::RMUnshadowed::RenderView (this=0x7fffe43c7ff8, view=0x7fffd71ed040) at /home/lucas/projects/cs/plugins/rendermanager/unshadowed/unshadowed.cpp:235 #42 0x00007fffdda3607a in CS::Plugin::RMUnshadowed::RMUnshadowed::PrecacheView (this=0x150, view=0x7fffde730735) at /home/lucas/projects/cs/plugins/rendermanager/unshadowed/unshadowed.cpp:272 #43 0x00007fffe8ef4d7a in csSector::PrecacheDraw (this=0x7fffd21ace80) at /home/lucas/projects/cs/plugins/engine/3d/sector.cpp:300 #44 0x0000000000652a50 in pawsObjectView::ContinueLoad (this=0x7fffe2011f30) at src/common/paws/pawsobjectview.cpp:155 #45 0x0000000000684cd4 in PawsManager::LoadObjectViews (this=0x10e10c0) at src/common/paws/pawsmanager.cpp:836 #46 0x00000000004a2acc in psEngine::Initialize (this=0x10d79d0, level=-562886859) at src/client/psengine.cpp:711 #47 0x00000000004dde8f in pawsSplashWindow::Draw (this=0x7fffe068a450) at src/client/gui/pawssplashwindow.cpp:56 #48 0x000000000065907f in pawsWidget::DrawChildren (this=0x7fffe0686e10) at src/common/paws/pawswidget.cpp:1335 #49 0x000000000051ebae in psMainWidget::DrawChildren (this=0x150) at src/client/gui/psmainwidget.cpp:518 #50 0x00000000006850ce in PawsManager::Draw (this=0x10e10c0) at src/common/paws/pawsmanager.cpp:628 #51 0x00000000004ad498 in psEngine::EventHandler2D::HandleEvent(iEvent&) () #52 0x00007ffff76f987c in csEventTree::Dispatch (this=0xa3f670, e=...) at /home/lucas/projects/cs/libs/csutil/cssubscription.cpp:576 #53 0x00007ffff76f9ce0 in csEventTree::Notify (this=0xa3f670) at /home/lucas/projects/cs/libs/csutil/cssubscription.cpp:546 #54 0x00007ffff769b184 in csEventQueue::Notify (this=0x7fffffff1bc0, name=) at /home/lucas/projects/cs/libs/csutil/cseventq.cpp:240 #55 0x00007ffff769b4c2 in csEventQueue::Process (this=0x7ffff7f91728) at /home/lucas/projects/cs/libs/csutil/cseventq.cpp:256 #56 0x00007ffff7727e66 in csDefaultRunLoop (r=0x7ffff7fcf8f8) at /home/lucas/projects/cs/libs/csutil/generic/runloop.cpp:99 #57 0x00000000004a36ac in main (argc=, argv=) at src/client/psengine.cpp:1920 #7 0x00007fffde6a0bb2 in _mesa_parse_arb_program (ctx=0xd498e0, target=34820, str=0x2b2b120 "!!ARBfp1.0\n# cgc version 2.2.0010, build date Sep 29 2009\n# command line args: -q -profile arbfp1 -entry fragmentMain -O3 -DPROFILE_ARBFP1 -DVERT_PROFILE_ARBVP1 -DFRAG_PROFILE_ARBFP1 -DFRAGMENT_PROGRAM_LEVEL=0x200 -DVENDOR_OTHER -DPROGRAM_TYPE_FRAGMENT -po MaxLocalParams=1024 -po MaxTexIndirections=4 -po NumInstructionSlots=96 -po NumMathInstructionSlots=64 -po NumTemps=256 -po NumTexInstructionSlots=32\n#vendor NVIDIA Corporation\n#version 2.2.0.10\n#profile arbfp1\n#program fragmentMain\n#semantic fragmentMain.fragmentIn\n#semantic _clip_out_packed_distances1\n#semantic _clip_out_packed_distances2\n#semantic objectToWorld\n#semantic lightProps\n#semantic lightPropsSM\n#var float2 vertexToFragment.texCoord_0 : $vin.TEX0 : TEX0 : 0 : 1\n#var float2 vertexToFragment.texCoordLM_2 : $vin.TEX1 : TEX1 : 0 : 1\n#var float3 vertexToFragment.eyeDirectionTangent_15 : $vin.TEX2 : TEX2 : 0 : 1\n#var float4x4 fragmentIn.ModelView : state.matrix.modelview : , 4 : 1 : 0\n#var float4x4 fragmentIn.objectToWorld : : c[0], 4 : 1 : 0\n#var float4 fragmentIn.eyePosWorld : : c[4] : 1 : 0\n#var sampler2D fragmentIn.texHeight : : : 1 : 0\n#var float4 fragmentIn.texHeight_Cg_WTF : : : 1 : 0\n#var float fragmentIn.heightMapScale : : : 1 : 0\n#var float2 fragmentIn.sampleLimits : : : 1 : 0\n#var sampler2D fragmentIn.texDiffuse : : texunit 6 : 1 : 1\n#var float4 fragmentIn.texDiffuse_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.texNormal : : : 1 : 0\n#var float4 fragmentIn.texNormal_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.texNormalCompressed : : : 1 : 0\n#var float4 fragmentIn.texNormalCompressed_Cg_WTF : : : 1 : 0\n#var float4 fragmentIn.color_modulation : : c[5] : 1 : 1\n#var float fragmentIn.mixModeAlpha : : c[6] : 1 : 1\n#var sampler2D fragmentIn.texAO : : : 1 : 0\n#var float4 fragmentIn.texAO_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.lightmap_dir1 : : texunit 0 : 1 : 1\n#var float4 fragmentIn.lightmap_dir1_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.lightmap_dir2 : : texunit 1 : 1 : 1\n#var float4 fragmentIn.lightmap_dir2_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.lightmap_dir3 : : texunit 2 : 1 : 1\n#var float4 fragmentIn.lightmap_dir3_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.directions1 : : texunit 3 : 1 : 1\n#var float4 fragmentIn.directions1_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.directions2 : : texunit 4 : 1 : 1\n#var float4 fragmentIn.directions2_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.directions3 : : texunit 5 : 1 : 1\n#var float4 fragmentIn.directions3_Cg_WTF : : : 1 : 0\n#var sampler2D fragmentIn.texSpecular : : texunit 7 : 1 : 1\n#var float4 fragmentIn.texSpecular_Cg_WTF : : : 1 : 0\n#var float3 fragmentIn.specular : : c[7] : 1 : 1\n#var float3 fragmentIn.combinedAmbient : : : 1 : 0\n#var float3 fragmentIn.dynamicAmbient : : c[8] : 1 : 1\n#var sampler2D fragmentIn.lightmap : : texunit 8 : 1 : 1\n#var float4 fragmentIn.lightmap_Cg_WTF : : : 1 : 0\n#var float4 fragmentIn.hdrScale : : c[9] : 1 : 1\n#var sampler2D fragmentIn.fogTex : : : 1 : 0\n#var float4 fragmentIn.fogTex_Cg_WTF : : : 1 : 0\n#var float4 fragmentIn.fogColor : : : 1 : 0\n#var float fragmentIn.fogFadeEnd : : : 1 : 0\n#var float fragmentIn.fogFadeStart : : : 1 : 0\n#var float fragmentIn.fogLimit : : : 1 : 0\n#var float4 _clip_out_packed_distances1 : : : -1 : 0\n#var float4 _clip_out_packed_distances2 : : : -1 : 0\n#var float4x4 objectToWorld : : , 4 : -1 : 0\n#var int lightProps.count : : : -1 : 0\n#var float4 lightProps.posWorld[0] : : : -1 : 0\n#var float4 lightProps.posWorld[1] : : : -1 : 0\n#var float4 lightProps.posWorld[2] : : : -1 : 0\n#var float4 lightProps.posWorld[3] : : : -1 : 0\n#var float4 lightProps.posWorld[4] : : : -1 : 0\n#var float4 lightProps.posWorld[5] : : : -1 : 0\n#var float4 lightProps.posWorld[6] : : : -1 : 0\n#var float4 lightProps.posWorld[7] : : : -1 : 0\n#var float4x4 lightProps.transform[0] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[1] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[2] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[3] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[4] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[5] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[6] : : , 4 : -1 : 0\n#var float4x4 lightProps.transform[7] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[0] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[1] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[2] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[3] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[4] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[5] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[6] : : , 4 : -1 : 0\n#var float4x4 lightProps.transformInv[7] : : , 4 : -1 : 0\n#var float3 lightProps.colorDiffuse[0] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[1] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[2] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[3] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[4] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[5] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[6] : : : -1 : 0\n#var float3 lightProps.colorDiffuse[7] : : : -1 : 0\n#var float3 lightProps.colorSpecular[0] : : : -1 : 0\n#var float3 lightProps.colorSpecular[1] : : : -1 : 0\n#var float3 lightProps.colorSpecular[2] : : : -1 : 0\n#var float3 lightProps.colorSpecular[3] : : : -1 : 0\n#var float3 lightProps.colorSpecular[4] : : : -1 : 0\n#var float3 lightProps.colorSpecular[5] : : : -1 : 0\n#var float3 lightProps.colorSpecular[6] : : : -1 : 0\n#var float3 lightProps.colorSpecular[7] : : : -1 : 0\n#var float4 lightProps.attenuationVec[0] : : : -1 : 0\n#var float4 lightProps.attenuationVec[1] : : : -1 : 0\n#var float4 lightProps.attenuationVec[2] : : : -1 : 0\n#var float4 lightProps.attenuationVec[3] : : : -1 : 0\n#var float4 lightProps.attenuationVec[4] : : : -1 : 0\n#var float4 lightProps.attenuationVec[5] : : : -1 : 0\n#var float4 lightProps.attenuationVec[6] : : : -1 : 0\n#var float4 lightProps.attenuationVec[7] : : : -1 : 0\n#var float lightProps.falloffInner[0] : : : -1 : 0\n#var float lightProps.falloffInner[1] : : : -1 : 0\n#var float lightProps.falloffInner[2] : : : -1 : 0\n#var float lightProps.falloffInner[3] : : : -1 : 0\n#var float lightProps.falloffInner[4] : : : -1 : 0\n#var float lightProps.falloffInner[5] : : : -1 : 0\n#var float lightProps.falloffInner[6] : : : -1 : 0\n#var float lightProps.falloffInner[7] : : : -1 : 0\n#var float lightProps.falloffOuter[0] : : : -1 : 0\n#var float lightProps.falloffOuter[1] : : : -1 : 0\n#var float lightProps.falloffOuter[2] : : : -1 : 0\n#var float lightProps.falloffOuter[3] : : : -1 : 0\n#var float lightProps.falloffOuter[4] : : : -1 : 0\n#var float lightProps.falloffOuter[5] : : : -1 : 0\n#var float lightProps.falloffOuter[6] : : : -1 : 0\n#var float lightProps.falloffOuter[7] : : : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[0] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[1] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[2] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[3] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[4] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[5] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[6] : : , 4 : -1 : 0\n#var float4x4 lightPropsSM.shadowMapTF[7] : : , 4 : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[0] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[1] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[2] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[3] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[4] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[5] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[6] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMap[7] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[0] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[1] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[2] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[3] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[4] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[5] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[6] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapPixels[7] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[0] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[1] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[2] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[3] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[4] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[5] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[6] : : : -1 : 0\n#var float4 lightPropsSM.shadowMapUnscale[7] : : : -1 : 0\n#var sampler2D lightPropsSM.shadowMapNoise : : : -1 : 0\n#var float4 fragmentMain.color0 : $vout.COLOR0 : COL : -1 : 1\n#var float fragmentMain.depth : $vout.DEPTH : : -1 : 0\n#const c[10] = 2 1 32 0\n#const c[11] = -0.40824801 0.70710701 0.57735002 -0.70710701\n#const c[12] = 0.81649703 0 0.57735002\n#default _clip_out_packed_distances1 = 0 0 0 0\n#default _clip_out_packed_distances2 = 0 0 0 0\nPARAM c[13] = { program.local[0..9],\n\t\t{ 2, 1, 32, 0 },\n\t\t{ -0.40824801, 0.70710701, 0.57735002, -0.70710701 },\n\t\t{ 0.81649703, 0, 0.57735002 } };\nTEMP R0;\nTEMP R1;\nTEMP R2;\nTEMP R3;\nTEMP R4;\nTEMP R5;\nTEMP R6;\nTEMP R7;\nTEMP R8;\nTEMP R9;\nTEX R3.yw, fragment.texcoord[1], texture[5], 2D;\nTEX R0, fragment.texcoord[0], texture[6], 2D;\nTEX R1.xyz, fragment.texcoord[1], texture[8], 2D;\nTEX R2.xyz, fragment.texcoord[0], texture[7], 2D;\nTEX R8.yw, fragment.texcoord[1], texture[4], 2D;\nTEX R5.yw, fragment.texcoord[1], texture[3], 2D;\nTEX R6.xyz, fragment.texcoord[1], texture[0], 2D;\nTEX R4.xyz, fragment.texcoord[1], texture[2], 2D;\nTEX R7.xyz, fragment.texcoord[1], texture[1], 2D;\nMAD R3.zw, R3.xyyw, c[10].x, -c[10].y;\nMUL R0, R0, c[5];\nMUL R0.w, R0, c[6].x;\nDP3 R1.w, fragment.texcoord[2], fragment.texcoord[2];\nMUL R2.xyz, R2, c[7];\nMUL R1.xyz, R1, c[10].x;\nMOV R5.z, R3;\nMAD R5.xy, R5.ywzw, c[10].x, -c[10].y;\nMAD R8.xy, R8.ywzw, c[10].x, -c[10].y;\nMOV R8.z, R3.w;\nRSQ R1.w, R1.w;\nDP3_SAT R3.x, R5, c[11];\nDP3_SAT R3.z, R5, c[11].xwzw;\nDP3_SAT R3.y, R5, c[12];\nMUL R3.xyz, R3, R3;\nMUL R9.xyz, R3.y, R7;\nMAD R9.xyz, R3.x, R6, R9;\nMAD R3.xyz, R3.z, R4, R9;\nMAD R5.xyz, -R1.w, fragment.texcoord[2], R5;\nMUL R2.xyz, R0.w, R2;\nDP3_SAT R9.x, R8, c[11];\nDP3_SAT R9.z, R8, c[11].xwzw;\nDP3_SAT R9.y, R8, c[12];\nMUL R9.xyz, R9, R9;\nMUL R7.xyz, R7, R9.y;\nMAD R7.xyz, R6, R9.x, R7;\nMAD R6.xyz, -R1.w, fragment.texcoord[2], R8;\nDP3 R2.w, R6, R6;\nRSQ R1.w, R2.w;\nDP3 R2.w, R5, R5;\nMUL_SAT R1.w, R1, R6.z;\nRSQ R2.w, R2.w;\nPOW R1.w, R1.w, c[10].z;\nMAD R4.xyz, R4, R9.z, R7;\nMUL_SAT R2.w, R2, R5.z;\nMUL R4.xyz, R4, R1.w;\nPOW R1.w, R2.w, c[10].z;\nMAD R3.xyz, R3, R1.w, R4;\nMUL R2.xyz, R3, R2;\nMUL R2.xyz, R2, c[10].x;\nMUL R0.xyz, R0, R0.w;\nADD R1.xyz, R1, c[8];\nMOV R2.w, c[10];\nMOV R1.w, c[10].y;\nMAD R0, R1, R0, R2;\nMAD result.color.xyz, R0, c[9].y, c[9].w;\nMOV result.color.w, R0;\nEND\n# 56 instructions, 10 R-regs\n", len=11122, state=0x7fffffff6cb0) from /usr/lib64/dri/r300_dri.so Current language: auto The current source language is "auto; currently c". #13 0x00007fffe71db383 in CS::Plugin::GLShaderCg::csShaderGLCGCommon::DefaultLoadProgram (this=0x7fffd64621a8, cgResolve=, programStr=0x2b1aa70 "#define PARAM__clip_out_packed_distances1_UNUSED\n#define PARAM_vertexToFragment_color_dir3_5_UNUSED\n#define PARAM_vertexToFragment_Normal_1_UNUSED\n#define PARAM_vertexToFragment_litColor_6_UNUSED\n#define PARAM_vertexToFragment_Tangent_7_UNUSED\n#define PARAM_vertexToFragment_position_world_12_UNUSED\n#define PARAM_vertexToFragment_position_object_11_UNUSED\n#define PARAM_vertexToFragment_color_dir1_3_UNUSED\n#define PARAM_vertexToFragment_position_screen_10_UNUSED\n#define PARAM__clip_out_packed_distances2_UNUSED\n#define PARAM_vertexToFragment_Bitangent_8_UNUSED\n#define PARAM_vertexToFragment_position_camera_13_UNUSED\n#define PARAM_vertexToFragment_color_dir2_4_UNUSED\n#define PARAM_vertexToFragment_eyeDirectionObj_14_UNUSED\n#define PARAM_vertexToFragment_fogTC_16_UNUSED\n#define _INITIALIZE_UNUSED_V2F\n#ifdef PROGRAM_TYPE_VERTEX\n struct _ClipPlanes\n {\n uniform float4 plane0;\n uniform float4 plane1;\n uniform float4 plane2;\n uniform float4 plane3;\n uniform float4 plane4;\n uniform float4 plane5;\n uniform float4 packedDists0;\n uniform float4 packedDists1;\n };\n _ClipPlanes _clipPlanes;\n\n #if (defined(VERT_PROFILE_VP40) || defined(VERT_PROFILE_GP4VP))\n #define _CLIP_OUTPUT(N) out varying float _clip_ ## N : CLP ## N;\n #define _CLIP_OUTPUT_UNUSED(N) float _clip_ ## N;\n #else\n #define _CLIP_OUTPUT(N)\n #define _CLIP_OUTPUT_UNUSED(N)\n #ifndef PARAM__clip_out_packed_distances1_UNUSED\n out varying float4 _clip_out_packed_distances1 : TEXCOORD7;\n #endif\n #ifndef PARAM__clip_out_packed_distances2_UNUSED\n out varying float4 _clip_out_packed_distances2 : TEXCOORD6;\n #endif\n #endif\n#else\n #if !((defined(VERT_PROFILE_VP40) || defined(VERT_PROFILE_GP4VP)))\n #ifndef PARAM__clip_out_packed_distances1_UNUSED\n in varying float4 _clip_out_packed_distances1 : TEXCOORD7;\n #else\n float4 _clip_out_packed_distances1 = float4(0);\n #endif\n #ifndef PARAM__clip_out_packed_distances2_UNUSED\n in varying float4 _clip_out_packed_distances2 : TEXCOORD6;\n #else\n float4 _clip_out_packed_distances2 = float4(0);\n #endif\n #endif\n#endif\n\n#ifdef PROGRAM_TYPE_VERTEX\n #define _CLIP_COMPUTE_DIST(N, CLIP_POS) \\\n float _clip_dist ## N = dot (_clipPlanes.plane ## N, CLIP_POS); \\\n _clip_dist ## N -= (N < 4) \\\n\t? _clipPlanes.packedDists0[N] \\\n\t: _clipPlanes.packedDists1[N-4];\n #define _CLIP_COMPUTE_DIST_CD(N, CLIP_POS, CLIP_DIST) \\\n float _clip_dist ## N = dot (_clipPlanes.plane ## N, CLIP_POS); \\\n _clip_dist ## N -= CLIP_DIST;\n #define _CLIP_UNUSED(N) \\\n float _clip_dist ## N = 0;\n#else\n#endif\n\n#ifdef PROGRAM_TYPE_VERTEX\n#define _CLIP_COMPUTE_DISTS(P_Eye, P_World, P_Object) \\\n_CLIP_COMPUTE_DIST_CD(0, P_World, 0.000000) \\\n_CLIP_COMPUTE_DIST(1, P_Eye) \\\n_CLIP_COMPUTE_DIST(2, P_Eye) \\\n_CLIP_UNUSED(3) \\\n_CLIP_UNUSED(4) \\\n_CLIP_UNUSED(5) \n_CLIP_OUTPUT(0)\n_CLIP_OUTPUT(1)\n_CLIP_OUTPUT(2)\n_CLIP_OUTPUT_UNUSED(3)\n_CLIP_OUTPUT_UNUSED(4)\n_CLIP_OUTPUT_UNUSED(5)\n#endif\n\n#ifdef PROGRAM_TYPE_FRAGMENT\n#define _CLIP_TO_DISTS \\\nclip (_clip_out_packed_distances1); \n#endif\n\n#ifdef PROGRAM_TYPE_VERTEX\n #if (defined(VERT_PROFILE_VP40) || defined(VERT_PROFILE_GP4VP))\n #define APPLY_CLIPPING_VP(P_Eye, P_World, P_Object) \\\n _CLIP_COMPUTE_DISTS(P_Eye, P_World, P_Object) \\\n _clip_0 = _clip_dist0; \\\n _clip_1 = _clip_dist1; \\\n _clip_2 = _clip_dist2; \\\n _clip_3 = _clip_dist3; \\\n _clip_4 = _clip_dist4; \\\n _clip_5 = _clip_dist5;\n #define APPLY_CLIPPING_VP_POSINV(P_Eye, P_World, P_Object) APPLY_CLIPPING_VP(P_Eye, P_World, P_Object)\n #else\n #define APPLY_CLIPPING_VP_POSINV(P_Eye, P_World, P_Object)\n #if defined(VENDOR_ATI)\n #define APPLY_CLIPPING_VP(P_Eye, P_World, P_Object) APPLY_CLIPPING_VP_POSINV(P_Eye, P_World, P_Object)\n #else\n #ifndef PARAM__clip_out_packed_distances1_UNUSED\n #define _CLIP_PACK_DISTS_1 \\\n _clip_out_packed_distances1.x = _clip_dist0; \\\n _clip_out_packed_distances1.y = _clip_dist1; \\\n _clip_out_packed_distances1.z = _clip_dist2; \\\n _clip_out_packed_distances1.w = _clip_dist3;\n #else\n #define _CLIP_PACK_DISTS_1\n #endif\n #ifndef PARAM__clip_out_packed_distances2_UNUSED\n #define _CLIP_PACK_DISTS_2 \\\n _clip_out_packed_distances2.x = _clip_dist4; \\\n _clip_out_packed_distances2.y = _clip_dist5; \\\n _clip_out_packed_distances2.z = 0; \\\n _clip_out_packed_distances2.w = 0;\n #else\n #define _CLIP_PACK_DISTS_2\n #endif\n #define APPLY_CLIPPING_VP(P_Eye, P_World, P_Object) \\\n _CLIP_COMPUTE_DISTS(P_Eye, P_World, P_Object) \\\n _CLIP_PACK_DISTS_1 \\\n _CLIP_PACK_DISTS_2\n #endif\n #endif\n#else\n #define APPLY_CLIPPING_FP_POSINV\n #if ((defined(VERT_PROFILE_VP40) || defined(VERT_PROFILE_GP4VP)))\n #define APPLY_CLIPPING_FP\n #else\n #if defined(VENDOR_ATI)\n #define APPLY_CLIPPING_FP APPLY_CLIPPING_FP_POSINV\n #else\n #define APPLY_CLIPPING_FP _CLIP_TO_DISTS\n #endif\n #endif\n#endif\n\n//@@UNUSED? PARAM_vertexToFragment_texCoord_0_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_Normal_1_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_texCoordLM_2_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_color_dir1_3_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_color_dir2_4_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_color_dir3_5_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_litColor_6_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_Tangent_7_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_Bitangent_8_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_9_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_screen_10_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_object_11_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_world_12_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_position_camera_13_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_eyeDirectionObj_14_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_eyeDirectionTangent_15_UNUSED\n//@@UNUSED? PARAM_vertexToFragment_fogTC_16_UNUSED\n\n\n#ifndef __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n#define __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n\n/*\n objectToWorld transform, set by the position snippet.\n Global variable instance of an (as usual) privately pulled input\n as objectToWorld may be set in different ways (notably in instanced\n vs 'normal' rendering) which only the position snippet really\n knows.\n */\nfloat4x4 objectToWorld;\n\nvoid SetGlobalObjectToWorld (float4x4 o2w)\n{\n objectToWorld = o2w;\n}\n\n#endif // __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n \n\n\n#ifndef __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n#define __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n\n/*\n objectToWorld transform, set by the position snippet.\n Global variable instance of an (as usual) privately pulled input\n as objectToWorld may be set in different ways (notably in instanced\n vs 'normal' rendering) which only the position snippet really\n knows.\n */\nfloat4x4 objectToWorld;\n\nvoid SetGlobalObjectToWorld (float4x4 o2w)\n{\n objectToWorld = o2w;\n}\n\n#endif // __CG_GLOBAL_OBJECTTOWORLD_CG_INC__\n \n\n\n#ifndef __DIRECTIONAL_LMS_CG_INC__\n#define __DIRECTIONAL_LMS_CG_INC__\n\nfloat3 ComputeDLMCoeff (float3 direction)\n{\n /* These should really match up with those in lighter2... */\n float3 base[3] = \n { \n float3 (/* -1/sqrt(6) */ -0.408248, /* 1/sqrt(2) */ 0.707107, /* 1/sqrt(3) */ 0.577350),\n float3 (/* sqrt(2/3) */ 0.816497, 0, /* 1/sqrt(3) */ 0.577350),\n float3 (/* -1/sqrt(6) */ -0.408248, /* -1/sqrt(2) */ -0.707107, /* 1/sqrt(3) */ 0.577350)\n };\n\n float3 coeff = float3 (saturate (dot (direction, base[0])),\n saturate (dot (direction, base[1])),\n saturate (dot (direction, base[2])));\n return coeff * coeff;\n}\n\nfloat3 ComputeDLMColor (float3 direction, float3 baseColor[3])\n{\n float3 coeff = ComputeDLMCoeff (direction);\n return (coeff.x * baseColor[0]\n + coeff.y * baseColor[1]\n + coeff.z * baseColor[2]);\n}\n\n#endif // __DIRECTIONAL_LMS_CG_INC__\n \n\n\n#ifndef __LIGHTFUNCS_CG_INC__\n#define __LIGHTFUNCS_CG_INC__\n\n#define MAX_LIGHTS 8\n\nhalf Attenuation_Linear (float d, float invLightRadius)\n{\n return (half)(saturate (1 - d * invLightRadius));\n}\n\nhalf Attenuation_Inverse (float d)\n{\n return 1/d;\n}\n\nhalf Attenuation_Realistic (float d)\n{\n return 1/(d*d);\n}\n\nhalf Attenuation_CLQ (float d, float3 coeff)\n{\n return 1/(dot (float3 (1, d, d*d), float3 (coeff)));\n}\n\nhalf Light_Spot (half3 surfToLight, half3 lightDir, half falloffInner, half falloffOuter)\n{\n return smoothstep (falloffOuter, falloffInner, dot (surfToLight, lightDir));\n}\n\n\nstruct LightProperties\n{\n // Number of lights provided\n int count;\n // Light world-space position\n float4 posWorld[MAX_LIGHTS];\n // Transformation from light space to world space\n float4x4 transform[MAX_LIGHTS];\n // Transformation from world space to light space\n float4x4 transformInv[MAX_LIGHTS];\n // Diffuse color\n float3 colorDiffuse[MAX_LIGHTS];\n // Specular color\n float3 colorSpecular[MAX_LIGHTS];\n // Attenuation vector (XYZ are CLQ coefficients; W is light radius)\n float4 attenuationVec[MAX_LIGHTS];\n // Cosine of inner falloff angle\n float falloffInner[MAX_LIGHTS];\n // Cosine of outerr falloff angle\n float falloffOuter[MAX_LIGHTS];\n};\nLightProperties lightProps;\n\ninterface LightSpace\n{\n half3 GetDirection();\n half3 GetSurfaceToLight();\n float GetLightDistance ();\n};\n\nstruct LightSpaceWorld : LightSpace\n{\n half3 dir;\n half3 surfToLight;\n float lightDist;\n\n void Init (int lightNum, float4 surfPositionWorld)\n {\n float4 pos = lightProps.posWorld[lightNum];\n float4x4 lightTransform = lightProps.transform[lightNum];\n float3 lightDirW = mul (lightTransform, float4 (0, 0, 1, 0)).xyz;\n dir = lightDirW;\n /* Compute distance between surface and light with float precision to\n avoid precision issues with GF6 (see trac #561). */\n float3 surfToLightF = (pos - surfPositionWorld).xyz;\n lightDist = length (surfToLightF);\n surfToLight = normalize (surfToLightF);\n }\n half3 GetDirection() { return dir; }\n half3 GetSurfaceToLight() { return surfToLight; }\n float GetLightDistance () {return lightDist; }\n};\n\nstruct LightSpaceTangent : LightSpace\n{\n half3 dir;\n half3 surfToLight;\n float lightDist;\n \n void InitVP (int lightNum, \n", ' ' , "float4x4 world2tangent, float4 surfPositionWorld,\n", ' ' , "out half3 vp_dir, out float3 vp_surfToLight)\n {\n float4 pos = lightProps.posWorld[lightNum];\n float4x4 lightTransform = lightProps.transform[lightNum];\n float4 lightDirW = mul (lightTransform, float4 (0, 0, 1, 0));\n vp_dir = mul (world2tangent, lightDirW).xyz;\n vp_surfToLight = mul (world2tangent, float4 ((pos - surfPositionWorld).xyz, 0)).xyz;\n }\n\n void Init (half3 vp_dir, float3 vp_surfToLight)\n {\n dir = vp_dir;\n lightDist = length (vp_surfToLight);\n surfToLight = normalize (vp_surfToLight);\n }\n half3 GetDirection() { return dir; }\n half3 GetSurfaceToLight() { return surfToLight; }\n float GetLightDistance () {return lightDist; }\n};\n\ninterface Shadow\n{\n half GetVisibility();\n};\n\nstruct ShadowNone : Shadow\n{\n half GetVisibility() { return 1; }\n};\n\ninterface ShadowShadowMap /*: Shadow*/\n{\n half GetVisibility();\n\n void InitVP (int lightNum, float4 surfPositionWorld,\n", ' ' , "float3 normWorld,\n", ' ' , "out float4 vp_shadowMapCoords,\n", ' ' , "out float vp_gradientApprox);\n void Init (int lightNum, float4 vp_shadowMapCoords, float vp_gradient);\n};\n\nstruct ShadowShadowMapNone : ShadowShadowMap\n{\n half GetVisibility() { return 1; }\n \n void InitVP (int lightNum, float4 surfPositionWorld,\n", ' ' , "float3 normWorld,\n", ' ' , "out float4 vp_shadowMapCoords,\n", ' ' , "out float vp_gradientApprox) {}\n void Init (int lightNum, float4 vp_shadowMapCoords, float vp_gradient) {}\n};\n\nstruct ShadowShadowShadowMapWrapper : Shadow\n{\n ShadowShadowMap shadow;\n \n half GetVisibility() { return shadow.GetVisibility(); }\n};\n\nstruct LightPropertiesShadowMap\n{\n // Transformation from light to shadow map space\n float4x4 shadowMapTF[MAX_LIGHTS];\n // Shadow map\n sampler2D shadowMap[MAX_LIGHTS];\n // Shadow map pixel size + dimensions\n float4 shadowMapPixels[MAX_LIGHTS];\n float4 shadowMapUnscale[MAX_LIGHTS];\n \n sampler2D shadowMapNoise;\n};\nLightPropertiesShadowMap lightPropsSM;\n\ninterface Light\n{\n half3 GetIncidence();\n half GetAttenuation();\n};\n\nstruct LightDirectional : Light\n{\n half3 dir;\n \n void Init (LightSpace space)\n {\n dir = -space.GetDirection();\n }\n half3 GetIncidence() { return dir; }\n half GetAttenuation() { return 1; }\n};\n\nstruct LightPoint : Light\n{\n half3 dir;\n \n void Init (LightSpace space)\n {\n dir = space.GetSurfaceToLight();\n }\n half3 GetIncidence() { return dir; }\n half GetAttenuation() { return 1; }\n};\n\nstruct LightSpot : Light\n{\n half3 dir;\n half spot;\n \n void Init (LightSpace space, half3 normal, half falloffInner, half falloffOuter)\n {\n dir = -space.GetDirection();\n spot = Light_Spot (space.GetSurfaceToLight(), dir, falloffInner, falloffOuter);\n }\n half3 GetIncidence() { return dir; }\n half GetAttenuation() { return spot; }\n};\n\n\nLight GetCurrentLight (LightSpace lightSpace, int lightNum, half3 surfNormal)\n{\n\n LightPoint lp;\n lp.Init (lightSpace);\n return lp;\n\n}\n\n\nvoid ComputeLight (LightSpace lightSpace, Light light, \n", ' ' , "half3 eyeToSurf, half3 surfNormal,\n", ' ' , "half surfShininess, \n", ' ' , "float3 lightDiffuse, float3 lightSpecular,\n", ' ' , "float4 lightAttenuationVec,\n", ' ' , "half shadowFactor,\n", ' ' , "out float3 d, out float3 s)\n{\n half3 L = light.GetIncidence();\n half3 H = normalize (lightSpace.GetSurfaceToLight() - eyeToSurf);\n half spot = light.GetAttenuation();\n \n float4 lightCoeff = lit (dot (surfNormal, L), dot (surfNormal, H),\n surfShininess);\n \n float lightDist = lightSpace.GetLightDistance();\n half attn;\n float invAttnRadius = lightAttenuationVec.w;\n if (invAttnRadius > 0)\n attn = Attenuation_Linear (lightDist, invAttnRadius);\n else\n attn = Attenuation_CLQ (lightDist, lightAttenuationVec.xyz);\n \n attn *= shadowFactor;\n\n d = lightDiffuse * lightCoeff.y * spot * attn;\n s = lightSpecular * lightCoeff.z * spot * attn;\n}\n\n#endif // __LIGHTFUNCS_CG_INC__\n \n\n\n#ifndef __DIRECTIONAL_LMS_CG_INC__\n#define __DIRECTIONAL_LMS_CG_INC__\n\nfloat3 ComputeDLMCoeff (float3 direction)\n{\n /* These should really match up with those in lighter2... */\n float3 base[3] = \n { \n float3 (/* -1/sqrt(6) */ -0.408248, /* 1/sqrt(2) */ 0.707107, /* 1/sqrt(3) */ 0.577350),\n float3 (/* sqrt(2/3) */ 0.816497, 0, /* 1/sqrt(3) */ 0.577350),\n float3 (/* -1/sqrt(6) */ -0.408248, /* -1/sqrt(2) */ -0.707107, /* 1/sqrt(3) */ 0.577350)\n };\n\n float3 coeff = float3 (saturate (dot (direction, base[0])),\n saturate (dot (direction, base[1])),\n saturate (dot (direction, base[2])));\n return coeff * coeff;\n}\n\nfloat3 ComputeDLMColor (float3 direction, float3 baseColor[3])\n{\n float3 coeff = ComputeDLMCoeff (direction);\n return (coeff.x * baseColor[0]\n + coeff.y * baseColor[1]\n + coeff.z * baseColor[2]);\n}\n\n#endif // __DIRECTIONAL_LMS_CG_INC__\n \n\n\nstruct vertex2fragment\n{\n void dummy() {}\n#ifdef HAVE_ARB_color_buffer_float\n#define _V2F_AUTOSEMANTIC_0\t: COLOR1\n#define _V2F_AUTOSEMANTIC_1\t: COLOR0\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_0\n#define _V2F_AUTOSEMANTIC_CURRENT\t0\n#else\n#define _V2F_AUTOSEMANTIC\n#endif\n#ifndef PARAM_vertexToFragment_texCoord_0_UNUSED\n varying float2 texCoord_0 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_Normal_1_UNUSED\n varying float3 Normal_1 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_texCoordLM_2_UNUSED\n varying float2 texCoordLM_2 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_color_dir1_3_UNUSED\n varying float3 color_dir1_3 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_color_dir2_4_UNUSED\n varying float3 color_dir2_4 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_color_dir3_5_UNUSED\n varying float3 color_dir3_5 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_litColor_6_UNUSED\n varying float3 litColor_6 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_Tangent_7_UNUSED\n varying float3 Tangent_7 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_Bitangent_8_UNUSED\n varying float3 Bitangent_8 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_position_9_UNUSED\n varying float4 position_9 : POSITION;\n#endif\n#ifndef PARAM_vertexToFragment_position_screen_10_UNUSED\n varying float4 position_screen_10 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_position_object_11_UNUSED\n varying float4 position_object_11 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_position_world_12_UNUSED\n varying float4 position_world_12 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_position_camera_13_UNUSED\n varying float4 position_camera_13 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_eyeDirectionObj_14_UNUSED\n varying float3 eyeDirectionObj_14 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_eyeDirectionTangent_15_UNUSED\n varying float3 eyeDirectionTangent_15 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#ifndef PARAM_vertexToFragment_fogTC_16_UNUSED\n varying float2 fogTC_16 _V2F_AUTOSEMANTIC ;\n#ifdef HAVE_ARB_color_buffer_float\n#if 0\n#elif _V2F_AUTOSEMANTIC_CURRENT == 0\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t1\n#define _V2F_AUTOSEMANTIC\t_V2F_AUTOSEMANTIC_1\n#elif _V2F_AUTOSEMANTIC_CURRENT == 1\n#undef _V2F_AUTOSEMANTIC_CURRENT\n#undef _V2F_AUTOSEMANTIC\n#define _V2F_AUTOSEMANTIC_CURRENT\t2\n#define _V2F_AUTOSEMANTIC\n#endif\n#endif\n#endif\n#undef _V2F_AUTOSEMANTIC_0\n#undef _V2F_AUTOSEMANTIC_1\n#undef _V2F_AUTOSEMANTIC\n};\n\nstruct FragmentInput\n{\n void dummy() {}\n uniform float4x4 ModelView : state.matrix.modelview;\n uniform float4x4 objectToWorld;\n uniform float4 eyePosWorld;\n uniform sampler2D texHeight;\n uniform float4 texHeight_Cg_WTF;\n uniform float heightMapScale;\n uniform float2 sampleLimits;\n uniform sampler2D texDiffuse;\n uniform float4 texDiffuse_Cg_WTF;\n uniform sampler2D texNormal;\n uniform float4 texNormal_Cg_WTF;\n uniform sampler2D texNormalCompressed;\n uniform float4 texNormalCompressed_Cg_WTF;\n uniform float4 color_modulation;\n uniform float mixModeAlpha;\n uniform sampler2D texAO;\n uniform float4 texAO_Cg_WTF;\n uniform sampler2D lightmap_dir1;\n uniform float4 lightmap_dir1_Cg_WTF;\n uniform sampler2D lightmap_dir2;\n uniform float4 lightmap_dir2_Cg_WTF;\n uniform sampler2D lightmap_dir3;\n uniform float4 lightmap_dir3_Cg_WTF;\n uniform sampler2D directions1;\n uniform float4 directions1_Cg_WTF;\n uniform sampler2D directions2;\n uniform float4 directions2_Cg_WTF;\n uniform sampler2D directions3;\n uniform float4 directions3_Cg_WTF;\n uniform sampler2D texSpecular;\n uniform float4 texSpecular_Cg_WTF;\n uniform float3 specular;\n uniform float3 combinedAmbient;\n uniform float3 dynamicAmbient;\n uniform sampler2D lightmap;\n uniform float4 lightmap_Cg_WTF;\n uniform float4 hdrScale;\n uniform sampler2D fogTex;\n uniform float4 fogTex_Cg_WTF;\n uniform float4 fogColor;\n uniform float fogFadeEnd;\n uniform float fogFadeStart;\n uniform float fogLimit;\n};\n\nstruct FragmentOutput\n{\n float4 color0 : COLOR0;\n float depth : DEPTH;\n};\n\nFragmentOutput fragmentMain (vertex2fragment vertexToFragment, FragmentInput fragmentIn)\n{\n float4 outputColor_0;\n float4 result_1;\n float4 foggedColor_2;\n float4 surfaceWithGlow_3;\n float4 result_4;\n float4 outputColor_5;\n float3 diffuseColor_6;\n float3 specularColor_7;\n float4 result_8;\n float3 ambient_9;\n float3 specularColor_10;\n float4 outputColor_11;\n float3 o_normal_12;\n float3 eyeDirectionWorld_13;\n float3 specular_14;\n float occlusionFactor_15;\n float2 result_16;\n float normalmap_alpha_17;\n float4 surfaceColorOut_18;\n float4 position_19;\n float4 position_world_20;\n float4 position_object_21;\n float4 position_camera_22;\n float3 normal_23;\n float3 o_normal_24;\n float3 eyeDirectionTangent_25;\n int output_26;\n int output_27;\n float4 surfaceColor_28;\n float2 texCoordOffset_29;\n float3 eyeDirectionWorld_30;\n float3 eyeDirectionObj_31;\n float3 eyeDirectionTangent_32;\n float3 eyeDirectionObj_33;\n float3 output_34;\n float3 output_35;\n float3 output_36;\n float3 output_37;\n float3 output_38;\n float3 output_39;\n float4 output_40;\n float4 output_41;\n float3 output_42;\n float3 output_43;\n float4 in_Hposition;\n float4x4 in_ModelViewProj;\n float4x4 in_ModelView;\n float4x4 in_objectToWorld;\n float4x4 in_ModelViewIT;\n float4 in_eyePosWorld;\n float2 in_texCoord;\n float3 in_Normal;\n sampler2D in_texHeight;\n float in_heightMapScale;\n float2 in_sampleLimits;\n sampler2D in_texDiffuse;\n sampler2D in_texNormal;\n sampler2D in_texNormalCompressed;\n float4 in_color_modulation;\n float in_mixModeAlpha;\n float2 in_texCoordLM;\n sampler2D in_texAO;\n float3 in_color_dir1;\n float3 in_color_dir2;\n float3 in_color_dir3;\n sampler2D in_lightmap_dir1;\n sampler2D in_lightmap_dir2;\n sampler2D in_lightmap_dir3;\n sampler2D in_directions1;\n sampler2D in_directions2;\n sampler2D in_directions3;\n sampler2D in_texSpecular;\n float3 in_specular;\n float3 in_combinedAmbient;\n float3 in_dynamicAmbient;\n float3 in_litColor;\n sampler2D in_lightmap;\n sampler2D in_texGlow;\n float4 in_hdrScale;\n float3 in_Tangent;\n float3 in_Bitangent;\n bool normal_23_attr_perfragment;\n bool specular_14_attr_perfragment;\n bool output_41_attr_perfragment;\n bool diffuseColor_6_attr_perfragment;\n bool specularColor_7_attr_perfragment;\n bool output_40_attr_perfragment;\n bool surfaceColor_28_attr_perfragment;\n bool surfaceColorOut_18_attr_perfragment;\n bool normalmap_alpha_17_attr_perfragment;\n bool specularColor_10_attr_perfragment;\n bool occlusionFactor_15_attr_perfragment;\n bool ambient_9_attr_perfragment;\n bool outputColor_5_attr_perfragment;\n bool result_4_attr_perfragment;\n {\n float4 Hposition;\n in_Hposition = Hposition;\n }\n\n {\n float4x4 ModelViewProj;\n in_ModelViewProj = ModelViewProj;\n }\n\n {\n float4x4 ModelView;\n\n ModelView = fragmentIn.ModelView;\n in_ModelView = ModelView;\n }\n\n {\n float4x4 objectToWorld;\n\n objectToWorld = fragmentIn.objectToWorld;\n in_objectToWorld = objectToWorld;\n }\n\n {\n float4x4 ModelViewIT;\n in_ModelViewIT = ModelViewIT;\n }\n\n {\n float4 eyePosWorld;\n\n eyePosWorld = fragmentIn.eyePosWorld;\n in_eyePosWorld = eyePosWorld;\n }\n\n {\n float2 texCoord;\n #ifndef PARAM_vertexToFragment_texCoord_0_UNUSED\n texCoord = vertexToFragment.texCoord_0;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n texCoord = float2(0);\n #endif\n #endif\n in_texCoord = texCoord;\n }\n\n {\n float3 Normal;\n #ifndef PARAM_vertexToFragment_Normal_1_UNUSED\n Normal = vertexToFragment.Normal_1;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n Normal = float3(0);\n #endif\n #endif\n in_Normal = Normal;\n }\n\n {\n sampler2D texHeight;\n\n texHeight = fragmentIn.texHeight;\n in_texHeight = texHeight;\n }\n\n {\n float heightMapScale;\n\n heightMapScale = fragmentIn.heightMapScale;\n in_heightMapScale = heightMapScale;\n }\n\n {\n float2 sampleLimits;\n\n sampleLimits = fragmentIn.sampleLimits;\n in_sampleLimits = sampleLimits;\n }\n\n {\n sampler2D texDiffuse;\n\n texDiffuse = fragmentIn.texDiffuse;\n in_texDiffuse = texDiffuse;\n }\n\n {\n sampler2D texNormal;\n\n texNormal = fragmentIn.texNormal;\n in_texNormal = texNormal;\n }\n\n {\n sampler2D texNormalCompressed;\n\n texNormalCompressed = fragmentIn.texNormalCompressed;\n in_texNormalCompressed = texNormalCompressed;\n }\n\n {\n float4 color_modulation;\n\n color_modulation = fragmentIn.color_modulation;\n in_color_modulation = color_modulation;\n }\n\n {\n float mixModeAlpha;\n\n mixModeAlpha = fragmentIn.mixModeAlpha;\n in_mixModeAlpha = mixModeAlpha;\n }\n\n {\n float2 texCoordLM;\n #ifndef PARAM_vertexToFragment_texCoordLM_2_UNUSED\n texCoordLM = vertexToFragment.texCoordLM_2;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n texCoordLM = float2(0);\n #endif\n #endif\n in_texCoordLM = texCoordLM;\n }\n\n {\n sampler2D texAO;\n\n texAO = fragmentIn.texAO;\n in_texAO = texAO;\n }\n\n {\n float3 color_dir1;\n #ifndef PARAM_vertexToFragment_color_dir1_3_UNUSED\n color_dir1 = vertexToFragment.color_dir1_3;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n color_dir1 = float3(0);\n #endif\n #endif\n in_color_dir1 = color_dir1;\n }\n\n {\n float3 color_dir2;\n #ifndef PARAM_vertexToFragment_color_dir2_4_UNUSED\n color_dir2 = vertexToFragment.color_dir2_4;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n color_dir2 = float3(0);\n #endif\n #endif\n in_color_dir2 = color_dir2;\n }\n\n {\n float3 color_dir3;\n #ifndef PARAM_vertexToFragment_color_dir3_5_UNUSED\n color_dir3 = vertexToFragment.color_dir3_5;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n color_dir3 = float3(0);\n #endif\n #endif\n in_color_dir3 = color_dir3;\n }\n\n {\n sampler2D lightmap_dir1;\n\n lightmap_dir1 = fragmentIn.lightmap_dir1;\n in_lightmap_dir1 = lightmap_dir1;\n }\n\n {\n sampler2D lightmap_dir2;\n\n lightmap_dir2 = fragmentIn.lightmap_dir2;\n in_lightmap_dir2 = lightmap_dir2;\n }\n\n {\n sampler2D lightmap_dir3;\n\n lightmap_dir3 = fragmentIn.lightmap_dir3;\n in_lightmap_dir3 = lightmap_dir3;\n }\n\n {\n sampler2D directions1;\n\n directions1 = fragmentIn.directions1;\n in_directions1 = directions1;\n }\n\n {\n sampler2D directions2;\n\n directions2 = fragmentIn.directions2;\n in_directions2 = directions2;\n }\n\n {\n sampler2D directions3;\n\n directions3 = fragmentIn.directions3;\n in_directions3 = directions3;\n }\n\n {\n sampler2D texSpecular;\n\n texSpecular = fragmentIn.texSpecular;\n in_texSpecular = texSpecular;\n }\n\n {\n float3 specular;\n\n specular = fragmentIn.specular;\n in_specular = specular;\n }\n\n {\n float3 combinedAmbient;\n\n combinedAmbient = fragmentIn.combinedAmbient;\n in_combinedAmbient = combinedAmbient;\n }\n\n {\n float3 dynamicAmbient;\n\n dynamicAmbient = fragmentIn.dynamicAmbient;\n in_dynamicAmbient = dynamicAmbient;\n }\n\n {\n float3 litColor;\n #ifndef PARAM_vertexToFragment_litColor_6_UNUSED\n litColor = vertexToFragment.litColor_6;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n litColor = float3(0);\n #endif\n #endif\n in_litColor = litColor;\n }\n\n {\n sampler2D lightmap;\n\n lightmap = fragmentIn.lightmap;\n in_lightmap = lightmap;\n }\n\n {\n sampler2D texGlow;\n in_texGlow = texGlow;\n }\n\n {\n float4 hdrScale;\n\n hdrScale = fragmentIn.hdrScale;\n in_hdrScale = hdrScale;\n }\n\n {\n float3 Tangent;\n #ifndef PARAM_vertexToFragment_Tangent_7_UNUSED\n Tangent = vertexToFragment.Tangent_7;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n Tangent = float3(0);\n #endif\n #endif\n\n #if FRAGMENT_PROGRAM_LEVEL >= 0x200\n // Renormalize, as interpolation will have denormalized it\n Tangent = normalize (Tangent);\n #endif\n in_Tangent = Tangent;\n }\n\n {\n float3 Bitangent;\n #ifndef PARAM_vertexToFragment_Bitangent_8_UNUSED\n Bitangent = vertexToFragment.Bitangent_8;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n Bitangent = float3(0);\n #endif\n #endif\n\n #if FRAGMENT_PROGRAM_LEVEL >= 0x200\n // Renormalize, as interpolation will have denormalized it\n Bitangent = normalize (Bitangent);\n #endif\n in_Bitangent = Bitangent;\n }\n\n {\n int output;\n output = 0;output_27 = output;\n }\n\n {\n float4 Hposition;\n float4x4 ModelViewProj;\n float4x4 ModelView;\n float4x4 objectToWorld;\n float4 position;\n float4 position_world;\n float4 position_object;\n float4 position_camera;\n float4 position_screen;\n Hposition = in_Hposition;\n ModelView = in_ModelView;\n objectToWorld = in_objectToWorld;\n ModelViewProj = in_ModelViewProj;\n #ifndef PARAM_vertexToFragment_position_9_UNUSED\n position = vertexToFragment.position_9;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position = float4(0);\n #endif\n #endif\n #ifndef PARAM_vertexToFragment_position_screen_10_UNUSED\n position_screen = vertexToFragment.position_screen_10;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position_screen = float4(0);\n #endif\n #endif\n #ifndef PARAM_vertexToFragment_position_object_11_UNUSED\n position_object = vertexToFragment.position_object_11;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position_object = float4(0);\n #endif\n #endif\n #ifndef PARAM_vertexToFragment_position_world_12_UNUSED\n position_world = vertexToFragment.position_world_12;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position_world = float4(0);\n #endif\n #endif\n #ifndef PARAM_vertexToFragment_position_camera_13_UNUSED\n position_camera = vertexToFragment.position_camera_13;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n position_camera = float4(0);\n #endif\n #endif\n\n APPLY_CLIPPING_FP_POSINV;\n\n /* The objectToWorld transform is needed in other places, so there is a \n\t global variable for it. Set that */\n\n SetGlobalObjectToWorld (objectToWorld);\n position = position_screen;\n position_object_21 = position_object;\n position_camera_22 = position_camera;\n position_world_20 = position_world;\n position_19 = position;\n }\n\n {\n float4 position;\n float4x4 ModelViewIT;\n float3 eyeDirectionObj;\n position = position_object_21;\n ModelViewIT = in_ModelViewIT;\n #ifndef PARAM_vertexToFragment_eyeDirectionObj_14_UNUSED\n eyeDirectionObj = vertexToFragment.eyeDirectionObj_14;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n eyeDirectionObj = float3(0);\n #endif\n #endif\n eyeDirectionObj_33 = eyeDirectionObj;\n }\n\n {\n float3 Normal;\n float3 Tangent;\n float3 Bitangent;\n float3 input;\n float3 output;\n Tangent = in_Tangent;\n Normal = in_Normal;\n input = eyeDirectionObj_33;\n Bitangent = in_Bitangent;\n\n #if FRAGMENT_PROGRAM_LEVEL >= 0x200\n float3x3 obj2tang;\n obj2tang[0] = Tangent;\n obj2tang[1] = Bitangent;\n obj2tang[2] = Normal;\n output = mul (obj2tang, input);\n #else\n /* PS1.x can't do matrix mul ...\n Leave 'output' deliberately undefined to catch (undesired) uses of it */\n\n #endif\n output_34 = output;\n }\n\n {\n float3 eyeVecT;\n float3 eyeDirectionTangent;\n eyeVecT = output_34;\n #ifndef PARAM_vertexToFragment_eyeDirectionTangent_15_UNUSED\n eyeDirectionTangent = vertexToFragment.eyeDirectionTangent_15;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n eyeDirectionTangent = float3(0);\n #endif\n #endif\n eyeDirectionTangent_32 = eyeDirectionTangent;\n }\n\n {\n float4 position;\n float4 eyePosWorld;\n float3 eyeDirectionWorld;\n eyePosWorld = in_eyePosWorld;\n position = position_world_20;\n\n eyeDirectionWorld = (position - eyePosWorld).xyz;\n eyeDirectionWorld_30 = eyeDirectionWorld;\n }\n\n {\n float3 input;\n float3 output;\n input = eyeDirectionObj_33;\n\n output = mul (objectToWorld, float4 (input, 0)).xyz;\n output_35 = output;\n }\n\n {\n float2 texCoord;\n float3 Normal;\n float3 eyeVec;\n float3 eyeVecW;\n sampler2D texHeight;\n float heightMapScale;\n float2 sampleLimits;\n float2 texCoordOffset;\n eyeVecW = output_35;\n Normal = in_Normal;\n texCoord = in_texCoord;\n texHeight = in_texHeight;\n heightMapScale = in_heightMapScale;\n eyeVec = eyeDirectionTangent_32;\n sampleLimits = in_sampleLimits;\n\n float2 offset = float2(0, 0);\n\n\n texCoordOffset = texCoord + offset;\n texCoordOffset_29 = texCoordOffset;\n }\n\n {\n float2 texCoord;\n sampler2D texNormal;\n sampler2D texNormalCompressed;\n float3 normal;\n bool normal_attr_perfragment;\n texNormalCompressed = in_texNormalCompressed;\n texCoord = texCoordOffset_29;\n texNormal = in_texNormal;\n\n normal = half3 (0, 0, 1);\n normal_attr_perfragment = false;\n normal_23 = normal;\n normal_23_attr_perfragment = normal_attr_perfragment;\n }\n\n {\n float3 i_normal;\n float3 o_normal;\n i_normal = normal_23;\n\n o_normal = i_normal;\n o_normal_24 = o_normal;\n }\n\n {\n float3 Normal;\n float3 Tangent;\n float3 Bitangent;\n float3 input;\n float3 output;\n Tangent = in_Tangent;\n input = o_normal_24;\n Normal = in_Normal;\n Bitangent = in_Bitangent;\n\n float3x3 obj2tang;\n obj2tang[0] = Tangent;\n obj2tang[1] = Bitangent;\n obj2tang[2] = Normal;\n output = mul (input, obj2tang);\n output_38 = output;\n }\n\n {\n float2 texCoordLM;\n float2 result;\n texCoordLM = in_texCoordLM;\n\n result = texCoordLM;\n result_16 = result;\n }\n\n {\n float3 input;\n float3 output;\n input = eyeDirectionTangent_32;\n\n output = normalize (input);\n output_37 = output;\n }\n\n {\n float3 color_dir1;\n float3 color_dir2;\n float3 color_dir3;\n float2 texCoordLM;\n float3 eyeToSurf;\n float3 normal;\n bool normal_attr_perfragment;\n sampler2D lightmap_dir1;\n sampler2D lightmap_dir2;\n sampler2D lightmap_dir3;\n sampler2D directions1;\n sampler2D directions2;\n sampler2D directions3;\n float3 specular;\n bool specular_attr_perfragment;\n color_dir2 = in_color_dir2;\n color_dir3 = in_color_dir3;\n normal = o_normal_24;\n eyeToSurf = output_37;\n texCoordLM = in_texCoordLM;\n lightmap_dir1 = in_lightmap_dir1;\n lightmap_dir2 = in_lightmap_dir2;\n lightmap_dir3 = in_lightmap_dir3;\n directions1 = in_directions1;\n directions2 = in_directions2;\n directions3 = in_directions3;\n color_dir1 = in_color_dir1;\n normal_attr_perfragment = false;\n\n float3 spec = float3(0);\n float3 baseLit[3];\n\n baseLit[0] = tex2D (lightmap_dir1, texCoordLM).rgb;\n baseLit[1] = tex2D (lightmap_dir2, texCoordLM).rgb;\n baseLit[2] = tex2D (lightmap_dir3, texCoordLM).rgb;\n\n\n float2 rawdir1 = tex2D (directions1, texCoordLM).ga * 2 -float2(1);\n float2 rawdir2 = tex2D (directions2, texCoordLM).ga * 2 -float2(1);\n float2 rawdir3 = tex2D (directions3, texCoordLM).ga * 2 -float2(1);\n\n float3 lightDir;\n lightDir.xy = rawdir1;\n lightDir.z = rawdir3.x;\n\n float3 speccol = 2 * ComputeDLMColor (lightDir, baseLit);\n\n float3 H = normalize (-eyeToSurf + lightDir);\n spec += (pow (saturate (dot (normal, H)), 32) * speccol);\n\n lightDir.xy = rawdir2;\n lightDir.z = rawdir3.y;\n\n speccol = 2 * ComputeDLMColor (lightDir, baseLit);\n\n H = normalize (-eyeToSurf + lightDir);\n spec += (pow (saturate (dot (normal, H)), 32) * speccol);\n\n specular = spec;\n specular_attr_perfragment = true;\n specular_14 = specular;\n specular_14_attr_perfragment = specular_attr_perfragment;\n }\n\n {\n float3 input;\n float4 output;\n bool output_attr_perfragment;\n input = specular_14;\n output_attr_perfragment = specular_14_attr_perfragment;\n\n output = float4 (input, 1);\n output_41 = output;\n output_41_attr_perfragment = output_attr_perfragment;\n }\n\n {\n float3 input;\n float3 output;\n input = output_38;\n\n output = mul (objectToWorld, float4 (input, 0)).xyz;\n output_39 = output;\n }\n\n {\n float3 eyeToSurf;\n float4 positionW;\n float3 normal;\n int lightOffset;\n int maxLights;\n int minLights;\n float3 diffuseColor;\n bool diffuseColor_attr_perfragment;\n float3 specularColor;\n bool specularColor_attr_perfragment;\n normal = output_39;\n minLights = int (0);\n positionW = position_world_20;\n lightOffset = output_27;\n maxLights = output_27;\n eyeToSurf = eyeDirectionWorld_30;\n\n diffuseColor = float3(0);\n specularColor = float3(0);\n half3 myEyeToSurf = eyeToSurf;\n myEyeToSurf = normalize (eyeToSurf);\n\n for (int l = 0;l < maxLights;l++)\t \n {\n int i = lightOffset + l;\n if ((i >= minLights) && (i >= lightProps.count)) break;\n\n LightSpaceWorld lightSpace;\n lightSpace.Init (i, positionW);\n\n Light light = GetCurrentLight (lightSpace, i, normal);\n float4 lightAttenuationVec = lightProps.attenuationVec[i];\n float3 d, s;\n ComputeLight (lightSpace, light, myEyeToSurf, normal, 32,\t lightProps.colorDiffuse[i], lightProps.colorSpecular[i],\t lightAttenuationVec, 1, d, s);\n\n diffuseColor += d;\n specularColor += s;\n }\n diffuseColor_attr_perfragment = true;\n specularColor_attr_perfragment = true;\n diffuseColor_6 = diffuseColor;\n specularColor_7 = specularColor;\n specularColor_7_attr_perfragment = specularColor_attr_perfragment;\n diffuseColor_6_attr_perfragment = diffuseColor_attr_perfragment;\n }\n\n {\n float3 input;\n float4 output;\n bool output_attr_perfragment;\n input = specularColor_7;\n output_attr_perfragment = specularColor_7_attr_perfragment;\n\n output = float4 (input, 1);\n output_40 = output;\n output_40_attr_perfragment = output_attr_perfragment;\n }\n\n {\n float4 a;\n float4 b;\n float4 result;\n a = output_40;\n b = output_41;\n\n result = a+b;\n result_8 = result;\n }\n\n {\n float4 input;\n float3 output;\n input = result_8;\n\n output = input.rgb;\n output_42 = output;\n }\n\n {\n float2 texCoord;\n sampler2D texDiffuse;\n float4 surfaceColor;\n bool surfaceColor_attr_perfragment;\n texDiffuse = in_texDiffuse;\n texCoord = texCoordOffset_29;\n\n surfaceColor = tex2D (texDiffuse, texCoord);\n surfaceColor_attr_perfragment = true;\n surfaceColor_28 = surfaceColor;\n surfaceColor_28_attr_perfragment = surfaceColor_attr_perfragment;\n }\n\n {\n float4 surfaceColorIn;\n bool surfaceColorIn_attr_perfragment;\n float4 color_modulation;\n float4 surfaceColorOut;\n bool surfaceColorOut_attr_perfragment;\n surfaceColorIn = surfaceColor_28;\n color_modulation = in_color_modulation;\n surfaceColorIn_attr_perfragment = surfaceColor_28_attr_perfragment;\n\n surfaceColorOut.rgba = surfaceColorIn.rgba * color_modulation.rgba;\n surfaceColorOut_attr_perfragment = surfaceColorIn_attr_perfragment;\n surfaceColorOut_18 = surfaceColorOut;\n surfaceColorOut_18_attr_perfragment = surfaceColorOut_attr_perfragment;\n }\n\n {\n float4 inputColor;\n float mixModeAlpha;\n float4 outputColor;\n inputColor = surfaceColorOut_18;\n mixModeAlpha = in_mixModeAlpha;\n\n outputColor.rgb = inputColor.rgb;\n outputColor.a = inputColor.a * mixModeAlpha;\n outputColor_11 = outputColor;\n }\n\n {\n float2 texCoord;\n sampler2D texNormal;\n float normalmap_alpha;\n bool normalmap_alpha_attr_perfragment;\n texCoord = texCoordOffset_29;\n texNormal = in_texNormal;\n\n normalmap_alpha_attr_perfragment = false;\n normalmap_alpha = 1;\n normalmap_alpha_17 = normalmap_alpha;\n normalmap_alpha_17_attr_perfragment = normalmap_alpha_attr_perfragment;\n }\n\n {\n float normalMapAlpha;\n bool normalMapAlpha_attr_perfragment;\n float2 texCoord;\n sampler2D texSpecular;\n float4 surfaceColorWithAlpha;\n bool surfaceColorWithAlpha_attr_perfragment;\n float3 specular;\n float3 specularColor;\n bool specularColor_attr_perfragment;\n texSpecular = in_texSpecular;\n normalMapAlpha = normalmap_alpha_17;\n surfaceColorWithAlpha = outputColor_11;\n texCoord = texCoordOffset_29;\n specular = in_specular;\n surfaceColorWithAlpha_attr_perfragment = true;\n normalMapAlpha_attr_perfragment = normalmap_alpha_17_attr_perfragment;\n\n specularColor = tex2D (texSpecular, texCoord).rgb * specular;\n specularColor_attr_perfragment = true;\n float weirdCoef = (normalMapAlpha+1)/2;\n specularColor *= weirdCoef;\n specularColor *= surfaceColorWithAlpha.a;\n specularColor_10 = specularColor;\n specularColor_10_attr_perfragment = specularColor_attr_perfragment;\n }\n\n {\n float2 texCoord;\n sampler2D texAO;\n float occlusionFactor;\n bool occlusionFactor_attr_perfragment;\n texCoord = result_16;\n texAO = in_texAO;\n\n occlusionFactor = 1;\n occlusionFactor_attr_perfragment = false;\n occlusionFactor_15 = occlusionFactor;\n occlusionFactor_15_attr_perfragment = occlusionFactor_attr_perfragment;\n }\n\n {\n float3 combinedAmbient;\n float3 dynamicAmbient;\n float occlusionFactor;\n bool occlusionFactor_attr_perfragment;\n float3 litColor;\n float3 color_dir1;\n float3 color_dir2;\n float3 color_dir3;\n float2 texCoordLM;\n float3 normal;\n bool normal_attr_perfragment;\n sampler2D lightmap;\n sampler2D lightmap_dir1;\n sampler2D lightmap_dir2;\n sampler2D lightmap_dir3;\n float3 ambient;\n bool ambient_attr_perfragment;\n color_dir2 = in_color_dir2;\n occlusionFactor = occlusionFactor_15;\n color_dir3 = in_color_dir3;\n texCoordLM = result_16;\n lightmap = in_lightmap;\n lightmap_dir1 = in_lightmap_dir1;\n combinedAmbient = in_combinedAmbient;\n lightmap_dir2 = in_lightmap_dir2;\n lightmap_dir3 = in_lightmap_dir3;\n litColor = in_litColor;\n normal = normal_23;\n dynamicAmbient = in_dynamicAmbient;\n color_dir1 = in_color_dir1;\n normal_attr_perfragment = normal_23_attr_perfragment;\n occlusionFactor_attr_perfragment = occlusionFactor_15_attr_perfragment;\n\n float3 ambient_dynamic = dynamicAmbient * occlusionFactor;\n float3 ambient_static;\n\n // Utilize directional LM/colors only if normal is changed per-fragment\n if (normal_attr_perfragment)\t \n {\n float3 baseLit[3];\n\n baseLit[0] = tex2D (lightmap_dir1, texCoordLM).rgb;\n baseLit[1] = tex2D (lightmap_dir2, texCoordLM).rgb;\n baseLit[2] = tex2D (lightmap_dir3, texCoordLM).rgb;\n\n ambient_static = 2 * ComputeDLMColor (normal, baseLit);\n ambient_attr_perfragment = true;\n }\n else\t \n // Use plain ol' less detailed lighting otherwise\t \t \n {\n\n ambient_static = 2 * tex2D (lightmap, texCoordLM).rgb;\n ambient_attr_perfragment = true;\n\n }\n ambient = ambient_dynamic + ambient_static;\n ambient_9 = ambient;\n ambient_9_attr_perfragment = ambient_attr_perfragment;\n }\n\n {\n float4 surfaceColor;\n bool surfaceColor_attr_perfragment;\n float4 outputColor;\n bool outputColor_attr_perfragment;\n surfaceColor = outputColor_11;\n surfaceColor_attr_perfragment = true;\n\n outputColor = surfaceColor;\n outputColor.rgb *= surfaceColor.a;\n outputColor_attr_perfragment = surfaceColor_attr_perfragment;\n outputColor_5 = outputColor;\n outputColor_5_attr_perfragment = outputColor_attr_perfragment;\n }\n\n {\n float3 lightDiffuse;\n bool lightDiffuse_attr_perfragment;\n float3 lightSpecular;\n bool lightSpecular_attr_perfragment;\n float4 surfaceDiffuse;\n bool surfaceDiffuse_attr_perfragment;\n float3 surfaceSpecular;\n bool surfaceSpecular_attr_perfragment;\n float3 ambient;\n bool ambient_attr_perfragment;\n float4 result;\n bool result_attr_perfragment;\n surfaceSpecular = specularColor_10;\n lightDiffuse = diffuseColor_6;\n lightSpecular = output_42;\n ambient = ambient_9;\n surfaceDiffuse = outputColor_5;\n ambient_attr_perfragment = ambient_9_attr_perfragment;\n lightDiffuse_attr_perfragment = diffuseColor_6_attr_perfragment;\n lightSpecular_attr_perfragment = false;\n surfaceDiffuse_attr_perfragment = outputColor_5_attr_perfragment;\n surfaceSpecular_attr_perfragment = specularColor_10_attr_perfragment;\n\n result = float4 (ambient + lightDiffuse, 1)*surfaceDiffuse + float4 (surfaceSpecular*lightSpecular, 0);\n result_attr_perfragment = ambient_attr_perfragment || surfaceDiffuse_attr_perfragment\t|| lightDiffuse_attr_perfragment\t|| surfaceSpecular_attr_perfragment\t|| lightSpecular_attr_perfragment;\n result_4 = result;\n result_4_attr_perfragment = result_attr_perfragment;\n }\n\n {\n float2 texCoord;\n sampler2D texGlow;\n float4 surfaceColor;\n float4 surfaceWithGlow;\n texGlow = in_texGlow;\n texCoord = result_16;\n surfaceColor = result_4;\n\n surfaceWithGlow = surfaceColor;\n surfaceWithGlow_3 = surfaceWithGlow;\n }\n\n {\n float4 litColor;\n float4 eyePos;\n float4 foggedColor;\n float2 fogTC;\n litColor = surfaceWithGlow_3;\n eyePos = position_camera_22;\n #ifndef PARAM_vertexToFragment_fogTC_16_UNUSED\n fogTC = vertexToFragment.fogTC_16;\n #else\n #ifdef _INITIALIZE_UNUSED_V2F\n fogTC = float2(0);\n #endif\n #endif\n\n foggedColor = litColor;\n foggedColor_2 = foggedColor;\n }\n\n {\n float4 a;\n float4 hdrScale;\n float4 result;\n hdrScale = in_hdrScale;\n a = foggedColor_2;\n\n result = float4 (a.rgb*hdrScale.y+hdrScale.w, a.a);\n result_1 = result;\n }\n\n {\n float4 outputColor;\n outputColor = result_1;\n outputColor_0 = outputColor;\n }\n\n FragmentOutput OUT;\n OUT.color0 = outputColor_0;\n return OUT;\n}", _type=, customLimitsPair=, flags=) at /home/lucas/projects/cs/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cgcommon.cpp:346 346 cgGLLoadProgram (program); Current language: auto The current source language is "auto; currently c++". A debugging session is active. Inferior 1 [process 9237] will be killed. Quit anyway? (y or n)