RYHPT44611\+,*H4 NyLq7'^P0"2@8000T IT kH Xp0 00M0f00h0 0{000Z$   000 0 @(03(0 ! P0F0)000 @0W0}0@0$0& F*0~*000&.0/0* 00020_@0u40@000;8 0q0K?0 4 (    Bx000E0 @0 0: 0L0b00zL0M0N00(0W08@HLP")=Sdv $(,04 8 <6 @N [ Dm   W W`    0 @ P) h9 lW _ W _ W _ W _ "W _ e n y  ( 8 @ P `+ bW _ !W _ (W _ (W _ 8L W "V d d q  #   W W Sq           ) 7 C N V a *k +y )( ,8 HW _ -W _ .W _ BW _ W     ( /1 Q 0( 8n W _ :W _ P  "   [ X  &  W  )9 "5F0=C WC sC C  C@ C` C C #Q32E@W>h= W _ 3zW W$W(W,DW _ 4%6GI(TH,4`G`ly  K   0 0 JJ$ 0# 0, B L[p    $ 0 0 0 0  0 0 0 0& 05 0BXiNx(,pW _  W  )9Ux@W W VW _ T( 1(9,B K Xft PCharPContextSwitchPInt32PLightTypePRenderDataTypePSceneRenderPassTypePShadowCasterTypePTextureFormatBasePUInt16PUInt32PUInt8boolfloatCD3D11_BLEND_DESCCD3D11_DEPTH_STENCIL_DESCCD3D11_RASTERIZER_DESCD3D11_DEPTH_STENCILOP_DESCD3D11_RENDER_TARGET_BLEND_DESCPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPAssetReferencePBasePClassDescriptorPClusterHeaderPClusterHeaderBasePClusterHeaderD3D11PContextVariantFoldingTablePEffectPEffectVariantPInstanceListHeaderPMaterialPMaterialSwitchPNodeContextPParameterBufferPParameterBufferBasePSamplerStatePSamplerStateBasePSamplerStateD3D11PSceneRenderPassPShaderPShaderComputeProgramPShaderComputeProgramD3D11PShaderFragmentProgramPShaderFragmentProgramD3D11PShaderGeometryProgramPShaderGeometryProgramD3D11PShaderParameterCaptureBufferLocationPShaderParameterCaptureBufferLocationSizePShaderParameterCaptureBufferLocationTypeConstantBufferPShaderParameterCaptureBufferSamplerPShaderParameterCaptureBufferTexture2DPShaderParameterCaptureBufferTextureBasePShaderParameterDefinitionPShaderPassPShaderPassBasePShaderPassD3D11PShaderPassInfoPShaderPassParameterLocationTypesBasePShaderPassParameterLocationTypesConstantBufferPShaderPassStateBasePShaderPassStateD3D11PShaderProgramBasePShaderProgramD3D11PShaderStreamDefinitionPShaderVertexProgramPShaderVertexProgramD3D11PSharrayPStreamInputDescD3D11PStreamInputLayoutD3D11PStringPTexture2DPTexture2DBasePTexture2DD3D11PTextureCommonBasem_idm_assetm_assetTypem_indexBufferSizem_vertexBufferSizem_maxTextureBufferSizem_phyreMarkerm_sizem_instanceListCountm_packedNamespaceSizem_arrayFixupSizem_arrayFixupCountm_pointerFixupSizem_pointerFixupCountm_pointerArrayFixupSizem_pointerArrayFixupCountm_pointersInArraysCountm_userFixupCountm_userFixupDataSizem_totalDataSizem_headerClassInstanceCountm_headerClassChildCountm_platformIDm_physicsEngineIDm_supportedLightMaskm_supportedShadowCasterMaskm_effectFilem_effectSourcem_effectVariantsm_supportedLightTypesm_supportedShadowCasterTypesm_contextSwitchesm_contextVariantSwitchesm_maxLightCountm_numSupportedShaderLODLevelsm_countm_elsm_effectm_switchesm_sceneRenderPassesm_sceneRenderPassLookupm_largestShaderPassCountm_tweakableShaderParameterDefinitionsm_untweakableShaderParameterDefinitionsm_tweakableParameterBufferSizem_untweakableParameterBufferSizem_classIDm_objectsSizem_arraysSizem_effectVariantm_parameterBufferm_remapFromm_remapTom_namem_valuem_packedSwitchesm_parameterBufferSizem_minFilterm_magFilterm_wrapSm_wrapTm_wrapRm_lodBiasm_maxAnisotropym_borderColorm_baseLevelm_maxLevelm_flagsm_passTypem_shadersm_entryPointsm_variantsFoldingTablem_platformsm_platformsAreIncludem_contextVariantIndexm_contextVariantVpIndexm_contextVariantFpIndexm_contextVariantGsIndexm_contextVariantCsIndexm_passesm_parameterDefinitionsForPassesm_streamDefinitionsForPassesm_parameterBufferFrequenciesRequiredm_offsetm_constantBufferLocationm_typem_unusedPointerm_texturem_parameterTypem_samplerStatem_textureBufferIndexm_dataTypem_arrayElementCountm_bufferLocm_statem_vertexParameterLocationm_fragmentParameterLocationm_geometryParameterLocationm_computeParameterLocationm_vertexTexParameterLocationm_fragmentTexParameterLocationm_geometryTexParameterLocationm_computeTexParameterLocationm_vertexProgramm_fragmentProgramm_geometryProgramm_computeProgramm_streamLocationsm_vertexEntryPointm_vertexProfilem_fragmentEntryPointm_fragmentProfilem_geometryEntryPointm_geometryProfilem_computeEntryPointm_computeProfilem_parameterLocationsm_parameterStartm_parameterCountm_rasterDescm_depthDescm_blendDescm_stencilRefAlphaToCoverageEnableIndependentBlendEnableRenderTargetDepthEnableDepthWriteMaskDepthFuncStencilEnableStencilReadMaskStencilWriteMaskFrontFaceBackFaceFillModeCullModeFrontCounterClockwiseDepthBiasDepthBiasClampSlopeScaledDepthBiasDepthClipEnableScissorEnableMultisampleEnableAntialiasedLineEnableStencilFailOpStencilDepthFailOpStencilPassOpStencilFuncBlendEnableSrcBlendDestBlendBlendOpSrcBlendAlphaDestBlendAlphaBlendOpAlphaRenderTargetWriteMaskm_importantStatem_compiledCodem_constantBufferSizem_globalConstantBufferIndexm_shaderProfilem_renderTypem_nameHashm_indexm_inputLayoutm_um_semanticm_semanticIndexm_d3dFormatm_inputSlotm_streamsm_bufferm_widthm_heightm_formatm_memoryTypem_mipmapCountm_maxMipLevelm_textureFlagsXp hh 8  @@PP!@@%p&'>+(h-5P0 Cx`DGData/Shaders/S_Occlusion_vs__Occlusion_fs__8487.cgfx#10FE9B128FEC1BEAD4973BDF30220AC2#materialData/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx#10FE9B128FEC1BEAD4973BDF30220AC2 #line 1 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #define D_PLATFORM_D3D11x64 #define EXCLUSION #define COLOR_BIAS // Automatically generated. Do not edit. // =======================================================================================================================[COMMON DEFINES]=== #define PHYRE3X_ENABLED #if !defined(D_PLATFORM_GXM) #define h2tex3D tex3D #define h4tex2D tex2D #define h3tex2D tex2D #define h2tex2D tex2D #define h1tex2D tex2D #define h4texCUBE texCUBE #define h3texCUBE texCUBE #endif // ========================================================================================================================[COMMON STATES]=== #if !defined(D_PLATFORM_GXM) BlendState ourBlendState { BlendEnable[0] = FALSE; BlendEnable[1] = FALSE; SrcBlend[0] = Src_Alpha; DestBlend[0] = Inv_Src_Alpha; BlendOp[0] = ADD; SrcBlendAlpha[0] = ONE; DestBlendAlpha[0] = ONE; BlendOpAlpha[0] = ADD; RenderTargetWriteMask[0] = 15; AlphaToCoverageEnable = false; }; DepthStencilState ourDepthStencilState { DepthEnable=true; DepthFunc=less; StencilEnable=false; }; RasterizerState ourRasterState { CullMode=None; DepthBias=0.0f; ScissorEnable=false; MultiSampleEnable=false; DepthClipEnable=false; AntialiasedLineEnable=false; }; #endif // ==================================================================================================================[VERTEX SHADER BEGIN]=== #define main Opaque_vs_main #define IN Opaque_vs_IN #define OUT Opaque_vs_OUT #define v2f Opaque_vs_v2f #define a2v Opaque_vs_a2v // ------------------------------------------------------------------------------------------------------------------------------------------ #line 1 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #ifndef MIGRATORY_SH #define MIGRATORY_SH //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef D_PLATFORM_D3D11x64 #define D_PLATFORM_D3D11 #endif #ifdef D_PLATFORM_D3D11 //#pragma pack_matrix(column_major) #define D_D3D11_OTHER(x,y) x #define D_D3D11_ONLY(x) x #define POSITION_OUT SV_POSITION #define FINAL_COLOR D_D3D11_OTHER(SV_TARGET0,COLOR) #elif defined(D_PLATFORM_GNM) #ifdef __ORBIS__ #pragma warning (disable:5203) // parameter unreferenced #pragma warning (disable:5206) // local variable unreferenced #pragma warning (disable:6204) // does not support uniform default values #pragma warning (disable:6459) // __user_defined__ is not a valid semantic for uniform #pragma warning (disable:5581) // PSSL treats 'half' type as 'float' #pragma warning (disable:5609) // PSSL treats 'half' type as 'float' #pragma warning (disable:5583) // PSSL treats 'half' literals as 'float' #pragma warning (disable:5524) // unsupported compiler hint //! Some evil #defines to sort out matrix multiplies. #define float4x4 row_major float4x4 #define float3x4 row_major float3x4 #define float4x3 row_major float4x3 //! Semantics for VS/PS inputs and outputs. #define POSITION S_POSITION #define SV_POSITION S_POSITION #define SV_GroupID S_GROUP_ID #define SV_VertexID S_VERTEX_ID #define SV_DispatchThreadID S_DISPATCH_THREAD_ID #define SV_GroupThreadID S_GROUP_THREAD_ID #define SV_GroupIndex S_GROUP_INDEX #define SV_PRIMITIVEID S_PRIMITIVE_ID #define SV_IsFrontFace S_FRONT_FACE #define SV_Depth FRAG_OUTPUT_DEPTH #define FRAG_OUTPUT_COLOR S_TARGET_OUTPUT0 #define FRAG_OUTPUT_COLOR0 S_TARGET_OUTPUT0 #define FRAG_OUTPUT_COLOR1 S_TARGET_OUTPUT1 #define FRAG_OUTPUT_COLOR2 S_TARGET_OUTPUT2 #define FRAG_OUTPUT_COLOR3 S_TARGET_OUTPUT3 #define FRAG_OUTPUT_DEPTH S_DEPTH_OUTPUT //! Some defines to make textures compile with PSSL for now (sort out later) SamplerState globalSamplerState; SamplerComparisonState globalSamplerComparisonState { // Sampler state Filter = MIN_MAG_LINEAR_MIP_POINT; AddressU = CLAMP; AddressV = CLAMP; // Sampler comparison state ComparisonFunc = LESS; ComparisonFilter = COMPARISON_MIN_MAG_LINEAR_MIP_POINT; }; #define cbuffer ConstantBuffer #define sampler SamplerState #define sampler2D Texture2D #define sampler3D Texture3D #define samplerCUBE TextureCube #define tex2Dproj(a,b) a.Sample(globalSamplerState, (b).xy / (b).w) #define h1tex2Dproj(a,b) ((half)(a.Sample(globalSamplerState, (b).xy / (b).w).x)) #define h4tex2D(a,b) ((half4)a.Sample(globalSamplerState, (b).xy)) #define h4tex2Dlod(a,b) ((half4)a.SampleLOD(globalSamplerState, (b).xy, (b).w)) #define tex2D(a,b) a.Sample(globalSamplerState, (b).xy) #define SampleLevel SampleLOD #define SampleCmpLevelZero SampleCmpLOD0 #define StructuredBuffer RegularBuffer #define RWStructuredBuffer RW_RegularBuffer #define numthreads NUM_THREADS #define maxvertexcount MAX_VERTEX_COUNT #define groupshared thread_group_memory #define TriangleStream TriangleBuffer #define PointStream PointBuffer #define triangle Triangle #define IncrementCounter IncrementCount #define DecrementCounter DecrementCount #define GroupMemoryBarrierWithGroupSync ThreadGroupMemoryBarrierSync #define InterlockedMin AtomicMin #define InterlockedMax AtomicMax #define InterlockedAdd AtomicAdd #endif //! __ORBIS__ #if defined(PHYRE_D3DFX) && !defined(__ORBIS__) #define FRAG_OUTPUT_COLOR SV_TARGET #define FRAG_OUTPUT_COLOR0 SV_TARGET0 #define FRAG_OUTPUT_COLOR1 SV_TARGET1 #define FRAG_OUTPUT_COLOR2 SV_TARGET2 #define FRAG_OUTPUT_COLOR3 SV_TARGET3 #define FRAG_OUTPUT_DEPTH SV_DEPTH #define SYSTEM_PRIMITIVE_INDEX SV_PRIMITIVEID #endif //! defined(PHYRE_D3DFX) && !defined(__ORBIS__) #define D_D3D11_OTHER(x,y) x #define D_D3D11_ONLY(x) x #define POSITION_OUT POSITION #define FINAL_COLOR FRAG_OUTPUT_COLOR #else #define D_D3D11_OTHER(x,y) y #define D_D3D11_ONLY(x) #define HALF half #define HALF2 half2 #define HALF3 half3 #define HALF4 half4 #define HALF3x3 float3x3 #define HALF3x4 float3x4 #define HALF4x4 float4x4 #define POSITION_OUT POSITION #define FINAL_COLOR D_D3D11_OTHER(SV_TARGET0,COLOR) #endif #if defined(__psp2__) #define NATIVECOLOR __nativecolor #define REGFORMAT __regformat #else #define NATIVECOLOR #define REGFORMAT #endif #if !defined(__ORBIS__) && !defined(D_PLATFORM_GXM) BlendState NoBlend_BlendState { BlendEnable[0] = FALSE; }; BlendState Alpha_BlendState { BlendEnable[0] = TRUE; SrcBlend[0] = Src_Alpha; DestBlend[0] = Inv_Src_Alpha; BlendOp[0] = ADD; SrcBlendAlpha[0] = Src_Alpha; DestBlendAlpha[0] = Inv_Src_Alpha; BlendOpAlpha[0] = ADD; BlendEnable[1] = FALSE; }; BlendState Additive_BlendState { BlendEnable[0] = TRUE; SrcBlend[0] = Src_Alpha; DestBlend[0] = ONE; BlendOp[0] = ADD; SrcBlendAlpha[0] = Src_Alpha; DestBlendAlpha[0] = ONE; BlendOpAlpha[0] = ADD; BlendEnable[1] = FALSE; }; BlendState ParticleBlended_BlendState { BlendEnable[0] = TRUE; SrcBlend[0] = ONE; DestBlend[0] = Inv_Src_Alpha; BlendOp[0] = ADD; SrcBlendAlpha[0] = ONE; DestBlendAlpha[0] = Inv_Src_Alpha; BlendOpAlpha[0] = ADD; BlendEnable[1] = FALSE; }; DepthStencilState NoDepthTest_NoDepthWrite_DepthState { DepthEnable = FALSE; DepthWriteMask = Zero; DepthFunc = Less; StencilEnable = FALSE; }; DepthStencilState NoDepthTest_DepthWrite_DepthState { DepthEnable = FALSE; DepthWriteMask = All; DepthFunc = Less; StencilEnable = FALSE; }; DepthStencilState DepthTest_NoDepthWrite_DepthState { DepthEnable = TRUE; DepthWriteMask = Zero; DepthFunc = Less; StencilEnable = FALSE; }; DepthStencilState DepthTest_DepthWrite_DepthState { DepthEnable = TRUE; DepthWriteMask = All; DepthFunc = Less; StencilEnable = FALSE; }; RasterizerState NoCull_RasterizerState { CullMode=None; }; RasterizerState BackFaceCull_RasterizerState { CullMode=Back; FrontCounterClockwise = TRUE; }; RasterizerState FrontFaceCull_RasterizerState { CullMode=Front; FrontCounterClockwise = TRUE; }; #endif #if defined(D_PLATFORM_D3D11) || defined(D_PLATFORM_GNM) #define MatrixMul(a,b) mul(b,a) #define HALF float #define HALF2 float2 #define HALF3 float3 #define HALF4 float4 #define HALF3x3 float3x3 #define HALF3x4 float3x4 #define HALF4x4 float4x4 #define half float #define half2 float2 #define half3 float3 #define half4 float4 #else #define MatrixMul(a,b) mul(a,b) #endif // samplers #if defined(D_PLATFORM_D3D11) || defined(D_PLATFORM_GNM) sampler PointClampSampler : register(s8) { Filter = Min_Mag_Mip_Point; AddressU = Clamp; AddressV = Clamp; AddressW = Clamp; }; sampler LinearClampSampler : register(s9) { Filter = Min_Mag_Mip_Linear; AddressU = Clamp; AddressV = Clamp; AddressW = Clamp; }; sampler LinearWrapTSampler : register(s10) { Filter = Min_Mag_Mip_Linear; AddressU = Clamp; AddressV = Wrap; AddressW = Clamp; }; sampler LinearWrapSampler : register(s11) { Filter = Min_Mag_Mip_Linear; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; }; sampler PointWrapSampler : register(s12) { Filter = Min_Mag_Mip_Point; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; }; sampler AnisoClampSampler : register(s13) { Filter = ANISOTROPIC; AddressU = Clamp; AddressV = Clamp; AddressW = Clamp; MaxAnisotropy = 16; }; sampler LinearWrapAnisoSampler : register(s14) { Filter = ANISOTROPIC; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; MaxAnisotropy = 16; }; sampler PointWrapAnisoSampler : register(s15) { Filter = Min_Mag_Point_Mip_Linear; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; MaxAnisotropy = 16; }; #define SAMPLER_WRAP_ANISO LinearWrapAnisoSampler #define SAMPLER_WRAP_LINEAR LinearWrapSampler #define SAMPLER_WRAP_POINT PointWrapSampler #define SAMPLER_CLAMP_ANISO AnisoClampSampler #define SAMPLER_CLAMP_LINEAR LinearClampSampler #define SAMPLER_CLAMP_POINT PointClampSampler static const float kSRGB = 2.2f; #define SRGB_ON(x) pow(x,kSRGB) #define SRGB_OFF(x) x #define SAMPLETEX(tex,uv,filter,wrap,srgb) SRGB_##srgb(tex.Sample(SAMPLER_##wrap##_##filter, uv)) #ifdef __ORBIS__ #define D_DECLARE_TEXTURE2DMS_4(x) MS_Texture2D x #else #define D_DECLARE_TEXTURE2DMS_4(x) Texture2DMS x #endif #define D_DECLARE_TEXTURE2D_4(x) Texture2D x #define D_DECLARE_TEXTURE3D_4(x) Texture3D x #define D_DECLARE_TEXTURE_CUBE_4(x) TextureCube x #define D_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_POINT_SAMPLE_TEXTURE(tex,uv) tex.Sample(PointClampSampler,uv) #define D_SAMPLE_TEXTURE_PROJ(tex,uv) tex.Sample(LinearClampSampler,(float2) (uv.xy / uv.w) ) #define D_POINT_SAMPLE_TEXTURE_PROJ(tex,uv) tex.Sample(PointClampSampler,(float2) (uv.xy / uv.w) ) #define D_SAMPLE_TEXTURE_3D(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_SAMPLE_TEXTURE_WRAP_3D(tex,uv) tex.Sample(LinearWrapSampler,uv) #define D_H1_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).x #define D_H2_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).xy #define D_H3_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).xyz #define D_H4_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_H1_POINTSAMPLELEVEL_TEXTURE(tex,uv,lod) tex.SampleLevel(PointClampSampler,uv,lod).x #define D_H1_SAMPLELEVEL_TEXTURE(tex,uv,lod) tex.SampleLevel(LinearClampSampler,uv,lod).x #define D_H4_SAMPLELEVEL_TEXTURE(tex,uv,lod) tex.SampleLevel(LinearClampSampler,uv,lod) #if defined(D_PLATFORM_D3D11) #define D_H1_SAMPLE_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearClampSampler,uv).x,2.2f) #define D_H2_SAMPLE_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearClampSampler,uv).xy,2.2f) #define D_H3_SAMPLE_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f) #define D_H4_SAMPLE_SRGBTEXTURE(tex,uv) float4( pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f), tex.Sample(LinearClampSampler,uv).a ) #define D_H1_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearWrapSampler,uv).x,2.2f) #define D_H2_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearWrapSampler,uv).xy,2.2f) #define D_H3_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearWrapSampler,uv).xyz,2.2f) #define D_H4_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) float4( pow(tex.Sample(LinearWrapSampler,uv).xyz,2.2f), tex.Sample(LinearWrapSampler,uv).a ) #define D_H4_SAMPLE_WRAPT_SRGBTEXTURE(tex,uv) float4( pow(tex.Sample(LinearWrapTSampler,uv).xyz,2.2f), tex.Sample(LinearWrapTSampler,uv).a) #define D_H3_SAMPLE_WRAP_ANISO_SRGBTEXTURE(tex,uv) pow( tex.Sample(LinearWrapAnisoSampler,uv).xyz, 2.2f) #else #define D_H1_SAMPLE_SRGBTEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).x #define D_H2_SAMPLE_SRGBTEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).xy #define D_H3_SAMPLE_SRGBTEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).xyz #define D_H4_SAMPLE_SRGBTEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_H1_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).x #define D_H2_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).xy #define D_H3_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).xyz #define D_H4_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv) #define D_H4_SAMPLE_WRAPT_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapTSampler,uv) #endif #define D_H1_SAMPLE_WRAP_TEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).x #define D_H2_SAMPLE_WRAP_TEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).xy #define D_H3_SAMPLE_WRAP_TEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).xyz #define D_H4_SAMPLE_WRAP_TEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv) #define D_H1_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(LinearWrapAnisoSampler,uv).x #define D_H2_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(LinearWrapAnisoSampler,uv).xy #define D_H3_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(LinearWrapAnisoSampler,uv).xyz #define D_H4_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(LinearWrapAnisoSampler,uv) #define D_H1_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(PointWrapAnisoSampler,uv).x #define D_H2_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(PointWrapAnisoSampler,uv).xy #define D_H3_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(PointWrapAnisoSampler,uv).xyz #define D_H4_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(PointWrapAnisoSampler,uv) #define D_H2_SAMPLE_TEXTURE_3D(tex,uv) tex.Sample(LinearClampSampler,uv).xy #define D_H2_SAMPLE_WRAP_TEXTURE_3D(tex,uv) tex.Sample(LinearWrapSampler,uv).xy #if defined(D_PLATFORM_D3D11) #define D_H3_SAMPLE_TEXTURE_CUBE(tex,uv) pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f) #define D_H4_SAMPLE_TEXTURE_CUBE(tex,uv) float4( pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f), tex.Sample(LinearClampSampler,uv).a ) #define D_SAMPLE_TEXTURE_CUBE(tex,uv) float4( pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f), tex.Sample(LinearClampSampler,uv).a ) #else #define D_H3_SAMPLE_TEXTURE_CUBE(tex,uv) tex.Sample(LinearClampSampler,uv).xyz #define D_H4_SAMPLE_TEXTURE_CUBE(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_SAMPLE_TEXTURE_CUBE(tex,uv) tex.Sample(LinearClampSampler,uv) #endif #else #define D_DECLARE_TEXTURE2D_4(x) sampler2D x #define D_DECLARE_TEXTURE3D_4(x) sampler3D x #define D_DECLARE_TEXTURE_CUBE_4(x) samplerCUBE x #define D_SAMPLE_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_POINT_SAMPLE_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_SAMPLE_TEXTURE_PROJ(tex,uv) h4tex2Dproj(tex,uv.xyw) #define D_POINT_SAMPLE_TEXTURE_PROJ(tex,uv) h4tex2Dproj(tex,uv.xyw) #define D_SAMPLE_TEXTURE_CUBE(tex,uv) h4texCUBE(tex,uv) #define D_SAMPLE_TEXTURE_3D(tex,uv) h4tex3D(tex,uv) #define D_SAMPLE_TEXTURE_WRAP_3D(tex,uv) h4tex3D(tex,uv) #define D_H1_SAMPLE_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_POINTSAMPLELEVEL_TEXTURE(tex,uv,lod) h1tex2D(tex,uv).x #define D_H1_SAMPLELEVEL_TEXTURE(tex,uv,lod) h1tex2D(tex,uv).x #define D_H4_SAMPLELEVEL_TEXTURE(tex,uv,lod) h4tex2D(tex,uv) #define D_H1_SAMPLE_SRGBTEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_SRGBTEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_SRGBTEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_SRGBTEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_WRAP_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_WRAP_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_WRAP_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_WRAP_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_ANISO_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_ANISO_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_ANISO_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_ANISO_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H4_SAMPLE_WRAPT_SRGBTEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H2_SAMPLE_TEXTURE_3D(tex,uv) h2tex3D(tex,uv).xy #define D_H2_SAMPLE_WRAP_TEXTURE_3D(tex,uv) h2tex3D(tex,uv).xy #define D_H3_SAMPLE_TEXTURE_CUBE(tex,uv) h3texCUBE(tex,uv).xyz #define D_H4_SAMPLE_TEXTURE_CUBE(tex,uv) h4texCUBE(tex,uv) #endif #if !defined(GLOBAL_LEAN_AND_MEAN) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // these constants are system constants; uploaded by Phyre itself. // we can't do this, but we don't want to upload them all the time, either. consequently, we make these global // i guess we can eventually stuff these into a separate uniform buffer //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// float4x4 view : view ; // uploaded once per camera float4x4 projection : projection ; // view inverse float4x4 viewprojection : viewprojection ; float4 eyeDirectionWS : eyeDirectionWS ; float4 eyePositionWS : eyePositionWS ; float4 eyePositionOS : eyePositionOS ; float4 cameraNear : cameraNearFar ; float4x4 modelIT : modelit ; // uploaded per primitive // model inverse transpose float4x4 model : model ; float4x4 modelViewProj : modelviewproj ; #endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // depth conversion code, stolen from the sample code //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// float cameraNearTimesFar; float cameraFarMinusNear; float4 cameraNearFar; // Convert a depth value from post projection space to view space. float ConvertDepth(float depth) { // float viewSpaceZ = -(scene.cameraNearTimesFar / (depth * scene.cameraFarMinusNear - scene.cameraNearFar.y)); #if defined(D_PLATFORM_GXM) float viewSpaceZ = -(cameraNearTimesFar / (depth * cameraFarMinusNear - cameraNearFar.y)); #else float viewSpaceZ = -(cameraNearTimesFar / (depth * cameraFarMinusNear - cameraNearFar.y)); #endif return viewSpaceZ; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // skinning //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef SKINNING_ENABLED // grabbed off [PhyreCoreShaderShared.h] // Description: // Encapsulates the skinning transformation matrices. #if defined(D_PLATFORM_GXM) #define PE_MAX_SKIN_CB_TRANSFORMS 32 float4x4 boneTransforms[PE_MAX_SKIN_CB_TRANSFORMS]; float4x4 GenerateBoneMatrix(int4 SkinIndices,float4 SkinWeights) { return boneTransforms[SkinIndices[0]]*SkinWeights[0] + boneTransforms[SkinIndices[1]]*SkinWeights[1] + boneTransforms[SkinIndices[2]]*SkinWeights[2] + boneTransforms[SkinIndices[3]]*SkinWeights[3]; } #else #define PE_MAX_SKIN_CB_TRANSFORMS 32 struct PSkinTransforms { float4x4 Mtxs[PE_MAX_SKIN_CB_TRANSFORMS]; // The skinning transformation matrices. }; cbuffer BoneTransformConstantBuffer { PSkinTransforms SkinTransforms; } float4x4 GenerateBoneMatrix(uint4 SkinIndices,float4 SkinWeights) { return SkinTransforms.Mtxs[SkinIndices[0]]*SkinWeights[0] + SkinTransforms.Mtxs[SkinIndices[1]]*SkinWeights[1] + SkinTransforms.Mtxs[SkinIndices[2]]*SkinWeights[2] + SkinTransforms.Mtxs[SkinIndices[3]]*SkinWeights[3]; } #endif #endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// static const float4x4 SCALE_BIAS = float4x4( float4( 0.5, 0.0, 0.0, 0.5 ), #if defined(D_PLATFORM_D3D11) float4( 0.0, -0.5, 0.0, 0.5 ), #else float4( 0.0, 0.5, 0.0, 0.5 ), #endif float4( 0.0, 0.0, 0.5, 0.5 ), float4( 0.0, 0.0, 0.0, 1.0 ) ); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef D_PLATFORM_GXM #define D_INT_MOD(val,mod) (frac((floor((float)val)/mod))*mod) #define D_UINT_MOD(val,mod) (frac((floor((float)val)/mod))*mod) #elif defined(D_PLATFORM_GNM) #define D_INT_MOD(val,mod) ((int)floor(val) % mod) #define D_UINT_MOD(val,mod) ((uint)floor(val) % mod) #else #define D_INT_MOD(val,mod) ((int)floor(val) % mod) #define D_UINT_MOD(val,mod) ((int)floor(val) % mod) #endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef D_ENABLE_DEBUG_PARAMS float4 debugVars0; float4 debugVars1; float4 debugVars2; float4 debugVars3; float4 debugVars4; float4 debugVars5; float4 debugVars6; float4 debugVars7; #define GETDEBUGVAR(dv) (debugVars##dv!=0) ? (debugVars##dv) : #define GETDEBUGVAR2(dv,scl) (debugVars##dv!=0) ? (scl*debugVars##dv) : #endif #define powsafe(_x,_y) pow(max(_x,0.00000000000001),_y) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #endif//MIGRATORY_SH #line 55 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" // Notes: Occlusion is a deferred screen space effect. This implementation // expects worldspace geometry to be passed in and it will internally // flatten it to screen space. // // Author: John Edwards // Date C: 7-24-2010 // From Phyre: struct p2v { #ifdef __ORBIS__ float4 Position : POSITION; #else float3 Position : POSITION; #endif float3 tint : TEXCOORD0; float4 occPosRad : TEXCOORD1; float4 intShNoiseEx : TEXCOORD2; }; struct v2f { float4 position : POSITION_OUT; float4 clip : TEXCOORD0; float3 tint : TEXCOORD1; float4 occPosRad : TEXCOORD2; float4 intShNoiseEx : TEXCOORD3; }; //---------------------------------------------- // Program entry //---------------------------------------------- void main( in p2v IN, out v2f OUT ) { // Flatten the projection so our interpolators work better. OUT.position = MatrixMul( modelViewProj, float4( IN.Position.xyz, 1 ) ); OUT.clip = OUT.position; OUT.tint = IN.tint; OUT.occPosRad = IN.occPosRad; OUT.intShNoiseEx = IN.intShNoiseEx; } // ------------------------------------------------------------------------------------------------------------------------------------------ #undef main #undef IN #undef OUT #undef v2f #undef a2v // ===================================================================================================================[PIXEL SHADER BEGIN]=== #define main Opaque_fs_main #define IN Opaque_fs_IN #define OUT Opaque_fs_OUT #define v2f Opaque_fs_v2f #define f2f Opaque_fs_f2f // ------------------------------------------------------------------------------------------------------------------------------------------ #line 1 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #ifndef MIGRATORY_SH #define MIGRATORY_SH //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef D_PLATFORM_D3D11x64 #define D_PLATFORM_D3D11 #endif #ifdef D_PLATFORM_D3D11 //#pragma pack_matrix(column_major) #define D_D3D11_OTHER(x,y) x #define D_D3D11_ONLY(x) x #define POSITION_OUT SV_POSITION #define FINAL_COLOR D_D3D11_OTHER(SV_TARGET0,COLOR) #elif defined(D_PLATFORM_GNM) #ifdef __ORBIS__ #pragma warning (disable:5203) // parameter unreferenced #pragma warning (disable:5206) // local variable unreferenced #pragma warning (disable:6204) // does not support uniform default values #pragma warning (disable:6459) // __user_defined__ is not a valid semantic for uniform #pragma warning (disable:5581) // PSSL treats 'half' type as 'float' #pragma warning (disable:5609) // PSSL treats 'half' type as 'float' #pragma warning (disable:5583) // PSSL treats 'half' literals as 'float' #pragma warning (disable:5524) // unsupported compiler hint //! Some evil #defines to sort out matrix multiplies. #define float4x4 row_major float4x4 #define float3x4 row_major float3x4 #define float4x3 row_major float4x3 //! Semantics for VS/PS inputs and outputs. #define POSITION S_POSITION #define SV_POSITION S_POSITION #define SV_GroupID S_GROUP_ID #define SV_VertexID S_VERTEX_ID #define SV_DispatchThreadID S_DISPATCH_THREAD_ID #define SV_GroupThreadID S_GROUP_THREAD_ID #define SV_GroupIndex S_GROUP_INDEX #define SV_PRIMITIVEID S_PRIMITIVE_ID #define SV_IsFrontFace S_FRONT_FACE #define SV_Depth FRAG_OUTPUT_DEPTH #define FRAG_OUTPUT_COLOR S_TARGET_OUTPUT0 #define FRAG_OUTPUT_COLOR0 S_TARGET_OUTPUT0 #define FRAG_OUTPUT_COLOR1 S_TARGET_OUTPUT1 #define FRAG_OUTPUT_COLOR2 S_TARGET_OUTPUT2 #define FRAG_OUTPUT_COLOR3 S_TARGET_OUTPUT3 #define FRAG_OUTPUT_DEPTH S_DEPTH_OUTPUT //! Some defines to make textures compile with PSSL for now (sort out later) SamplerState globalSamplerState; SamplerComparisonState globalSamplerComparisonState { // Sampler state Filter = MIN_MAG_LINEAR_MIP_POINT; AddressU = CLAMP; AddressV = CLAMP; // Sampler comparison state ComparisonFunc = LESS; ComparisonFilter = COMPARISON_MIN_MAG_LINEAR_MIP_POINT; }; #define cbuffer ConstantBuffer #define sampler SamplerState #define sampler2D Texture2D #define sampler3D Texture3D #define samplerCUBE TextureCube #define tex2Dproj(a,b) a.Sample(globalSamplerState, (b).xy / (b).w) #define h1tex2Dproj(a,b) ((half)(a.Sample(globalSamplerState, (b).xy / (b).w).x)) #define h4tex2D(a,b) ((half4)a.Sample(globalSamplerState, (b).xy)) #define h4tex2Dlod(a,b) ((half4)a.SampleLOD(globalSamplerState, (b).xy, (b).w)) #define tex2D(a,b) a.Sample(globalSamplerState, (b).xy) #define SampleLevel SampleLOD #define SampleCmpLevelZero SampleCmpLOD0 #define StructuredBuffer RegularBuffer #define RWStructuredBuffer RW_RegularBuffer #define numthreads NUM_THREADS #define maxvertexcount MAX_VERTEX_COUNT #define groupshared thread_group_memory #define TriangleStream TriangleBuffer #define PointStream PointBuffer #define triangle Triangle #define IncrementCounter IncrementCount #define DecrementCounter DecrementCount #define GroupMemoryBarrierWithGroupSync ThreadGroupMemoryBarrierSync #define InterlockedMin AtomicMin #define InterlockedMax AtomicMax #define InterlockedAdd AtomicAdd #endif //! __ORBIS__ #if defined(PHYRE_D3DFX) && !defined(__ORBIS__) #define FRAG_OUTPUT_COLOR SV_TARGET #define FRAG_OUTPUT_COLOR0 SV_TARGET0 #define FRAG_OUTPUT_COLOR1 SV_TARGET1 #define FRAG_OUTPUT_COLOR2 SV_TARGET2 #define FRAG_OUTPUT_COLOR3 SV_TARGET3 #define FRAG_OUTPUT_DEPTH SV_DEPTH #define SYSTEM_PRIMITIVE_INDEX SV_PRIMITIVEID #endif //! defined(PHYRE_D3DFX) && !defined(__ORBIS__) #define D_D3D11_OTHER(x,y) x #define D_D3D11_ONLY(x) x #define POSITION_OUT POSITION #define FINAL_COLOR FRAG_OUTPUT_COLOR #else #define D_D3D11_OTHER(x,y) y #define D_D3D11_ONLY(x) #define HALF half #define HALF2 half2 #define HALF3 half3 #define HALF4 half4 #define HALF3x3 float3x3 #define HALF3x4 float3x4 #define HALF4x4 float4x4 #define POSITION_OUT POSITION #define FINAL_COLOR D_D3D11_OTHER(SV_TARGET0,COLOR) #endif #if defined(__psp2__) #define NATIVECOLOR __nativecolor #define REGFORMAT __regformat #else #define NATIVECOLOR #define REGFORMAT #endif #if !defined(__ORBIS__) && !defined(D_PLATFORM_GXM) BlendState NoBlend_BlendState { BlendEnable[0] = FALSE; }; BlendState Alpha_BlendState { BlendEnable[0] = TRUE; SrcBlend[0] = Src_Alpha; DestBlend[0] = Inv_Src_Alpha; BlendOp[0] = ADD; SrcBlendAlpha[0] = Src_Alpha; DestBlendAlpha[0] = Inv_Src_Alpha; BlendOpAlpha[0] = ADD; BlendEnable[1] = FALSE; }; BlendState Additive_BlendState { BlendEnable[0] = TRUE; SrcBlend[0] = Src_Alpha; DestBlend[0] = ONE; BlendOp[0] = ADD; SrcBlendAlpha[0] = Src_Alpha; DestBlendAlpha[0] = ONE; BlendOpAlpha[0] = ADD; BlendEnable[1] = FALSE; }; BlendState ParticleBlended_BlendState { BlendEnable[0] = TRUE; SrcBlend[0] = ONE; DestBlend[0] = Inv_Src_Alpha; BlendOp[0] = ADD; SrcBlendAlpha[0] = ONE; DestBlendAlpha[0] = Inv_Src_Alpha; BlendOpAlpha[0] = ADD; BlendEnable[1] = FALSE; }; DepthStencilState NoDepthTest_NoDepthWrite_DepthState { DepthEnable = FALSE; DepthWriteMask = Zero; DepthFunc = Less; StencilEnable = FALSE; }; DepthStencilState NoDepthTest_DepthWrite_DepthState { DepthEnable = FALSE; DepthWriteMask = All; DepthFunc = Less; StencilEnable = FALSE; }; DepthStencilState DepthTest_NoDepthWrite_DepthState { DepthEnable = TRUE; DepthWriteMask = Zero; DepthFunc = Less; StencilEnable = FALSE; }; DepthStencilState DepthTest_DepthWrite_DepthState { DepthEnable = TRUE; DepthWriteMask = All; DepthFunc = Less; StencilEnable = FALSE; }; RasterizerState NoCull_RasterizerState { CullMode=None; }; RasterizerState BackFaceCull_RasterizerState { CullMode=Back; FrontCounterClockwise = TRUE; }; RasterizerState FrontFaceCull_RasterizerState { CullMode=Front; FrontCounterClockwise = TRUE; }; #endif #if defined(D_PLATFORM_D3D11) || defined(D_PLATFORM_GNM) #define MatrixMul(a,b) mul(b,a) #define HALF float #define HALF2 float2 #define HALF3 float3 #define HALF4 float4 #define HALF3x3 float3x3 #define HALF3x4 float3x4 #define HALF4x4 float4x4 #define half float #define half2 float2 #define half3 float3 #define half4 float4 #else #define MatrixMul(a,b) mul(a,b) #endif // samplers #if defined(D_PLATFORM_D3D11) || defined(D_PLATFORM_GNM) sampler PointClampSampler : register(s8) { Filter = Min_Mag_Mip_Point; AddressU = Clamp; AddressV = Clamp; AddressW = Clamp; }; sampler LinearClampSampler : register(s9) { Filter = Min_Mag_Mip_Linear; AddressU = Clamp; AddressV = Clamp; AddressW = Clamp; }; sampler LinearWrapTSampler : register(s10) { Filter = Min_Mag_Mip_Linear; AddressU = Clamp; AddressV = Wrap; AddressW = Clamp; }; sampler LinearWrapSampler : register(s11) { Filter = Min_Mag_Mip_Linear; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; }; sampler PointWrapSampler : register(s12) { Filter = Min_Mag_Mip_Point; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; }; sampler AnisoClampSampler : register(s13) { Filter = ANISOTROPIC; AddressU = Clamp; AddressV = Clamp; AddressW = Clamp; MaxAnisotropy = 16; }; sampler LinearWrapAnisoSampler : register(s14) { Filter = ANISOTROPIC; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; MaxAnisotropy = 16; }; sampler PointWrapAnisoSampler : register(s15) { Filter = Min_Mag_Point_Mip_Linear; AddressU = Wrap; AddressV = Wrap; AddressW = Wrap; MaxAnisotropy = 16; }; #define SAMPLER_WRAP_ANISO LinearWrapAnisoSampler #define SAMPLER_WRAP_LINEAR LinearWrapSampler #define SAMPLER_WRAP_POINT PointWrapSampler #define SAMPLER_CLAMP_ANISO AnisoClampSampler #define SAMPLER_CLAMP_LINEAR LinearClampSampler #define SAMPLER_CLAMP_POINT PointClampSampler static const float kSRGB = 2.2f; #define SRGB_ON(x) pow(x,kSRGB) #define SRGB_OFF(x) x #define SAMPLETEX(tex,uv,filter,wrap,srgb) SRGB_##srgb(tex.Sample(SAMPLER_##wrap##_##filter, uv)) #ifdef __ORBIS__ #define D_DECLARE_TEXTURE2DMS_4(x) MS_Texture2D x #else #define D_DECLARE_TEXTURE2DMS_4(x) Texture2DMS x #endif #define D_DECLARE_TEXTURE2D_4(x) Texture2D x #define D_DECLARE_TEXTURE3D_4(x) Texture3D x #define D_DECLARE_TEXTURE_CUBE_4(x) TextureCube x #define D_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_POINT_SAMPLE_TEXTURE(tex,uv) tex.Sample(PointClampSampler,uv) #define D_SAMPLE_TEXTURE_PROJ(tex,uv) tex.Sample(LinearClampSampler,(float2) (uv.xy / uv.w) ) #define D_POINT_SAMPLE_TEXTURE_PROJ(tex,uv) tex.Sample(PointClampSampler,(float2) (uv.xy / uv.w) ) #define D_SAMPLE_TEXTURE_3D(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_SAMPLE_TEXTURE_WRAP_3D(tex,uv) tex.Sample(LinearWrapSampler,uv) #define D_H1_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).x #define D_H2_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).xy #define D_H3_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).xyz #define D_H4_SAMPLE_TEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_H1_POINTSAMPLELEVEL_TEXTURE(tex,uv,lod) tex.SampleLevel(PointClampSampler,uv,lod).x #define D_H1_SAMPLELEVEL_TEXTURE(tex,uv,lod) tex.SampleLevel(LinearClampSampler,uv,lod).x #define D_H4_SAMPLELEVEL_TEXTURE(tex,uv,lod) tex.SampleLevel(LinearClampSampler,uv,lod) #if defined(D_PLATFORM_D3D11) #define D_H1_SAMPLE_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearClampSampler,uv).x,2.2f) #define D_H2_SAMPLE_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearClampSampler,uv).xy,2.2f) #define D_H3_SAMPLE_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f) #define D_H4_SAMPLE_SRGBTEXTURE(tex,uv) float4( pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f), tex.Sample(LinearClampSampler,uv).a ) #define D_H1_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearWrapSampler,uv).x,2.2f) #define D_H2_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearWrapSampler,uv).xy,2.2f) #define D_H3_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) pow(tex.Sample(LinearWrapSampler,uv).xyz,2.2f) #define D_H4_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) float4( pow(tex.Sample(LinearWrapSampler,uv).xyz,2.2f), tex.Sample(LinearWrapSampler,uv).a ) #define D_H4_SAMPLE_WRAPT_SRGBTEXTURE(tex,uv) float4( pow(tex.Sample(LinearWrapTSampler,uv).xyz,2.2f), tex.Sample(LinearWrapTSampler,uv).a) #define D_H3_SAMPLE_WRAP_ANISO_SRGBTEXTURE(tex,uv) pow( tex.Sample(LinearWrapAnisoSampler,uv).xyz, 2.2f) #else #define D_H1_SAMPLE_SRGBTEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).x #define D_H2_SAMPLE_SRGBTEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).xy #define D_H3_SAMPLE_SRGBTEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv).xyz #define D_H4_SAMPLE_SRGBTEXTURE(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_H1_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).x #define D_H2_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).xy #define D_H3_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).xyz #define D_H4_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv) #define D_H4_SAMPLE_WRAPT_SRGBTEXTURE(tex,uv) tex.Sample(LinearWrapTSampler,uv) #endif #define D_H1_SAMPLE_WRAP_TEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).x #define D_H2_SAMPLE_WRAP_TEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).xy #define D_H3_SAMPLE_WRAP_TEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv).xyz #define D_H4_SAMPLE_WRAP_TEXTURE(tex,uv) tex.Sample(LinearWrapSampler,uv) #define D_H1_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(LinearWrapAnisoSampler,uv).x #define D_H2_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(LinearWrapAnisoSampler,uv).xy #define D_H3_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(LinearWrapAnisoSampler,uv).xyz #define D_H4_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(LinearWrapAnisoSampler,uv) #define D_H1_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(PointWrapAnisoSampler,uv).x #define D_H2_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(PointWrapAnisoSampler,uv).xy #define D_H3_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(PointWrapAnisoSampler,uv).xyz #define D_H4_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) tex.Sample(PointWrapAnisoSampler,uv) #define D_H2_SAMPLE_TEXTURE_3D(tex,uv) tex.Sample(LinearClampSampler,uv).xy #define D_H2_SAMPLE_WRAP_TEXTURE_3D(tex,uv) tex.Sample(LinearWrapSampler,uv).xy #if defined(D_PLATFORM_D3D11) #define D_H3_SAMPLE_TEXTURE_CUBE(tex,uv) pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f) #define D_H4_SAMPLE_TEXTURE_CUBE(tex,uv) float4( pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f), tex.Sample(LinearClampSampler,uv).a ) #define D_SAMPLE_TEXTURE_CUBE(tex,uv) float4( pow(tex.Sample(LinearClampSampler,uv).xyz,2.2f), tex.Sample(LinearClampSampler,uv).a ) #else #define D_H3_SAMPLE_TEXTURE_CUBE(tex,uv) tex.Sample(LinearClampSampler,uv).xyz #define D_H4_SAMPLE_TEXTURE_CUBE(tex,uv) tex.Sample(LinearClampSampler,uv) #define D_SAMPLE_TEXTURE_CUBE(tex,uv) tex.Sample(LinearClampSampler,uv) #endif #else #define D_DECLARE_TEXTURE2D_4(x) sampler2D x #define D_DECLARE_TEXTURE3D_4(x) sampler3D x #define D_DECLARE_TEXTURE_CUBE_4(x) samplerCUBE x #define D_SAMPLE_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_POINT_SAMPLE_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_SAMPLE_TEXTURE_PROJ(tex,uv) h4tex2Dproj(tex,uv.xyw) #define D_POINT_SAMPLE_TEXTURE_PROJ(tex,uv) h4tex2Dproj(tex,uv.xyw) #define D_SAMPLE_TEXTURE_CUBE(tex,uv) h4texCUBE(tex,uv) #define D_SAMPLE_TEXTURE_3D(tex,uv) h4tex3D(tex,uv) #define D_SAMPLE_TEXTURE_WRAP_3D(tex,uv) h4tex3D(tex,uv) #define D_H1_SAMPLE_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_POINTSAMPLELEVEL_TEXTURE(tex,uv,lod) h1tex2D(tex,uv).x #define D_H1_SAMPLELEVEL_TEXTURE(tex,uv,lod) h1tex2D(tex,uv).x #define D_H4_SAMPLELEVEL_TEXTURE(tex,uv,lod) h4tex2D(tex,uv) #define D_H1_SAMPLE_SRGBTEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_SRGBTEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_SRGBTEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_SRGBTEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_WRAP_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_WRAP_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_WRAP_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_WRAP_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_WRAP_ANISO_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_ANISO_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_ANISO_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_ANISO_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_ANISO_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_POINT_WRAP_ANISO_TEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H1_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) h1tex2D(tex,uv).x #define D_H2_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) h2tex2D(tex,uv).xy #define D_H3_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) h3tex2D(tex,uv).xyz #define D_H4_SAMPLE_WRAP_SRGBTEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H4_SAMPLE_WRAPT_SRGBTEXTURE(tex,uv) h4tex2D(tex,uv) #define D_H2_SAMPLE_TEXTURE_3D(tex,uv) h2tex3D(tex,uv).xy #define D_H2_SAMPLE_WRAP_TEXTURE_3D(tex,uv) h2tex3D(tex,uv).xy #define D_H3_SAMPLE_TEXTURE_CUBE(tex,uv) h3texCUBE(tex,uv).xyz #define D_H4_SAMPLE_TEXTURE_CUBE(tex,uv) h4texCUBE(tex,uv) #endif #if !defined(GLOBAL_LEAN_AND_MEAN) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // these constants are system constants; uploaded by Phyre itself. // we can't do this, but we don't want to upload them all the time, either. consequently, we make these global // i guess we can eventually stuff these into a separate uniform buffer //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// float4x4 view : view ; // uploaded once per camera float4x4 projection : projection ; // view inverse float4x4 viewprojection : viewprojection ; float4 eyeDirectionWS : eyeDirectionWS ; float4 eyePositionWS : eyePositionWS ; float4 eyePositionOS : eyePositionOS ; float4 cameraNear : cameraNearFar ; float4x4 modelIT : modelit ; // uploaded per primitive // model inverse transpose float4x4 model : model ; float4x4 modelViewProj : modelviewproj ; #endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // depth conversion code, stolen from the sample code //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// float cameraNearTimesFar; float cameraFarMinusNear; float4 cameraNearFar; // Convert a depth value from post projection space to view space. float ConvertDepth(float depth) { // float viewSpaceZ = -(scene.cameraNearTimesFar / (depth * scene.cameraFarMinusNear - scene.cameraNearFar.y)); #if defined(D_PLATFORM_GXM) float viewSpaceZ = -(cameraNearTimesFar / (depth * cameraFarMinusNear - cameraNearFar.y)); #else float viewSpaceZ = -(cameraNearTimesFar / (depth * cameraFarMinusNear - cameraNearFar.y)); #endif return viewSpaceZ; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // skinning //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef SKINNING_ENABLED // grabbed off [PhyreCoreShaderShared.h] // Description: // Encapsulates the skinning transformation matrices. #if defined(D_PLATFORM_GXM) #define PE_MAX_SKIN_CB_TRANSFORMS 32 float4x4 boneTransforms[PE_MAX_SKIN_CB_TRANSFORMS]; float4x4 GenerateBoneMatrix(int4 SkinIndices,float4 SkinWeights) { return boneTransforms[SkinIndices[0]]*SkinWeights[0] + boneTransforms[SkinIndices[1]]*SkinWeights[1] + boneTransforms[SkinIndices[2]]*SkinWeights[2] + boneTransforms[SkinIndices[3]]*SkinWeights[3]; } #else #define PE_MAX_SKIN_CB_TRANSFORMS 32 struct PSkinTransforms { float4x4 Mtxs[PE_MAX_SKIN_CB_TRANSFORMS]; // The skinning transformation matrices. }; cbuffer BoneTransformConstantBuffer { PSkinTransforms SkinTransforms; } float4x4 GenerateBoneMatrix(uint4 SkinIndices,float4 SkinWeights) { return SkinTransforms.Mtxs[SkinIndices[0]]*SkinWeights[0] + SkinTransforms.Mtxs[SkinIndices[1]]*SkinWeights[1] + SkinTransforms.Mtxs[SkinIndices[2]]*SkinWeights[2] + SkinTransforms.Mtxs[SkinIndices[3]]*SkinWeights[3]; } #endif #endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// static const float4x4 SCALE_BIAS = float4x4( float4( 0.5, 0.0, 0.0, 0.5 ), #if defined(D_PLATFORM_D3D11) float4( 0.0, -0.5, 0.0, 0.5 ), #else float4( 0.0, 0.5, 0.0, 0.5 ), #endif float4( 0.0, 0.0, 0.5, 0.5 ), float4( 0.0, 0.0, 0.0, 1.0 ) ); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef D_PLATFORM_GXM #define D_INT_MOD(val,mod) (frac((floor((float)val)/mod))*mod) #define D_UINT_MOD(val,mod) (frac((floor((float)val)/mod))*mod) #elif defined(D_PLATFORM_GNM) #define D_INT_MOD(val,mod) ((int)floor(val) % mod) #define D_UINT_MOD(val,mod) ((uint)floor(val) % mod) #else #define D_INT_MOD(val,mod) ((int)floor(val) % mod) #define D_UINT_MOD(val,mod) ((int)floor(val) % mod) #endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef D_ENABLE_DEBUG_PARAMS float4 debugVars0; float4 debugVars1; float4 debugVars2; float4 debugVars3; float4 debugVars4; float4 debugVars5; float4 debugVars6; float4 debugVars7; #define GETDEBUGVAR(dv) (debugVars##dv!=0) ? (debugVars##dv) : #define GETDEBUGVAR2(dv,scl) (debugVars##dv!=0) ? (scl*debugVars##dv) : #endif #define powsafe(_x,_y) pow(max(_x,0.00000000000001),_y) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #endif//MIGRATORY_SH #line 112 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" // Notes: Deferred hacked ambient occlusion. // // Author: John Edwards // Date C: 7-24-2010 // From Phyre. // Projection params: float4 prjPlaneU; float4 prjPlaneV; float4 prjPlaneOrigin; #ifdef COLOR_BIAS // The darkest the occlusion can get. Should be somehow based of the environment ambient, probably. float4 colorBias; float4 colorScale; #endif #if defined(D_PLATFORM_GCM) // For converting from Z buffer value to linear depth. float depthBias; float depthScale; #endif D_DECLARE_TEXTURE2D_4(depthTex); #ifdef D_PLATFORM_D3D11 #define D_D3D_STENCIL #line 1 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/d3dutils.sh" #if !defined(D_D3DUTILS_H) && defined(D_PLATFORM_D3D11) #define D_D3DUTILS_H #ifdef D_D3D_STENCIL float4 stencil_texDim_depthScale_mask; float4 stencil_testColors; #ifdef MSAA Texture2DMS stencilTexMSAA; float GetStencilMask(float2 uv) { float2 uvScaled = uv * stencil_texDim_depthScale_mask.xy; uint3 uvInt = uint3(uint2(uvScaled), 0); uint mask = uint(stencil_texDim_depthScale_mask.w); uint stencil = stencilTexMSAA.Load(uvInt, 0).g; uint stencilMasked = stencil&mask; float d = float(stencilMasked); return d * stencil_texDim_depthScale_mask.z; } #else Texture2D stencilTex; float GetStencilMask(float2 uv) { float2 uvScaled = uv * stencil_texDim_depthScale_mask.xy; uint3 uvInt = uint3(uint2(uvScaled), 0); uint mask = uint(stencil_texDim_depthScale_mask.w); uint stencil = stencilTex.Load(uvInt).g; uint stencilMasked = stencil&mask; float d = float(stencilMasked); return d * stencil_texDim_depthScale_mask.z; } #endif #endif//D_D3D_STENCIL #endif//!defined(D_D3DUTILS_H) && defined(D_PLATFORM_D3D11) #line 141 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #else D_DECLARE_TEXTURE2D_4(stencilTex); #endif D_DECLARE_TEXTURE2D_4(lightTex); // Light stored in the alpha channel. #ifdef NOISE #ifdef D_PLATFORM_GXM D_DECLARE_TEXTURE2D_4(noise3dTexture); #else D_DECLARE_TEXTURE3D_4(noise3dTexture); #endif #endif #ifdef PLAYER float4 metaballs0; float4 metaballs1; float4 metaballs2; float4 metaballs3; float4 metaballs4; float4 metaballs5; #endif struct v2f { float4 position : POSITION_OUT; float4 clip : TEXCOORD0; float3 tint : TEXCOORD1; float4 occPosRad : TEXCOORD2; float4 intShNoiseEx : TEXCOORD3; }; struct f2f { float4 color : FINAL_COLOR; }; //---------------------------------------------- // Helper functions //---------------------------------------------- float myTexDepth2D( D_DECLARE_TEXTURE2D_4(depthTex), float2 uv ) { #if defined(D_PLATFORM_GCM) float3 depthColor = D_POINT_SAMPLE_TEXTURE( depthTex, uv ).rgb; float3 depthFactor = float3( 65536.0/16777215.0, 256.0/16777215.0, 1.0/16777215.0 ); return dot( round( depthColor * 255.0 ), depthFactor ); #else return D_POINT_SAMPLE_TEXTURE( depthTex, uv ).r; #endif } //---------------------------------------------- // Program entry //---------------------------------------------- void main( in v2f IN, out f2f OUT ) { float2 uv = 0.5 * (IN.clip.xy / IN.clip.w + 1.0); float2 uvOrig = uv; #if defined(D_PLATFORM_D3D11) uv.y = 1.0f - uv.y; #endif float3 occPos = IN.occPosRad.xyz; float rad = IN.occPosRad.w; float intensity = IN.intShNoiseEx.x; float sharpness = IN.intShNoiseEx.y; float noise = IN.intShNoiseEx.z; float exclude = IN.intShNoiseEx.w; float lightTap = saturate( D_SAMPLE_TEXTURE( lightTex, uv ).a - 1 ); float excludeOverride = saturate( D_SAMPLE_TEXTURE( lightTex, uv ).a - 2 ); float depthTap = myTexDepth2D( depthTex, uv ); #if defined(D_PLATFORM_GCM) float z = depthScale / ( depthTap - depthBias ); #else float z = ConvertDepth(depthTap); #endif #ifdef D_PLATFORM_D3D11 float stencilTap = GetStencilMask(uv); #else float stencilTap = D_POINT_SAMPLE_TEXTURE( stencilTex, uv ).r; #endif float3 projPointer = prjPlaneOrigin.xyz + (1 - uvOrig.x) * prjPlaneU.xyz + (1 - uvOrig.y) * prjPlaneV.xyz; float3 camSpace = z * projPointer; float3 pos = eyePositionWS.xyz - camSpace; // Ultimately, seems like it would be faster // to calculate occlusion in camera space. float irradience = 1.0; // If we're player ambient occlusion, we determine occlusion based on metaballs // passed in through uniforms. If we aren't occlusion is based on data passed // in from the vertex shader. #ifdef PLAYER #ifdef NOISE #ifdef D_PLATFORM_GXM half3 noiseTap = D_SAMPLE_TEXTURE( noise3dTexture, 0.25 * pos.xy ).rgb; #else half3 noiseTap = D_SAMPLE_TEXTURE_WRAP_3D( noise3dTexture, 0.25 * pos ).rgb; #endif pos += noise * (2 * noiseTap - 1); #endif #define DO_META(_x) \ { \ float4 meta = metaballs##_x; \ float3 metaPos = meta.xyz; \ float metaRad = meta.w; \ float3 to = metaPos - pos; \ to.y *= 0.25; \ float dist = length( to ); \ metaval += metaRad / (0.0001 + dist * dist); \ } float metaval = 0; DO_META(0) DO_META(1) DO_META(2) DO_META(3) DO_META(4) DO_META(5) const float kMetaCutoff = 0.70; metaval = saturate( kMetaCutoff + lerp( 7.0, 30.0, lightTap ) * (metaval - (1 - kMetaCutoff)) ); irradience = saturate( 1 - metaval ); irradience = lerp( 1.0 - intensity * (0.5 + 0.5 * lightTap), 1.0, irradience ); #else #ifdef NOISE #ifdef D_PLATFORM_GXM half3 noiseTap = D_SAMPLE_TEXTURE( noise3dTexture, 0.125 * pos.xy ).rgb; #else half3 noiseTap = D_SAMPLE_TEXTURE_WRAP_3D( noise3dTexture, 0.125 * pos ).rgb; #endif pos += noise * (2 * noiseTap - 1); #endif half3 to = occPos - pos; half dist = length( to ); half rd = saturate( (rad - dist) / rad ); irradience *= saturate( 1.0 - rd * rd ); //@PROTO: Modify the shadow softness. irradience = saturate( 0.5 + sharpness * (irradience - 0.5) ); //@PROTO: Prevent the shadow from getting too dark. irradience = lerp( 1.0 - intensity, 1.0, irradience ); #endif #ifdef EXCLUSION half exclusion = (1 - excludeOverride) * (abs( exclude - stencilTap * 256.0 ) < 0.75); irradience = lerp( irradience, 1, exclusion ); #endif OUT.color.rgb = lerp( float3( 1.0, 1.0, 1.0 ), float3( irradience, irradience, irradience ), IN.tint ); #ifdef COLOR_BIAS OUT.color.rgb = colorScale.rgb * OUT.color.rgb + colorBias.rgb; #endif } // ------------------------------------------------------------------------------------------------------------------------------------------ #undef main #undef IN #undef OUT #undef v2f #undef f2f // ===================================================================================================================[TECHNIQUE CODE END]=== #if !defined(D_PLATFORM_GXM) #ifndef __ORBIS__ technique11 Opaque { pass pass0 { SetVertexShader( CompileShader( vs_5_0, Opaque_vs_main() ) ); SetPixelShader( CompileShader( ps_5_0, Opaque_fs_main() ) ); SetBlendState(ourBlendState, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF); SetDepthStencilState(ourDepthStencilState,0); SetRasterizerState(ourRasterState); } } #endif #else technique Opaque { pass pass0 { VertexProgram = compile arbvp1 Opaque_vs_main(); FragmentProgram = compile arbfp1 Opaque_fs_main(); } } #endif D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx1COLOR_BIASEXCLUSIONGGGGGGGG?????AA?pP05spDXBC&PNp8|PhRDEF<H<ARD11< ($  ! *5 >PointClampSamplerLinearClampSamplerdepthTexstencilTexlightTex$Globals>`P@@@@$/@7@@=@Kdd 0@viewfloat4x4projectionviewprojectioneyeDirectionWSfloat4eyePositionWSeyePositionOScameraNearmodelITmodelmodelViewProjcameraNearTimesFarfloat^cameraFarMinusNearcameraNearFarprjPlaneUprjPlaneVprjPlaneOrigincolorBiascolorScalestencil_texDim_depthScale_maskstencil_testColorsMicrosoft (R) HLSL Shader Compiler 10.1ISGN  SV_POSITIONTEXCOORDOSGN, SV_TARGETSHEXt PjYF $Z`Z` XpUUXpDDXpUUbbrbber h2F 2F@??8 R@??66:A" @?6rF6:6 6"6B:ECUFF~` +@6 A: 4:@3:@?::62FECUFF~`6 6 :6 8  6" A   6 A6 6 :62F82FF #2F6@: #-"FF~6" V 8 * #6 +"@6B*A"*8V V +"@6B:A"*8V VV8V6VAV 6@?6VAV "K"6"A":":4"@3"@?8"6"A"@?4"@3"@?8" 6B@"*8""@?4"@3"@?6B AB*@?6*A:@?8":"*+B@6:AB:*8 @C6 A *6 A4: 1 @@? @?8 *+B@6AB:*8*  6@r8rFF rF@???8rFF "r FF !>STATlI SPDBMicrosoft C/C++ MSF 7.00 DSShO8 <.1`^!DE(/l^ȗ#Q3SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; RenderTargetWriteMask [ 0 ] = 15 ; AlphaToCoverageEnable = false ; } ; DepthStencilState ourDepthStencilState { DepthEnable = true ; DepthFunc = less ; StencilEnable = false ; } ; RasterizerState ourRasterState { CullMode = None ; DepthBias = 0.0f ; ScissorEnable = false ; MultiSampleEnable = false ; DepthClipEnable = false ; AntialiasedLineEnable = falseZLHdPh&uVUq*X ]fQvvA$PAId?*#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_Occlusion_vs__Occlusion_fs__8487.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 6 BlendState ourBlendState { BlendEnable [ 0 ] = FALSE ; BlendEnable [ 1 ] = FALSE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; RenderTargetWriteMask [ 0 ] = 15 ; AlphaToCoverageEnable = false ; } ; DepthStencilState ourDepthStencilState { DepthEnable = true ; DepthFunc = less ; StencilEnable = false ; } ; RasterizerState ourRasterState { CullMode = None ; DepthBias = 0.0f ; ScissorEnable = false ; MultiSampleEnable = false ; DepthClipEnable = false ; AntialiasedLineEnable = false ; } ; #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 8 #line 16 #line 20 #line 135 #line 140 #line 147 BlendState NoBlend_BlendState { BlendEnable [ 0 ] = FALSE ; } ; BlendState Alpha_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = Src_Alpha ; DestBlendAlpha [ 0 ] = Inv_Src_Alpha ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; BlendState Additive_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = ONE ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = Src_Alpha ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; #line 180 BlendState ParticleBlended_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = ONE ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = Inv_Src_Alpha ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; DepthStencilState NoDepthTest_NoDepthWrite_DepthState { DepthEnable = FALSE ; DepthWriteMask = Zero ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState NoDepthTest_DepthWrite_DepthState { DepthEnable = FALSE ; DepthWriteMask = All ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState DepthTest_NoDepthWrite_DepthState { DepthEnable = TRUE ; DepthWriteMask = Zero ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState DepthTest_DepthWrite_DepthState { DepthEnable = TRUE ; DepthWriteMask = All ; DepthFunc = Less ; StencilEnable = FALSE ; } ; RasterizerState NoCull_RasterizerState { CullMode = None ; } ; RasterizerState BackFaceCull_RasterizerState { CullMode = Back ; FrontCounterClockwise = TRUE ; } ; RasterizerState FrontFaceCull_RasterizerState { CullMode = Front ; FrontCounterClockwise = TRUE ; } ; #line 243 #line 246 #line 264 #line 269 sampler PointClampSampler : register ( s8 ) { Filter = Min_Mag_Mip_Point ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; } ; sampler LinearClampSampler : register ( s9 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; } ; sampler LinearWrapTSampler : register ( s10 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Clamp ; AddressV = Wrap ; AddressW = Clamp ; } ; sampler LinearWrapSampler : register ( s11 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; } ; sampler PointWrapSampler : register ( s12 ) { Filter = Min_Mag_Mip_Point ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; } ; sampler AnisoClampSampler : register ( s13 ) { Filter = ANISOTROPIC ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; MaxAnisotropy = 16 ; } ; sampler LinearWrapAnisoSampler : register ( s14 ) { Filter = ANISOTROPIC ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; MaxAnisotropy = 16 ; } ; sampler PointWrapAnisoSampler : register ( s15 ) { Filter = Min_Mag_Point_Mip_Linear ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; MaxAnisotropy = 16 ; } ; static const float kSRGB = 2.2f ; #line 358 #line 373 #line 408 #line 427 #line 435 #line 498 #line 506 float4x4 view : view ; float4x4 projection : projection ; float4x4 viewprojection : viewprojection ; float4 eyeDirectionWS : eyeDirectionWS ; float4 eyePositionWS : eyePositionWS ; float4 eyePositionOS : eyePositionOS ; float4 cameraNear : cameraNearFar ; float4x4 modelIT : modelit ; float4x4 model : model ; float4x4 modelViewProj : modelviewproj ; #line 521 float cameraNearTimesFar ; float cameraFarMinusNear ; float4 cameraNearFar ; #line 527 float ConvertDepth ( float depth ) { #line 532 float viewSpaceZ = - ( cameraNearTimesFar / ( depth * cameraFarMinusNear - cameraNearFar . y ) ) ; return viewSpaceZ ; } #line 587 #line 592 static const float4x4 SCALE_BIAS = float4x4 ( float4 ( 0.5 , 0.0 , 0.0 , 0.5 ) , float4 ( 0.0 , - 0.5 , 0.0 , 0.5 ) , #line 598 float4 ( 0.0 , 0.0 , 0.5 , 0.5 ) , float4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ) ; #line 613 #line 635 #line 642 #line 54 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 64 struct p2v { #line 68 float3 Position : POSITION ; float3 tint : TEXCOORD0 ; float4 occPosRad : TEXCOORD1 ; float4 intShNoiseEx : TEXCOORD2 ; } ; struct Opaque_vs_v2f { float4 position : SV_POSITION ; float4 clip : TEXCOORD0 ; float3 tint : TEXCOORD1 ; float4 occPosRad : TEXCOORD2 ; float4 intShNoiseEx : TEXCOORD3 ; } ; #line 88 void Opaque_vs_main ( in p2v Opaque_vs_IN , out Opaque_vs_v2f Opaque_vs_OUT ) { Opaque_vs_OUT . position = mul ( float4 ( Opaque_vs_IN . Position . xyz , 1 ) , modelViewProj ) ; Opaque_vs_OUT . clip = Opaque_vs_OUT . position ; Opaque_vs_OUT . tint = Opaque_vs_IN . tint ; Opaque_vs_OUT . occPosRad = Opaque_vs_IN . occPosRad ; Opaque_vs_OUT . intShNoiseEx = Opaque_vs_IN . intShNoiseEx ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 111 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 120 float4 prjPlaneU ; float4 prjPlaneV ; float4 prjPlaneOrigin ; float4 colorBias ; float4 colorScale ; #line 134 Texture2D < float4 > depthTex ; #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/d3dutils.sh" float4 stencil_texDim_depthScale_mask ; float4 stencil_testColors ; #line 25 Texture2D < uint2 > stencilTex ; float GetStencilMask ( float2 uv ) { float2 uvScaled = uv * stencil_texDim_depthScale_mask . xy ; uint3 uvInt = uint3 ( uint2 ( uvScaled ) , 0 ) ; uint mask = uint ( stencil_texDim_depthScale_mask . w ) ; uint stencil = stencilTex . Load ( uvInt ) . g ; uint stencilMasked = stencil & mask ; float d = float ( stencilMasked ) ; return d * stencil_texDim_depthScale_mask . z ; } #line 44 #line 140 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 143 Texture2D < float4 > lightTex ; #line 153 #line 162 struct Opaque_fs_v2f { float4 position : SV_POSITION ; float4 clip : TEXCOORD0 ; float3 tint : TEXCOORD1 ; float4 occPosRad : TEXCOORD2 ; float4 intShNoiseEx : TEXCOORD3 ; } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 181 float myTexDepth2D ( Texture2D < float4 > depthTex , float2 uv ) { #line 187 return depthTex . Sample ( PointClampSampler , uv ) . r ; } #line 195 void Opaque_fs_main ( in Opaque_fs_v2f Opaque_fs_IN , out Opaque_fs_f2f Opaque_fs_OUT ) { float2 uv = 0.5 * ( Opaque_fs_IN . clip . xy / Opaque_fs_IN . clip . w + 1.0 ) ; float2 uvOrig = uv ; uv . y = 1.0f - uv . y ; float3 occPos = Opaque_fs_IN . occPosRad . xyz ; float rad = Opaque_fs_IN . occPosRad . w ; float intensity = Opaque_fs_IN . intShNoiseEx . x ; float sharpness = Opaque_fs_IN . intShNoiseEx . y ; float noise = Opaque_fs_IN . intShNoiseEx . z ; float exclude = Opaque_fs_IN . intShNoiseEx . w ; float lightTap = saturate ( lightTex . Sample ( LinearClampSampler , uv ) . a - 1 ) ; float excludeOverride = saturate ( lightTex . Sample ( LinearClampSampler , uv ) . a - 2 ) ; float depthTap = myTexDepth2D ( depthTex , uv ) ; #line 215 float z = ConvertDepth ( depthTap ) ; #line 220 float stencilTap = GetStencilMask ( uv ) ; #line 224 float3 projPointer = prjPlaneOrigin . xyz + ( 1 - uvOrig . x ) * prjPlaneU . xyz + ( 1 - uvOrig . y ) * prjPlaneV . xyz ; float3 camSpace = z * projPointer ; float3 pos = eyePositionWS . xyz - camSpace ; #line 231 float irradience = 1.0 ; #line 269 #line 277 float3 to = occPos - pos ; float dist = length ( to ) ; float rd = saturate ( ( rad - dist ) / rad ) ; irradience *= saturate ( 1.0 - rd * rd ) ; #line 285 irradience = saturate ( 0.5 + sharpness * ( irradience - 0.5 ) ) ; irradience = lerp ( 1.0 - intensity , 1.0 , irradience ) ; float exclusion = ( 1 - excludeOverride ) * ( abs ( exclude - stencilTap * 256.0 ) < 0.75 ) ; irradience = lerp ( irradience , 1 , exclusion ) ; Opaque_fs_OUT . color . rgb = lerp ( float3 ( 1.0 , 1.0 , 1.0 ) , float3 ( irradience , irradience , irradience ) , Opaque_fs_IN . tint ) ; Opaque_fs_OUT . color . rgb = colorScale . rgb * Opaque_fs_OUT . color . rgb + colorBias . rgb ; } technique11 Opaque { pass pass0 { SetVertexShader ( CompileShader ( vs_5_0 , Opaque_vs_main ( ) ) ) ; SetPixelShader ( CompileShader ( ps_5_0 , Opaque_fs_main ( ) ) ) ; SetBlendState ( ourBlendState , float4 ( 0.0f , 0.0f , 0.0f , 0.0f ) , 0xFFFFFFFF ) ; SetDepthStencilState ( ourDepthStencilState , 0 ) ; SetRasterizerState ( ourRasterState ) ; } } #line 332 )+D:\Dev\TGC\Journey\head\Journey\shaderd:\dev\tgc\journey\head\journey\shader#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_Occlusion_vs__Occlusion_fs__8487.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 6 BlendState ourBlendState { BlendEnable [ 0 ] = FALSE ; BlendEnable [ 1 ] = FALSE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; 0)(0^0Ї)()B< G GMicrosoft (R) HLSL Shader Compiler 10.1z=hlslFlags0x4005hlslTargetps_5_0hlslEntryOpaque_fs_mainhlslDefines /DEXCLUSION=1 /DPHYRE_D3DFX=1 /DCOLOR_BIAS=16 Opaque_fs_main2> Opaque_fs_INP P P P  P P P P P  P$ $P( (P, 0P0 4P4 8P8 <P< @P@ DPD HPH L6> Opaque_fs_OUTP  P P P P0  P0  P0  *> uvPPP\.> uvOrigP(P( .>occPosPp Pp Pp *>@radP 2>@intensityP 2>@sharpnessP $.>@excludeP (6>@excludeOverridePl ,.>@depthTapP0*>@zP02>@stencilTapP2>projPointerPPP .>camSpacePPP *>posP,,P,,P,, 2>@irradienceP@0P0p$P <*>toPtPtpPtH *>@distP*>@rdP,2>@exclusionP0 d.M   = @ 7  = ,B> P0*>  uvPTPTNFM   f L   3 L P `  b8  d   B> P0.>@depthP02>@viewSpaceZP(0NM   @ 4 =4 4 )8 ' 3   >  ,  2  ;  . 2$  '  % 1 F> P*>  uvP P .> uvScaledPLPp.>uvIntP@PDPL*>umaskP0T.>ustencilPhd6>ustencilMaskedP*>@dP N8K.Tওͮ%Z*c***8 t , ((@@\\pp44PPllpptt00LLll00TThh44TThh  ,,@@XXtt,,HH``||88TTpp $ $$ $$ $< $< $X $X $t $t $ $ $ $ $ $ $ $ $ $ $ $ $0 %0 %D %D %\ %\ %x %x % % % ( ( ( ( ( ( ( (0 +0 +P +P +p -p -TJTPTR 4 2. ,7 57 55 3`(T`(\`(\`(\`^`^53535353535 3)')')')')')')')') '.,.,.,.,.,.,.,.,.,.,.,. ,}3@}3@}3@}1T}T}Zg}Zg}Zg}X{}{'%1/1/   2&2&2.2020.$*.*.*.,.,.,F1@F1@F#BFBFDFD>'>'><><><><a+a+a+aCTa9Ta9Ta3Va3Va3]a_a_6464646464####d#Pd#b4 (0@ Hp(Hl          uuint2   18\ ||@float4@ float3b position clip  tint ,occPosRad <intShNoiseEx"LOpaque_fs_v2f color"Opaque_fs_f2f @float2   @   @    u uint3  AyL ; } ; #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 8 #line 16 #line 20 #line 135 #line 140 #line 147 BlendState NoBlend_BlendState { BlendEnable [ 0 ] = FALSE ; } ; BlendState Alpha_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = Src_Alpha ; DestBlendAlpha [ 0 ] = Inv_Src_Alpha ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; BlendState Additive_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = ONE ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = Src_Alpha ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; #line 180 BlendState ParticleBlended_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = ONE ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = Inv_Src_Alpha ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; DepthStencilState NoDepthTest_NoDepthWrite_DepthState { DepthEnable = FALSE ; DepthWriteMask = Zero ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState NoDepthTest_DepthWrite_DepthState { DepthEnable = FALSE ; DepthWriteMask = All ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState DepthTest_NoDepthWrite_DepthState { DepthEnable = TRUE ; DepthWriteMask = Zero ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState DepthTest_DepthWrite_DepthState { DepthEnable = TRUE ; DepthWriteMask = All ; DepthFunc = Less ; StencilEnable = FALSE ; } ; RasterizerState NoCull_RasterizerState { CullMode = None ; } ; RasterizerState BackFaceCull_RasterizerState { CullMode = Back ; FrontCounterClockwise = TRUE ; } ; RasterizerState FrontFaceCull_RasterizerState { CullMode = Front ; FrontCounterClockwise = TRUE ; } ; #line 243 #line 246 #line 264 #line 269 sampler PointClampSampler : register ( s8 ) { Filter = Min_Mag_Mip_Point ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; } ; sampler LinearClampSampler : register ( s9 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; } ; sampler LinearWrapTSampler : register ( s10 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Clamp ; AddressV = Wrap ; AddressW = Clamp ; } ; sampler LinearWrapSampler : register ( s11 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; } ; sampler PointWrapSampler : register ( s12 ) { Filter = Min_Mag_Mip_Point ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; } ; sampler AnisoClampSampler : register ( s13 ) { Filter = ANISOTROPIC ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; MaxAnisotropy = 16 ; } ; sampler LinearWrapAnisoSampler : register ( s14 ) { Filter = ANISOTROPIC ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; MaxAnisotropy = 16 ; } ; sampler PointWrapAnisoSampler : register ( s15 ) { Filter = Min_Mag_Point_Mip_Linear ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; MaxAnisotropy = 16 ; } ; static const float kSRGB = 2.2f ; #line 358 #line 373 #line 408 #line 427 #line 435 #line 498 #line 506 float4x4 view : view ; float4x4 projection : projection ; float4x4 viewprojection : viewprojection ; float4 eyeDirectionWS : eyeDirectionWS ; float4 eyePositionWS : eyePositionWS ; float4 eyePositionOS : eyePositionOS ; float4 cameraNear : cameraNearFar ; float4x4 modelIT : modelit ; float4x4 model : model ; float4x4 modelViewProj : modelviewproj ; #line 521 float cameraNearTimesFar ; float cameraFarMinusNear ; float4 cameraNearFar ; #line 527 float ConvertDepth ( float depth ) { #line 532 float viewSpaceZ = - ( cameraNearTimesFar / ( depth * cameraFarMinusNear - cameraNearFar . y ) ) ; return viewSpaceZ ; } #line 587 #line 592 static const float4x4 SCALE_BIAS = float4x4 ( float4 ( 0.5 , 0.0 , 0.0 , 0.5 ) , float4 ( 0.0 , - 0.5 , 0.0 , 0.5 ) , #line 598 float4 ( 0.0 , 0.0 , 0.5 , 0.5 ) , float4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ) ; #line 613 #line 635 #line 642 #line 54 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 64 struct p2v { #line 68 float3 Position : POSITION ; float3 tint : TEXCOORD0 ; float4 occPosRad : TEXCOORD1 ; float4 intShNoiseEx : TEXCOORD2 ; } ; struct Opaque_vs_v2f { float4 position : SV_POSITION ; float4 clip : TEXCOORD0 ; float3 tint : TEXCOORD1 ; float4 occPosRad : TEXCOORD2 ; float4 intShNoiseEx : TEXCOORD3 ; } ; #line 88 void Opaque_vs_main ( in p2v Opaque_vs_IN , out Opaque_vs_v2f Opaque_vs_OUT ) { Opaque_vs_OUT . position = mul ( float4 ( Opaque_vs_IN . Position . xyz , 1 ) , modelViewProj ) ; Opaque_vs_OUT . clip = Opaque_vs_OUT . position ; Opaque_vs_OUT . tint = Opaque_vs_IN . tint ; Opaque_vs_OUT . occPosRad = Opaque_vs_IN . occPosRad ; Opaque_vs_OUT . intShNoiseEx = Opaque_vs_IN . intShNoiseEx ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 111 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 120 float4 prjPlaneU ; float4 prjPlaneV ; float4 prjPlaneOrigin ; float4 colorBias ; float4 colorScale ; #line 134 Texture2D < float4 > depthTex ; #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/d3dutils.sh" float4 stencil_texDim_depthScale_mask ; float4 stencil_testColors ; #line 25 Texture2D < uint2 > stencilTex ; float GetStencilMask ( float2 uv ) { float2 uvScaled = uv * stencil_texDim_depthScale_mask . xy ; uint3 uvInt = uint3 ( uint2 ( uvScaled ) , 0 ) ; uint mask = uint ( stencil_texDim_depthScale_mask . w ) ; uint stencil = stencilTex . Load ( uvInt ) . g ; uint stencilMasked = stencil & mask ; float d = float ( stencilMasked ) ; return d * stencil_texDim_depthScale_mask . z ; } #line 44 #line 140 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 143 Texture2D < float4 > lightTex ; #line 153 #line 162 struct Opaque_fs_v2f { float4 position : SV_POSITION ; float4 clip : TEXCOORD0 ; float3 tint : TEXCOORD1 ; float4 occPosRad : TEXCOORD2 ; float4 intShNoiseEx : TEXCOORD3 ; } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 181 float myTexDepth2D ( Texture2D < float4 > depthTex , float2 uv ) { #line 187 return depthTex . Sample ( PointClampSampler , uv ) . r ; } #line 195 void Opaque_fs_main ( in Opaque_fs_v2f Opaque_fs_IN , out Opaque_fs_f2f Opaque_fs_OUT ) { float2 uv = 0.5 * ( Opaque_fs_IN . clip . xy / Opaque_fs_IN . clip . w + 1.0 ) ; float2 uvOrig = uv ; uv . y = 1.0f - uv . y ; float3 occPos = Opaque_fs_IN . occPosRad . xyz ; float rad = Opaque_fs_IN . occPosRad . w ; float intensity = Opaque_fs_IN . intShNoiseEx . x ; float sharpness = Opaque_fs_IN . intShNoiseEx . y ; float noise = Opaque_fs_IN . intShNoiseEx . z ; float exclude = Opaque_fs_IN . intShNoiseEx . w ; float lightTap = saturate ( lightTex . Sample ( LinearClampSampler , uv ) . a - 1 ) ; float excludeOverride = saturate ( lightTex . Sample ( LinearClampSampler , uv ) . a - 2 ) ; float depthTap = myTexDepth2D ( depthTex , uv ) ; #line 215 float z = ConvertDepth ( depthTap ) ; #line 220 float stencilTap = GetStencilMask ( uv ) ; #line 224 float3 projPointer = prjPlaneOrigin . xyz + ( 1 - uvOrig . x ) * prjPlaneU . xyz + ( 1 - uvOrig . y ) * prjPlaneV . xyz ; float3 camSpace = z * projPointer ; float3 pos = eyePositionWS . xyz - camSpace ; #line 231 float irradience = 1.0 ; #line 269 #line 277 float3 to = occPos - pos ; float dist = length ( to ) ; float rd = saturate ( ( rad - dist ) / rad ) ; irradience *= saturate ( 1.0 - rd * rd ) ; #line 285 irradience = saturate ( 0.5 + sharpness * ( irradience - 0.5 ) ) ; irradience = lerp ( 1.0 - intensity , 1.0 , irradience ) ; float exclusion = ( 1 - excludeOverride ) * ( abs ( exclude - stencilTap * 256.0 ) < 0.75 ) ; irradience = lerp ( irradience , 1 , exclusion ) ; Opaque_fs_OUT . color . rgb = lerp ( float3 ( 1.0 , 1.0 , 1.0 ) , float3 ( irradience , irradience , irradience ) , Opaque_fs_IN . tint ) ; Opaque_fs_OUT . color . rgb = colorScale . rgb * Opaque_fs_OUT . color . rgb + colorBias . rgb ; } technique11 Opaque { pass pass0 { SetVertexShader ( CompileShader ( vs_5_0 , Opaque_vs_main ( ) ) ) ; SetPixelShader ( CompileShader ( ps_5_0 , Opaque_fs_main ( ) ) ) ; SetBlendState ( ourBlendState , float4 ( 0.0f , 0.0f , 0.0f , 0.0f ) , 0xFFFFFFFF ) ; SetDepthStencilState ( ourDepthStencilState , 0 ) ; SetRasterizerState ( ourRasterState ) ; } } #line 332 D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_Occlusion_vs__Occlusion_fs__8487.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.shD:/Dev/TGC/Journey/head/Journey/Data/Shaders/d3dutils.sh (c***)P* 18T   myTexDepth2DConvertDepthGetStencilMaskD3DSHDRt `  myTexDepth2DConvertDepthGetStencilMask /D!I )m!qI`@ $0<HT`lx%Opaque_fs_main&QPointClampSampler&Q LinearClampSampler"QeyePositionWS&QcameraNearTimesFar&QcameraFarMinusNear"QcameraNearFarQprjPlaneUQprjPlaneV"QprjPlaneOriginQcolorBiasQ colorScaleQdepthTex2Q0stencil_texDim_depthScale_mask /QstencilTexQlightTexgratory.shD:/Dev/TGC/Journey/head/Journey/Data/Shaders/d3dutils.sh Opaque_fs_mainnonew 1 ?\T ,dt `  Opaque_fs_mainnone-.t `t 'D:\Dev\TGC\Journey\head\Journey\shaderD:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_Occlusion_vs__Occlusion_fs__8487.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Mi.1`^!DE(/l^ȗ#T/LinkInfo/names/src/headerblock/src/files/d:\dev\tgc\journey\head\journey\shader" Q3 si+)(,@M.-LKD0123456789:;<=>?@ABC  !"#$%&'()*+,/EFGIHJNh 8P@@1@1@1`P @00@p@@1`@1 @1@@1@1@1`P @00@p@@1`@1 @184P4 4h4444444484P4 4h44 444444@@@@p@`@P @@0@0@G4G4G4G4G4G4G4G4hB4PB48B4 1@@1`@1 @AnisoClampSamplerLinearClampSamplerLinearWrapAnisoSamplerLinearWrapSamplerLinearWrapTSamplerPointClampSamplerPointWrapAnisoSamplerPointWrapSamplercameraNearcolorBiascolorScaledepthTexeyePositionOSlightTexmodelmodelITmodelViewProjprjPlaneOriginprjPlaneUprjPlaneVstencilTexstencil_testColorsstencil_texDim_depthScale_mask 05sv05spOpaque_fs_mainOpaque_vs_mainhj }R8}RP}RPOSITIONTEXCOORDP05svDXBCAN(|?8 l RDEF\h<A3RD11< ($ \$Globals\P@@@@(6DO@W@@]@k 0 @viewfloat4x4projectionviewprojectioneyeDirectionWSfloat4eyePositionWSeyePositionOScameraNearmodelITmodelmodelViewProjcameraNearTimesFarfloat~cameraFarMinusNearcameraNearFarprjPlaneUprjPlaneVprjPlaneOrigincolorBiascolorScalestencil_texDim_depthScale_maskstencil_testColorsMicrosoft (R) HLSL Shader Compiler 10.1ISGN|hqqqPOSITIONTEXCOORDOSGNSV_POSITIONTEXCOORDSHEXPijYF _r_r__g e er e e h+@6rFFF "FF BFF FF 6 F6r F6 F6 F6 F>STAT  SPDBMicrosoft C/C++ MSF 7.00 DSC4B8 <.1`^zN@^GP Q3SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; RenderTargetWriteMask [ 0 ] = 15 ; AlphaToCoverageEnable = false ; } ; DepthStencilState ourDepthStencilState { DepthEnable = true ; DepthFunc = less ; StencilEnable = false ; } ; RasterizerState ourRasterState { CullMode = None ; DepthBias = 0.0f ; ScissorEnable = false ; MultiSampleEnable = false ; DepthClipEnable = false ; AntialiasedLineEnable = falseLZ7B 9dPh&g79#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_Occlusion_vs__Occlusion_fs__8487.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 6 BlendState ourBlendState { BlendEnable [ 0 ] = FALSE ; BlendEnable [ 1 ] = FALSE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; RenderTargetWriteMask [ 0 ] = 15 ; AlphaToCoverageEnable = false ; } ; DepthStencilState ourDepthStencilState { DepthEnable = true ; DepthFunc = less ; StencilEnable = false ; } ; RasterizerState ourRasterState { CullMode = None ; DepthBias = 0.0f ; ScissorEnable = false ; MultiSampleEnable = false ; DepthClipEnable = false ; AntialiasedLineEnable = false ; } ; #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 8 #line 16 #line 20 #line 135 #line 140 #line 147 BlendState NoBlend_BlendState { BlendEnable [ 0 ] = FALSE ; } ; BlendState Alpha_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = Src_Alpha ; DestBlendAlpha [ 0 ] = Inv_Src_Alpha ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; BlendState Additive_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = ONE ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = Src_Alpha ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; #line 180 BlendState ParticleBlended_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = ONE ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = Inv_Src_Alpha ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; DepthStencilState NoDepthTest_NoDepthWrite_DepthState { DepthEnable = FALSE ; DepthWriteMask = Zero ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState NoDepthTest_DepthWrite_DepthState { DepthEnable = FALSE ; DepthWriteMask = All ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState DepthTest_NoDepthWrite_DepthState { DepthEnable = TRUE ; DepthWriteMask = Zero ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState DepthTest_DepthWrite_DepthState { DepthEnable = TRUE ; DepthWriteMask = All ; DepthFunc = Less ; StencilEnable = FALSE ; } ; RasterizerState NoCull_RasterizerState { CullMode = None ; } ; RasterizerState BackFaceCull_RasterizerState { CullMode = Back ; FrontCounterClockwise = TRUE ; } ; RasterizerState FrontFaceCull_RasterizerState { CullMode = Front ; FrontCounterClockwise = TRUE ; } ; #line 243 #line 246 #line 264 #line 269 sampler PointClampSampler : register ( s8 ) { Filter = Min_Mag_Mip_Point ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; } ; sampler LinearClampSampler : register ( s9 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; } ; sampler LinearWrapTSampler : register ( s10 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Clamp ; AddressV = Wrap ; AddressW = Clamp ; } ; sampler LinearWrapSampler : register ( s11 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; } ; sampler PointWrapSampler : register ( s12 ) { Filter = Min_Mag_Mip_Point ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; } ; sampler AnisoClampSampler : register ( s13 ) { Filter = ANISOTROPIC ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; MaxAnisotropy = 16 ; } ; sampler LinearWrapAnisoSampler : register ( s14 ) { Filter = ANISOTROPIC ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; MaxAnisotropy = 16 ; } ; sampler PointWrapAnisoSampler : register ( s15 ) { Filter = Min_Mag_Point_Mip_Linear ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; MaxAnisotropy = 16 ; } ; static const float kSRGB = 2.2f ; #line 358 #line 373 #line 408 #line 427 #line 435 #line 498 #line 506 float4x4 view : view ; float4x4 projection : projection ; float4x4 viewprojection : viewprojection ; float4 eyeDirectionWS : eyeDirectionWS ; float4 eyePositionWS : eyePositionWS ; float4 eyePositionOS : eyePositionOS ; float4 cameraNear : cameraNearFar ; float4x4 modelIT : modelit ; float4x4 model : model ; float4x4 modelViewProj : modelviewproj ; #line 521 float cameraNearTimesFar ; float cameraFarMinusNear ; float4 cameraNearFar ; #line 527 float ConvertDepth ( float depth ) { #line 532 float viewSpaceZ = - ( cameraNearTimesFar / ( depth * cameraFarMinusNear - cameraNearFar . y ) ) ; return viewSpaceZ ; } #line 587 #line 592 static const float4x4 SCALE_BIAS = float4x4 ( float4 ( 0.5 , 0.0 , 0.0 , 0.5 ) , float4 ( 0.0 , - 0.5 , 0.0 , 0.5 ) , #line 598 float4 ( 0.0 , 0.0 , 0.5 , 0.5 ) , float4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ) ; #line 613 #line 635 #line 642 #line 54 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 64 struct p2v { #line 68 float3 Position : POSITION ; float3 tint : TEXCOORD0 ; float4 occPosRad : TEXCOORD1 ; float4 intShNoiseEx : TEXCOORD2 ; } ; struct Opaque_vs_v2f { float4 position : SV_POSITION ; float4 clip : TEXCOORD0 ; float3 tint : TEXCOORD1 ; float4 occPosRad : TEXCOORD2 ; float4 intShNoiseEx : TEXCOORD3 ; } ; #line 88 void Opaque_vs_main ( in p2v Opaque_vs_IN , out Opaque_vs_v2f Opaque_vs_OUT ) { Opaque_vs_OUT . position = mul ( float4 ( Opaque_vs_IN . Position . xyz , 1 ) , modelViewProj ) ; Opaque_vs_OUT . clip = Opaque_vs_OUT . position ; Opaque_vs_OUT . tint = Opaque_vs_IN . tint ; Opaque_vs_OUT . occPosRad = Opaque_vs_IN . occPosRad ; Opaque_vs_OUT . intShNoiseEx = Opaque_vs_IN . intShNoiseEx ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 111 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 120 float4 prjPlaneU ; float4 prjPlaneV ; float4 prjPlaneOrigin ; float4 colorBias ; float4 colorScale ; #line 134 Texture2D < float4 > depthTex ; #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/d3dutils.sh" float4 stencil_texDim_depthScale_mask ; float4 stencil_testColors ; #line 25 Texture2D < uint2 > stencilTex ; float GetStencilMask ( float2 uv ) { float2 uvScaled = uv * stencil_texDim_depthScale_mask . xy ; uint3 uvInt = uint3 ( uint2 ( uvScaled ) , 0 ) ; uint mask = uint ( stencil_texDim_depthScale_mask . w ) ; uint stencil = stencilTex . Load ( uvInt ) . g ; uint stencilMasked = stencil & mask ; float d = float ( stencilMasked ) ; return d * stencil_texDim_depthScale_mask . z ; } #line 44 #line 140 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 143 Texture2D < float4 > lightTex ; #line 153 #line 162 struct Opaque_fs_v2f { float4 position : SV_POSITION ; float4 clip : TEXCOORD0 ; float3 tint : TEXCOORD1 ; float4 occPosRad : TEXCOORD2 ; float4 intShNoiseEx : TEXCOORD3 ; } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 181 float myTexDepth2D ( Texture2D < float4 > depthTex , float2 uv ) { #line 187 return depthTex . Sample ( PointClampSampler , uv ) . r ; } #line 195 void Opaque_fs_main ( in Opaque_fs_v2f Opaque_fs_IN , out Opaque_fs_f2f Opaque_fs_OUT ) { float2 uv = 0.5 * ( Opaque_fs_IN . clip . xy / Opaque_fs_IN . clip . w + 1.0 ) ; float2 uvOrig = uv ; uv . y = 1.0f - uv . y ; float3 occPos = Opaque_fs_IN . occPosRad . xyz ; float rad = Opaque_fs_IN . occPosRad . w ; float intensity = Opaque_fs_IN . intShNoiseEx . x ; float sharpness = Opaque_fs_IN . intShNoiseEx . y ; float noise = Opaque_fs_IN . intShNoiseEx . z ; float exclude = Opaque_fs_IN . intShNoiseEx . w ; float lightTap = saturate ( lightTex . Sample ( LinearClampSampler , uv ) . a - 1 ) ; float excludeOverride = saturate ( lightTex . Sample ( LinearClampSampler , uv ) . a - 2 ) ; float depthTap = myTexDepth2D ( depthTex , uv ) ; #line 215 float z = ConvertDepth ( depthTap ) ; #line 220 float stencilTap = GetStencilMask ( uv ) ; #line 224 float3 projPointer = prjPlaneOrigin . xyz + ( 1 - uvOrig . x ) * prjPlaneU . xyz + ( 1 - uvOrig . y ) * prjPlaneV . xyz ; float3 camSpace = z * projPointer ; float3 pos = eyePositionWS . xyz - camSpace ; #line 231 float irradience = 1.0 ; #line 269 #line 277 float3 to = occPos - pos ; float dist = length ( to ) ; float rd = saturate ( ( rad - dist ) / rad ) ; irradience *= saturate ( 1.0 - rd * rd ) ; #line 285 irradience = saturate ( 0.5 + sharpness * ( irradience - 0.5 ) ) ; irradience = lerp ( 1.0 - intensity , 1.0 , irradience ) ; float exclusion = ( 1 - excludeOverride ) * ( abs ( exclude - stencilTap * 256.0 ) < 0.75 ) ; irradience = lerp ( irradience , 1 , exclusion ) ; Opaque_fs_OUT . color . rgb = lerp ( float3 ( 1.0 , 1.0 , 1.0 ) , float3 ( irradience , irradience , irradience ) , Opaque_fs_IN . tint ) ; Opaque_fs_OUT . color . rgb = colorScale . rgb * Opaque_fs_OUT . color . rgb + colorBias . rgb ; } technique11 Opaque { pass pass0 { SetVertexShader ( CompileShader ( vs_5_0 , Opaque_vs_main ( ) ) ) ; SetPixelShader ( CompileShader ( ps_5_0 , Opaque_fs_main ( ) ) ) ; SetBlendState ( ourBlendState , float4 ( 0.0f , 0.0f , 0.0f , 0.0f ) , 0xFFFFFFFF ) ; SetDepthStencilState ( ourDepthStencilState , 0 ) ; SetRasterizerState ( ourRasterState ) ; } } #line 332 )+D:\Dev\TGC\Journey\head\Journey\shaderd:\dev\tgc\journey\head\journey\shader#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_Occlusion_vs__Occlusion_fs__8487.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 6 BlendState ourBlendState { BlendEnable [ 0 ] = FALSE ; BlendEnable [ 1 ] = FALSE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; 0J)(0^0Ї)()B< G GMicrosoft (R) HLSL Shader Compiler 10.1z=hlslFlags0x4005hlslTargetvs_5_0hlslEntryOpaque_vs_mainhlslDefines /DEXCLUSION=1 /DPHYRE_D3DFX=1 /DCOLOR_BIAS=16Opaque_vs_main2> Opaque_vs_INPPPP PPP P$P (P$,P(0P,4P08P4<6> Opaque_vs_OUTP<@P@DPDHPHLP,0P04P48P8<P  P$$P((PPPPPPPP  PPPP <d8K.Tওͮ%Z*c***8 ,[[[[[[[[[[[[<\<\P]P]d^d^x_x_````e&Qe ce ce ce ce c530.:8@> 18  008@ float3@float4R Position  tint occPosRad (intShNoiseEx8p2vb position clip  tint ,occPosRad <intShNoiseEx"LOpaque_vs_v2f @@float4x4     18  ; } ; #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 8 #line 16 #line 20 #line 135 #line 140 #line 147 BlendState NoBlend_BlendState { BlendEnable [ 0 ] = FALSE ; } ; BlendState Alpha_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = Src_Alpha ; DestBlendAlpha [ 0 ] = Inv_Src_Alpha ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; BlendState Additive_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = ONE ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = Src_Alpha ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; #line 180 BlendState ParticleBlended_BlendState { BlendEnable [ 0 ] = TRUE ; SrcBlend [ 0 ] = ONE ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = Inv_Src_Alpha ; BlendOpAlpha [ 0 ] = ADD ; BlendEnable [ 1 ] = FALSE ; } ; DepthStencilState NoDepthTest_NoDepthWrite_DepthState { DepthEnable = FALSE ; DepthWriteMask = Zero ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState NoDepthTest_DepthWrite_DepthState { DepthEnable = FALSE ; DepthWriteMask = All ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState DepthTest_NoDepthWrite_DepthState { DepthEnable = TRUE ; DepthWriteMask = Zero ; DepthFunc = Less ; StencilEnable = FALSE ; } ; DepthStencilState DepthTest_DepthWrite_DepthState { DepthEnable = TRUE ; DepthWriteMask = All ; DepthFunc = Less ; StencilEnable = FALSE ; } ; RasterizerState NoCull_RasterizerState { CullMode = None ; } ; RasterizerState BackFaceCull_RasterizerState { CullMode = Back ; FrontCounterClockwise = TRUE ; } ; RasterizerState FrontFaceCull_RasterizerState { CullMode = Front ; FrontCounterClockwise = TRUE ; } ; #line 243 #line 246 #line 264 #line 269 sampler PointClampSampler : register ( s8 ) { Filter = Min_Mag_Mip_Point ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; } ; sampler LinearClampSampler : register ( s9 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; } ; sampler LinearWrapTSampler : register ( s10 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Clamp ; AddressV = Wrap ; AddressW = Clamp ; } ; sampler LinearWrapSampler : register ( s11 ) { Filter = Min_Mag_Mip_Linear ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; } ; sampler PointWrapSampler : register ( s12 ) { Filter = Min_Mag_Mip_Point ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; } ; sampler AnisoClampSampler : register ( s13 ) { Filter = ANISOTROPIC ; AddressU = Clamp ; AddressV = Clamp ; AddressW = Clamp ; MaxAnisotropy = 16 ; } ; sampler LinearWrapAnisoSampler : register ( s14 ) { Filter = ANISOTROPIC ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; MaxAnisotropy = 16 ; } ; sampler PointWrapAnisoSampler : register ( s15 ) { Filter = Min_Mag_Point_Mip_Linear ; AddressU = Wrap ; AddressV = Wrap ; AddressW = Wrap ; MaxAnisotropy = 16 ; } ; static const float kSRGB = 2.2f ; #line 358 #line 373 #line 408 #line 427 #line 435 #line 498 #line 506 float4x4 view : view ; float4x4 projection : projection ; float4x4 viewprojection : viewprojection ; float4 eyeDirectionWS : eyeDirectionWS ; float4 eyePositionWS : eyePositionWS ; float4 eyePositionOS : eyePositionOS ; float4 cameraNear : cameraNearFar ; float4x4 modelIT : modelit ; float4x4 model : model ; float4x4 modelViewProj : modelviewproj ; #line 521 float cameraNearTimesFar ; float cameraFarMinusNear ; float4 cameraNearFar ; #line 527 float ConvertDepth ( float depth ) { #line 532 float viewSpaceZ = - ( cameraNearTimesFar / ( depth * cameraFarMinusNear - cameraNearFar . y ) ) ; return viewSpaceZ ; } #line 587 #line 592 static const float4x4 SCALE_BIAS = float4x4 ( float4 ( 0.5 , 0.0 , 0.0 , 0.5 ) , float4 ( 0.0 , - 0.5 , 0.0 , 0.5 ) , #line 598 float4 ( 0.0 , 0.0 , 0.5 , 0.5 ) , float4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ) ; #line 613 #line 635 #line 642 #line 54 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 64 struct p2v { #line 68 float3 Position : POSITION ; float3 tint : TEXCOORD0 ; float4 occPosRad : TEXCOORD1 ; float4 intShNoiseEx : TEXCOORD2 ; } ; struct Opaque_vs_v2f { float4 position : SV_POSITION ; float4 clip : TEXCOORD0 ; float3 tint : TEXCOORD1 ; float4 occPosRad : TEXCOORD2 ; float4 intShNoiseEx : TEXCOORD3 ; } ; #line 88 void Opaque_vs_main ( in p2v Opaque_vs_IN , out Opaque_vs_v2f Opaque_vs_OUT ) { Opaque_vs_OUT . position = mul ( float4 ( Opaque_vs_IN . Position . xyz , 1 ) , modelViewProj ) ; Opaque_vs_OUT . clip = Opaque_vs_OUT . position ; Opaque_vs_OUT . tint = Opaque_vs_IN . tint ; Opaque_vs_OUT . occPosRad = Opaque_vs_IN . occPosRad ; Opaque_vs_OUT . intShNoiseEx = Opaque_vs_IN . intShNoiseEx ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 111 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 120 float4 prjPlaneU ; float4 prjPlaneV ; float4 prjPlaneOrigin ; float4 colorBias ; float4 colorScale ; #line 134 Texture2D < float4 > depthTex ; #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/d3dutils.sh" float4 stencil_texDim_depthScale_mask ; float4 stencil_testColors ; #line 25 Texture2D < uint2 > stencilTex ; float GetStencilMask ( float2 uv ) { float2 uvScaled = uv * stencil_texDim_depthScale_mask . xy ; uint3 uvInt = uint3 ( uint2 ( uvScaled ) , 0 ) ; uint mask = uint ( stencil_texDim_depthScale_mask . w ) ; uint stencil = stencilTex . Load ( uvInt ) . g ; uint stencilMasked = stencil & mask ; float d = float ( stencilMasked ) ; return d * stencil_texDim_depthScale_mask . z ; } #line 44 #line 140 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fx" #line 143 Texture2D < float4 > lightTex ; #line 153 #line 162 struct Opaque_fs_v2f { float4 position : SV_POSITION ; float4 clip : TEXCOORD0 ; float3 tint : TEXCOORD1 ; float4 occPosRad : TEXCOORD2 ; float4 intShNoiseEx : TEXCOORD3 ; } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 181 float myTexDepth2D ( Texture2D < float4 > depthTex , float2 uv ) { #line 187 return depthTex . Sample ( PointClampSampler , uv ) . r ; } #line 195 void Opaque_fs_main ( in Opaque_fs_v2f Opaque_fs_IN , out Opaque_fs_f2f Opaque_fs_OUT ) { float2 uv = 0.5 * ( Opaque_fs_IN . clip . xy / Opaque_fs_IN . clip . w + 1.0 ) ; float2 uvOrig = uv ; uv . y = 1.0f - uv . y ; float3 occPos = Opaque_fs_IN . occPosRad . xyz ; float rad = Opaque_fs_IN . occPosRad . w ; float intensity = Opaque_fs_IN . intShNoiseEx . x ; float sharpness = Opaque_fs_IN . intShNoiseEx . y ; float noise = Opaque_fs_IN . intShNoiseEx . z ; float exclude = Opaque_fs_IN . intShNoiseEx . w ; float lightTap = saturate ( lightTex . Sample ( LinearClampSampler , uv ) . a - 1 ) ; float excludeOverride = saturate ( lightTex . Sample ( LinearClampSampler , uv ) . a - 2 ) ; float depthTap = myTexDepth2D ( depthTex , uv ) ; #line 215 float z = ConvertDepth ( depthTap ) ; #line 220 float stencilTap = GetStencilMask ( uv ) ; #line 224 float3 projPointer = prjPlaneOrigin . xyz + ( 1 - uvOrig . x ) * prjPlaneU . xyz + ( 1 - uvOrig . y ) * prjPlaneV . xyz ; float3 camSpace = z * projPointer ; float3 pos = eyePositionWS . xyz - camSpace ; #line 231 float irradience = 1.0 ; #line 269 #line 277 float3 to = occPos - pos ; float dist = length ( to ) ; float rd = saturate ( ( rad - dist ) / rad ) ; irradience *= saturate ( 1.0 - rd * rd ) ; #line 285 irradience = saturate ( 0.5 + sharpness * ( irradience - 0.5 ) ) ; irradience = lerp ( 1.0 - intensity , 1.0 , irradience ) ; float exclusion = ( 1 - excludeOverride ) * ( abs ( exclude - stencilTap * 256.0 ) < 0.75 ) ; irradience = lerp ( irradience , 1 , exclusion ) ; Opaque_fs_OUT . color . rgb = lerp ( float3 ( 1.0 , 1.0 , 1.0 ) , float3 ( irradience , irradience , irradience ) , Opaque_fs_IN . tint ) ; Opaque_fs_OUT . color . rgb = colorScale . rgb * Opaque_fs_OUT . color . rgb + colorBias . rgb ; } technique11 Opaque { pass pass0 { SetVertexShader ( CompileShader ( vs_5_0 , Opaque_vs_main ( ) ) ) ; SetPixelShader ( CompileShader ( ps_5_0 , Opaque_fs_main ( ) ) ) ; SetBlendState ( ourBlendState , float4 ( 0.0f , 0.0f , 0.0f , 0.0f ) , 0xFFFFFFFF ) ; SetDepthStencilState ( ourDepthStencilState , 0 ) ; SetRasterizerState ( ourRasterState ) ; } } #line 332 D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_Occlusion_vs__Occlusion_fs__8487.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.shD:/Dev/TGC/Journey/head/Journey/Data/Shaders/d3dutils.sh (c***)P*D3DSHDR ` / ! %Opaque_vs_main"Q modelViewProj /gratory.shD:/Dev/TGC/Journey/head/Journey/Data/Shaders/d3dutils.sh Opaque_vs_mainnonew 1 ?\T ,d ` Opaque_vs_mainnone-. `'D:\Dev\TGC\Journey\head\Journey\shaderD:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_Occlusion_vs__Occlusion_fs__8487.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_Occlusion_vs__Occlusion_fs__8487.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Mi.1`^zN@^GP T/LinkInfo/names/src/headerblock/src/files/d:\dev\tgc\journey\head\journey\shader" Q3 s8i+)|8(,,D@#?>$%&'()*+,-./012345678  !"9:;=<APOSITIONTEXCOORDPEffectVariantPMaterialOpaqueVertexST   'p`P@055555555h6P686 1XhX1PXZP!PAP P XXXP1 XXXXXXXXHP! PAP!PaXX PQ P P P ( P 3 hPha`оAdP>&v A