RYHPT54611~>.7#5 RyLq7'^P0"2@8000T IT kH Xp0 00M0f00h0 0{000Z$   000 0 @(03(0 ! P0F0)000 @0W0}0A0$0& F*0~*00*00&/0:00V 00F030_A0u50A000g9 00w@0 4 (    Cx0 00F07A0L0f 0x000M0N0O00(0Q0R0O00$X0)81@=HOLbPy  $ (3 ,K 0\ 4p 8 < @  D   X X` 0  F 0c @u P h l        "      ( 8# @I Pq ` b  !  (  (  9    3    #   X X T # . D P \ d l t ~        * + )( ,8 H  -  .  C  X - E ] u  /  0(. 8   ;  Q  !\1Y;K&Z1] X;oz:G0D D D D  D@ ,D` KD jD R2A?>   3X X$)X>(PXd,uE  4J(I,4H`   L  $ 03 0= K[lKvK$ 0 0      $ 0) 0< 0J 0V b 0k 0u 0} 0 0 0O(,p   Xo :+6>VxL@ PX [kwW  U (,   (PCharPContextSwitchPInt32PLightTypePRenderDataTypePSceneRenderPassTypePShadowCasterTypePTextureFormatBasePUInt16PUInt32PUInt8boolfloatCD3D11_BLEND_DESCCD3D11_DEPTH_STENCIL_DESCCD3D11_RASTERIZER_DESCD3D11_DEPTH_STENCILOP_DESCD3D11_RENDER_TARGET_BLEND_DESCPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPArrayPAssetReferencePBasePClassDescriptorPClusterHeaderPClusterHeaderBasePClusterHeaderD3D11PContextVariantFoldingTablePEffectPEffectVariantPInstanceListHeaderPMaterialPMaterialSwitchPNodeContextPParameterBufferPParameterBufferBasePSamplerStatePSamplerStateBasePSamplerStateD3D11PSceneRenderPassPShaderPShaderComputeProgramPShaderComputeProgramD3D11PShaderFragmentProgramPShaderFragmentProgramD3D11PShaderGeometryProgramPShaderGeometryProgramD3D11PShaderParameterCaptureBufferLocationPShaderParameterCaptureBufferLocationSizePShaderParameterCaptureBufferLocationTypeConstantBufferPShaderParameterCaptureBufferSamplerPShaderParameterCaptureBufferTexture2DPShaderParameterCaptureBufferTextureBasePShaderParameterCaptureBufferTextureCubeMapPShaderParameterDefinitionPShaderPassPShaderPassBasePShaderPassD3D11PShaderPassInfoPShaderPassParameterLocationTypesBasePShaderPassParameterLocationTypesConstantBufferPShaderPassStateBasePShaderPassStateD3D11PShaderProgramBasePShaderProgramD3D11PShaderStreamDefinitionPShaderVertexProgramPShaderVertexProgramD3D11PSharrayPStreamInputDescD3D11PStreamInputLayoutD3D11PStringPTexture2DPTexture2DBasePTexture2DD3D11PTextureCommonBasePTextureCubeMapPTextureCubeMapBasePTextureCubeMapD3D11m_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_textureFlagsPHp hh `00 @@PP!@@%8& 'Vd`,&&.6P0 Dx(EH!Data/Shaders/S_SandFall_vs__SandFall_fs__4911.cgfx#196D69B409D1C906CA91617F89E8DE4D#materialData/Shaders/S_SandFall_vs__SandFall_fs__4911.fx#196D69B409D1C906CA91617F89E8DE4D #line 1 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #define D_PLATFORM_D3D11x64 #define SAMPLETERRAIN #define GRADIENT #define ALPHATESTENABLE // 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 // ------------------------------------------------------------------------------------------------------------------------------------------ #define GLOBAL_LEAN_AND_MEAN #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 57 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" float4x4 modelIT : modelit; float4x4 modelViewProj : modelviewproj; float4x4 model : model; float4 eyePositionWS : eyePositionWS; // Shader for use on sand waterfalls. This shader takes in a color texture and a // mask texture. The mask texture is dynamically generated by the sand module // based on the player's position within the waterfall. // // Author: Nick Clark // Date C: 4-14-2010 // From Phyre: // For sand module float4 obbCenter_Width; float4 obbHeight_vOff; #ifdef CHAM HALF4 chamValues; // { chamLevel, intensity } #endif // Streams: struct a2v { float4 position : POSITION; HALF4 color : COLOR0; HALF3 normal : NORMAL; float4 uv : TEXCOORD0; float4 uv2 : TEXCOORD1; }; struct v2f { float4 position : POSITION_OUT; HALF4 color : COLOR0; float4 uv : TEXCOORD0; float4 uv2 : TEXCOORD1; HALF3 normal : TEXCOORD2; float4 loc : TEXCOORD3; float4 eye : TEXCOORD4; }; //-------------------------------------------- // Program entry //-------------------------------------------- void main( in a2v IN, out v2f OUT ) { OUT.position = MatrixMul( modelViewProj, float4( IN.position.xyz, 1 ) ); OUT.color = IN.color; float4 pos = MatrixMul( model, float4( IN.position.xyz, 1 ) ); OUT.loc.xyz = pos.xyz; OUT.eye = float4( eyePositionWS.xyz - OUT.loc.xyz, 1 ); OUT.uv.xy = IN.uv.xy; OUT.uv.zw = IN.uv.zw; // x-y planar projection float3 obbCenter = obbCenter_Width.xyz; float obbWidth = obbCenter_Width.w; float obbHeight = obbHeight_vOff.x; float xDist = IN.position.x - (obbCenter.x - obbWidth); float yDist = IN.position.y - (obbCenter.y - obbHeight); OUT.uv2.xy = float2( xDist / ( obbWidth * 2 ), yDist / ( obbHeight * 2 ) ); OUT.uv2.zw = float2(0,0); OUT.normal = normalize( MatrixMul( (float3x3)modelIT, IN.normal ) ); #ifdef CHAM OUT.loc.w = IN.position.y - chamValues.x; #else OUT.loc.w = 0; #endif } // ------------------------------------------------------------------------------------------------------------------------------------------ #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 148 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #ifndef PHYRE3X_ENABLED float4 obbCenter_Width; float4 obbHeight_vOff; #endif // Global env params: HALF4 l_c, l_a; HALF4 l_s; HALF4 l_d; HALF velvetInt, velvetRatio; float scaledTime; // LOD params: //HALF opacity=0.0; float uvScrollSpeed; // Global textures D_DECLARE_TEXTURE2D_4(texColor); D_DECLARE_TEXTURE2D_4(texAlpha); D_DECLARE_TEXTURE2D_4(noiseWhiteTex); // Sand params #ifdef SAMPLETERRAIN D_DECLARE_TEXTURE_CUBE_4(sandHiIrrCube); D_DECLARE_TEXTURE2D_4(sandFastTexture); float4 sandBias; float4 sandScale; D_DECLARE_TEXTURE2D_4(heightTexture); float4 heightBiasUv; float4 heightScaleUv; float heightBiasY; D_DECLARE_TEXTURE2D_4(duneTexture); D_DECLARE_TEXTURE2D_4(duneColorTexture); #endif HALF4 gradColorTop; #ifdef LIT HALF4 gradShadTopBot; HALF inShadow; #endif float gradCenter; float gradLength; #ifdef GRADIENT HALF4 gradColorBot; #endif #ifdef LIT D_DECLARE_TEXTURE2D_4(noiseMotionTex); HALF sparkleMult; float4 sparkleScale; #endif #ifdef CHAM D_DECLARE_TEXTURE2D_4(texChamMask); #ifndef PHYRE3X_ENABLED HALF4 chamValues; // { chamLevel, intensity } #endif #endif // set by SandFallBarn - these are hidden from Gardener D_DECLARE_TEXTURE2D_4(sfTexMask); // Streams: struct v2f { float4 position : POSITION_OUT; half4 color : COLOR0; float4 uv : TEXCOORD0; float4 uv2 : TEXCOORD1; HALF3 normal : TEXCOORD2; float4 loc : TEXCOORD3; float4 eye : TEXCOORD4; #if defined(D_PLATFORM_D3D11) || defined(D_PLATFORM_GNM) bool isFrontFace : SV_IsFrontFace; #else float faceVal : FACE; #endif }; struct f2f { HALF4 color : FINAL_COLOR; }; //---------------------------------------------- // Helper functions //---------------------------------------------- half OrenNayarDiffuse( half3 light, half3 view, half3 norm, half roughness ) { half VdotN = dot( view, norm ); half LdotN = dot( light, norm ); half cos_theta_i = LdotN; half theta_r = acos( VdotN ); half theta_i = acos( cos_theta_i ); half cos_phi_diff = dot( normalize( view - norm * VdotN ), normalize( light - norm * LdotN ) ); half alpha = max( theta_i, theta_r ) ; half beta = min( theta_i, theta_r ) ; half sigma2 = roughness * roughness; half A = 1.0 - 0.5 * sigma2 / (sigma2 + 0.33); half B = 0.45 * sigma2 / (sigma2 + 0.09); return saturate( cos_theta_i ) * (A + (B * saturate( cos_phi_diff ) * sin(alpha) * tan(beta))); } //---------------------------------------------- // Program entry //---------------------------------------------- void main( in v2f IN, out f2f OUT ) { #if defined(D_PLATFORM_D3D11) || defined(D_PLATFORM_GNM) float face = IN.isFrontFace ? -1.f : 1.f; #else float face = IN.faceVal; #endif float sfVOffset = obbHeight_vOff.y; sfVOffset += scaledTime; float4 offsetUv = IN.uv + float4( 0, sfVOffset * uvScrollSpeed,0, sfVOffset * uvScrollSpeed ); half3 tColor = half3( 0, 0, 0 ); half tAlpha = 0; half tMask = 0; half tNoise = 0; half kTapRad = 0.005; int kBlurIterations = 1; for( int i = 0; i < kBlurIterations; i++ ) { tColor += D_H4_SAMPLE_WRAP_SRGBTEXTURE( texColor, float2( offsetUv.x, offsetUv.y - i * kTapRad * ( 1 - IN.uv2.y ) ) ).rgb; tAlpha += D_H4_SAMPLE_WRAP_TEXTURE( texAlpha, float2( offsetUv.z, offsetUv.w - i * kTapRad * ( 1 - IN.uv2.y ) ) ).a; } tColor /= kBlurIterations; tAlpha /= kBlurIterations; kBlurIterations = 1; for( int i = 0; i < kBlurIterations; i++ ) { const float kNoiseDensityMult = 2; float2 rawNoise = D_H2_SAMPLE_WRAP_ANISO_TEXTURE( noiseWhiteTex, kNoiseDensityMult * float2( offsetUv.x, offsetUv.y - i * kTapRad ) ).xy; float2 uvOffset = 0.125 * (rawNoise - 0.5); tNoise += rawNoise.r; tMask += D_H4_SAMPLE_TEXTURE( sfTexMask, uvOffset + float2( IN.uv2.x, IN.uv2.y - i * kTapRad ) ).r; } tMask /= kBlurIterations; tNoise /= kBlurIterations; half noiseAmount = tNoise; #ifdef SAMPLETERRAIN //------------------------------------------ // Calculate sand contributions. float2 heightUV = (float2( IN.loc.x, IN.loc.z ) + heightBiasUv.xy) * heightScaleUv.xy; half heightTap = D_SAMPLE_TEXTURE( heightTexture, heightUV ).r; half duneHeightOff = 1.125; float duneHeight = heightBiasY + (float)duneHeightOff + (float)heightTap; half sideIntensity = saturate( 1 * (duneHeight - IN.loc.y) ); sideIntensity *= sideIntensity; // Read the sand grain texture. half uScaleMult = 0.6; half vScaleMult = 0.6; float2 sandUV = 4.0 * float2( offsetUv.x * uScaleMult, offsetUv.y * vScaleMult ) + sandBias.xy * sandScale.xy; half sandNoise = 2.0 * (D_H1_SAMPLE_POINT_WRAP_ANISO_TEXTURE( sandFastTexture, sandUV ) - 0.5); // Load the pre-lit dune color and velvet. float2 litUV = (float2( IN.loc.x, IN.loc.z ) + heightBiasUv.xy) * heightScaleUv.xy; half4 litTap = D_H4_SAMPLE_TEXTURE( duneColorTexture, litUV ); half3 litColor = 4.0 * litTap.rgb * litTap.rgb; half velvDune = litTap.a; velvDune *= 0.333 * sandNoise; half3 duneLitColor = (1.0 + velvDune) * litColor; #endif // Apply gradient half3 gColorTop = gradColorTop.rgb; half3 gColorBot = gColorTop; #ifdef LIT half gShadowTop = gradShadTopBot[0]; half gShadowBot = gShadowTop; #endif #ifdef SAMPLETERRAIN #ifdef LIT const float terrainScale = 0.5; float2 colorShadowUv = float2( 1 - (terrainScale * IN.loc.x + 0.5) / 256.0, ( terrainScale * IN.loc.z + 0.5 ) / 512.0 ); half4 colorShadowTap = D_H4_SAMPLE_SRGBTEXTURE( duneTexture, colorShadowUv ); gColorBot = colorShadowTap.rgb; gShadowBot = saturate( 10.0 * (colorShadowTap.a - 0.25) ); #else // Bottom color is the dune color if we're sampling the terrain gColorBot = duneLitColor; #endif #endif #ifdef GRADIENT gColorBot = gradColorBot.rgb; #ifdef LIT gShadowBot = gradShadTopBot[1]; #endif #endif half blend = smoothstep( gradCenter - gradLength * 0.5, gradCenter + gradLength * 0.5, IN.uv2.y ); half3 gradColor = lerp( gColorBot, gColorTop, blend ); #ifdef LIT half gradShadow = lerp( gShadowBot, gShadowTop, blend ); #endif half3 color = 0; #ifdef LIT half3 Nn = normalize( IN.normal * face ); half3 Vn = normalize( IN.eye.xyz ); half3 Ln = normalize( l_d.xyz ); half3 Hn = normalize( Vn + Ln ); half specularPow = l_s.w; float2 noiseUv = sparkleScale.xy * (IN.uv.xy*float2(1,0.125) + float2( 0, 0.125*sfVOffset * uvScrollSpeed )); half3 Nnoise = 2.0 * D_H3_SAMPLE_WRAP_ANISO_TEXTURE( noiseMotionTex, noiseUv ) - 1.0; Nnoise = normalize( Nnoise ); half noiseFade = 1.0; half3 Nnt = 24.0 * Nn + noiseFade * Nnoise; half3 Nnv = 4.0 * Nn + noiseFade * Nnoise; half3 Nns = normalize( 4.0 * Nn + noiseFade * Nnoise ); half diffuse = gradShadow * OrenNayarDiffuse( Ln, Vn, normalize( Nnt ), 0.5 ); diffuse = saturate( diffuse - inShadow ); half4 lightCubeTap = D_SAMPLE_TEXTURE_CUBE( sandHiIrrCube, Nnt ); half3 fillColor = lightCubeTap.rgb; half3 albedo = IN.color.rgb * 2.0 * tColor * gradColor; half velv = saturate( 1 - (abs( dot( Vn, Nnv ) ) - 0.12) ); albedo *= 1 + 0.166 * velv; half a = sqrt( 2.0 / 3.14159268 ); half schlickSmithShadow = 0.8 * 1.0 / ((diffuse * (1.0 - a) + a) * (dot( Nns, Vn ) * (1.0 - a) + a)); half base = saturate( 1.0 - dot( Vn, Hn ) ); half exponential = powsafe( base, 5.0 ); half F0spec = 0.04; // Skin is 0.028; half fresnelSpec = exponential + F0spec * (1.0 - exponential); half specPow = 0.0; half specular = fresnelSpec * schlickSmithShadow * (8.0+specPow)/25.0 * powsafe( saturate( dot( Hn, Nns ) ), specPow ); color = albedo * (l_c.xyz * diffuse + fillColor) + 3.0*l_c.rgb * diffuse * specular; half sparkleFade = 1.0 - saturate( length( IN.eye.xyz ) * 0.01 ); sparkleFade *= sparkleFade; half3 Nna = normalize( 0.9 * Nn + noiseFade * Nnoise ); color += albedo * l_s.rgb * sparkleFade * sparkleMult * velvetInt * powsafe( 1.0 - abs( dot( Vn, normalize(Nna+0.8*Vn) ) ), 64.0/*velvetRatio*/ ); #else color = IN.color.rgb * 2 * tColor * gradColor * ( l_c.xyz + l_a.xyz ); #endif #ifdef SAMPLETERRAIN // Incorporate dune color color = lerp( color, duneLitColor, sideIntensity ); #endif // Alpha float baseAlpha = IN.color.a; float alpha = baseAlpha * tAlpha * ( 1 - ( tMask ) + tNoise * 0.25 ); #ifdef CHAM half chamMaskTap = D_H4_SAMPLE_WRAP_TEXTURE( texChamMask, IN.uv2.xy * 6 ).a; half chamBase = IN.loc.w; float uvArc = abs(IN.uv2.x - 0.5) * 5.75; half chamAmount = saturate( (chamBase - uvArc * uvArc) - chamMaskTap * (1 + chamValues.y * 4) ); alpha = lerp( alpha, 0, chamAmount ); #endif OUT.color.rgb = color; OUT.color.a = alpha; #ifdef ALPHATESTENABLE clip(OUT.color.a-0.5f); #endif #ifdef PREPASS OUT.color.rgb = 1; #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_SandFall_vs__SandFall_fs__4911.fx#1ALPHATESTENABLEGRADIENTSAMPLETERRAIN#GGGGGGGG?????AA?05spDXBCØ,<6t~8 RDEFpp <AFRD11< ($      . > L ] gLinearClampSamplerLinearWrapSamplerLinearWrapAnisoSamplerPointWrapAnisoSamplertexColortexAlphanoiseWhiteTexsandFastTextureheightTextureduneColorTexturesfTexMask$Globalsg$ @8\`@8j@8p~ 0@PTX\`p #.9cameraNearTimesFarfloatcameraFarMinusNearcameraNearFarfloat4modelITfloat4x4,modelViewProjmodeleyePositionWSobbCenter_WidthobbHeight_vOffl_cl_al_sl_dvelvetIntvelvetRatioscaledTimeuvScrollSpeedsandBiassandScaleheightBiasUvheightScaleUvheightBiasYgradColorTopgradCentergradLengthgradColorBotMicrosoft (R) HLSL Shader Compiler 10.1ISGN SV_POSITIONCOLORTEXCOORDSV_IsFrontFaceOSGN, SV_TARGETSHEX,PjYF Z` Z` Z`Z`XpUUXpUUXpUUXpUUXpUUXpUUXpUUbbb2bre h6  * 8" : 8 : +R@FF+r@+@+@+"@6B@ ף;6@6@6 6:6" 0"B:*+B8B**+@6A: 8B:*6B*A"*6 ECUrFF~` /rF8 rF@ @ @ @rFV +B8B**+@6A: 8B:*6B*A":*6*ECUBFF{` * "@+rrF+B:B *6@6@6 6"6:0"B::*+B@+:8*:6:A":6 8 ECU t`662@2 F8 2F@>>"*+B:8B**6B*A"*6 ECUB |` * :@+: :+::2F 82FF ECUFF~` 6 6"@?"  +"@6BA* 8 4 @3 @?8  6"@?6B@?8 8"*8 2F@@@8 b  2FECUFF~`6"@ 8 @@b 8bV ECU6y` 8 V@@@@8VV6 8 @~>8   @?8V6rF 6rF 8 @?6 A  8" @?" 6 A"   "@????8 4 @3 @?8" @"@@@8  8 6rFArFF8rFrFF+r@8rFF8rFF8rFF rF F 8rFF6rFAV 8rrFF6:8* +"@6B:A"*8B:@>"*8 6r F6 6"@" 1"@"@ 6  >STATfSPDBMicrosoft C/C++ MSF 7.00 DSc_8 <.1_^r8v8Ab/RSQ3BlendAlpha [ 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 ; ZL]dPh&uS!AA$5}VU#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__4911.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #line 7 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 516 #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 56 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" float4x4 modelIT : modelit ; float4x4 modelViewProj : modelviewproj ; float4x4 model : model ; float4 eyePositionWS : eyePositionWS ; #line 73 float4 obbCenter_Width ; float4 obbHeight_vOff ; #line 78 #line 81 struct Opaque_vs_a2v { float4 position : POSITION ; float4 color : COLOR0 ; float3 normal : NORMAL ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; } ; struct Opaque_vs_v2f { float4 position : SV_POSITION ; float4 color : COLOR0 ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; float3 normal : TEXCOORD2 ; float4 loc : TEXCOORD3 ; float4 eye : TEXCOORD4 ; } ; #line 104 void Opaque_vs_main ( in Opaque_vs_a2v 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 . color = Opaque_vs_IN . color ; float4 pos = mul ( float4 ( Opaque_vs_IN . position . xyz , 1 ) , model ) ; Opaque_vs_OUT . loc . xyz = pos . xyz ; Opaque_vs_OUT . eye = float4 ( eyePositionWS . xyz - Opaque_vs_OUT . loc . xyz , 1 ) ; Opaque_vs_OUT . uv . xy = Opaque_vs_IN . uv . xy ; Opaque_vs_OUT . uv . zw = Opaque_vs_IN . uv . zw ; #line 117 float3 obbCenter = obbCenter_Width . xyz ; float obbWidth = obbCenter_Width . w ; float obbHeight = obbHeight_vOff . x ; float xDist = Opaque_vs_IN . position . x - ( obbCenter . x - obbWidth ) ; float yDist = Opaque_vs_IN . position . y - ( obbCenter . y - obbHeight ) ; Opaque_vs_OUT . uv2 . xy = float2 ( xDist / ( obbWidth * 2 ) , yDist / ( obbHeight * 2 ) ) ; Opaque_vs_OUT . uv2 . zw = float2 ( 0 , 0 ) ; Opaque_vs_OUT . normal = normalize ( mul ( Opaque_vs_IN . normal , ( float3x3 ) modelIT ) ) ; #line 129 Opaque_vs_OUT . loc . w = 0 ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 147 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #line 152 #line 155 float4 l_c , l_a ; float4 l_s ; float4 l_d ; float velvetInt , velvetRatio ; float scaledTime ; #line 162 float uvScrollSpeed ; #line 165 Texture2D < float4 > texColor ; Texture2D < float4 > texAlpha ; Texture2D < float4 > noiseWhiteTex ; #line 170 TextureCube < float4 > sandHiIrrCube ; Texture2D < float4 > sandFastTexture ; float4 sandBias ; float4 sandScale ; Texture2D < float4 > heightTexture ; float4 heightBiasUv ; float4 heightScaleUv ; float heightBiasY ; Texture2D < float4 > duneTexture ; Texture2D < float4 > duneColorTexture ; float4 gradColorTop ; #line 188 float gradCenter ; float gradLength ; float4 gradColorBot ; #line 200 #line 207 #line 210 Texture2D < float4 > sfTexMask ; #line 213 struct Opaque_fs_v2f { float4 position : SV_POSITION ; float4 color : COLOR0 ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; float3 normal : TEXCOORD2 ; float4 loc : TEXCOORD3 ; float4 eye : TEXCOORD4 ; bool isFrontFace : SV_IsFrontFace ; #line 226 } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 237 float OrenNayarDiffuse ( float3 light , float3 view , float3 norm , float roughness ) { float VdotN = dot ( view , norm ) ; float LdotN = dot ( light , norm ) ; float cos_theta_i = LdotN ; float theta_r = acos ( VdotN ) ; float theta_i = acos ( cos_theta_i ) ; float cos_phi_diff = dot ( normalize ( view - norm * VdotN ) , normalize ( light - norm * LdotN ) ) ; float alpha = max ( theta_i , theta_r ) ; float beta = min ( theta_i , theta_r ) ; float sigma2 = roughness * roughness ; float A = 1.0 - 0.5 * sigma2 / ( sigma2 + 0.33 ) ; float B = 0.45 * sigma2 / ( sigma2 + 0.09 ) ; return saturate ( cos_theta_i ) * ( A + ( B * saturate ( cos_phi_diff ) * sin ( alpha ) * tan ( beta ) ) ) ; } #line 257 void Opaque_fs_main ( in Opaque_fs_v2f Opaque_fs_IN , out Opaque_fs_f2f Opaque_fs_OUT ) { float face = Opaque_fs_IN . isFrontFace ? - 1.f : 1.f ; #line 263 float sfVOffset = obbHeight_vOff . y ; sfVOffset += scaledTime ; float4 offsetUv = Opaque_fs_IN . uv + float4 ( 0 , sfVOffset * uvScrollSpeed , 0 , sfVOffset * uvScrollSpeed ) ; float3 tColor = float3 ( 0 , 0 , 0 ) ; float tAlpha = 0 ; float tMask = 0 ; float tNoise = 0 ; float kTapRad = 0.005 ; int kBlurIterations = 1 ; for ( int i = 0 ; i < kBlurIterations ; i ++ ) { tColor += float4 ( pow ( texColor . Sample ( LinearWrapSampler , float2 ( offsetUv . x , offsetUv . y - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . xyz , 2.2f ) , texColor . Sample ( LinearWrapSampler , float2 ( offsetUv . x , offsetUv . y - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . a ) . rgb ; tAlpha += texAlpha . Sample ( LinearWrapSampler , float2 ( offsetUv . z , offsetUv . w - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . a ; } tColor /= kBlurIterations ; tAlpha /= kBlurIterations ; kBlurIterations = 1 ; for ( int i = 0 ; i < kBlurIterations ; i ++ ) { const float kNoiseDensityMult = 2 ; float2 rawNoise = noiseWhiteTex . Sample ( LinearWrapAnisoSampler , kNoiseDensityMult * float2 ( offsetUv . x , offsetUv . y - i * kTapRad ) ) . xy . xy ; float2 uvOffset = 0.125 * ( rawNoise - 0.5 ) ; tNoise += rawNoise . r ; tMask += sfTexMask . Sample ( LinearClampSampler , uvOffset + float2 ( Opaque_fs_IN . uv2 . x , Opaque_fs_IN . uv2 . y - i * kTapRad ) ) . r ; } tMask /= kBlurIterations ; tNoise /= kBlurIterations ; float noiseAmount = tNoise ; #line 301 float2 heightUV = ( float2 ( Opaque_fs_IN . loc . x , Opaque_fs_IN . loc . z ) + heightBiasUv . xy ) * heightScaleUv . xy ; float heightTap = heightTexture . Sample ( LinearClampSampler , heightUV ) . r ; float duneHeightOff = 1.125 ; float duneHeight = heightBiasY + ( float ) duneHeightOff + ( float ) heightTap ; float sideIntensity = saturate ( 1 * ( duneHeight - Opaque_fs_IN . loc . y ) ) ; sideIntensity *= sideIntensity ; #line 309 float uScaleMult = 0.6 ; float vScaleMult = 0.6 ; float2 sandUV = 4.0 * float2 ( offsetUv . x * uScaleMult , offsetUv . y * vScaleMult ) + sandBias . xy * sandScale . xy ; float sandNoise = 2.0 * ( sandFastTexture . Sample ( PointWrapAnisoSampler , sandUV ) . x - 0.5 ) ; #line 315 float2 litUV = ( float2 ( Opaque_fs_IN . loc . x , Opaque_fs_IN . loc . z ) + heightBiasUv . xy ) * heightScaleUv . xy ; float4 litTap = duneColorTexture . Sample ( LinearClampSampler , litUV ) ; float3 litColor = 4.0 * litTap . rgb * litTap . rgb ; float velvDune = litTap . a ; velvDune *= 0.333 * sandNoise ; float3 duneLitColor = ( 1.0 + velvDune ) * litColor ; #line 325 float3 gColorTop = gradColorTop . rgb ; float3 gColorBot = gColorTop ; #line 330 #line 338 gColorBot = duneLitColor ; gColorBot = gradColorBot . rgb ; #line 347 float blend = smoothstep ( gradCenter - gradLength * 0.5 , gradCenter + gradLength * 0.5 , Opaque_fs_IN . uv2 . y ) ; float3 gradColor = lerp ( gColorBot , gColorTop , blend ) ; #line 354 float3 color = 0 ; #line 402 color = Opaque_fs_IN . color . rgb * 2 * tColor * gradColor * ( l_c . xyz + l_a . xyz ) ; color = lerp ( color , duneLitColor , sideIntensity ) ; #line 412 float baseAlpha = Opaque_fs_IN . color . a ; float alpha = baseAlpha * tAlpha * ( 1 - ( tMask ) + tNoise * 0.25 ) ; #line 424 Opaque_fs_OUT . color . rgb = color ; Opaque_fs_OUT . color . a = alpha ; clip ( Opaque_fs_OUT . color . a - 0.5f ) ; #line 434 } 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 466 k7D:\Dev\TGC\Journey\head\Journey\shaderd:\dev\tgc\journey\head\journey\shader#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__4911.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #line 7 BlendState ourBlendState { BlendEnable [ 0 ] = FALSE ; BlendEnable [ 1 ] = FALSE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; Src0#)(0D76()B< G GMicrosoft (R) HLSL Shader Compiler 10.1=hlslFlags0x4005hlslTargetps_5_0hlslEntryOpaque_fs_mainhlslDefines /DALPHATESTENABLE=1 /DSAMPLETERRAIN=1 /DPHYRE_D3DFX=1 /DGRADIENT=16,,Opaque_fs_main2> Opaque_fs_INP,P,P,P , P,P,P,P,P , P$,$P(,(P,,,P0,0P4,4P8,8P<,<P@,@PD,DPH,HPL,PPP,TPT,XPX,\P\,`P`,dPd,hPh,lPl,p6> Opaque_fs_OUTP,P,P,P , P 2>@sfVOffsetP.>offsetUvP| P| PP , .>tColorP<P<P<P`<4P`<8P`<<.>@tAlphaPPtX@P< .>@tMaskP  P0P< .>@tNoiseP $P4P  .>@kTapRadP$(6>tkBlurIterationsP8,P$ *>tiP<P0L,:> kNoiseDensityMultPp8.> rawNoisePD|8PD|<.> uvOffsetP@PD.> heightUVP` , P` T$2>@heightTapP P 6>@duneHeightOffP  $2>@duneHeightP H 6>@sideIntensityP  2>@uScaleMultP $2>@vScaleMultP (.> sandUVPp ,Pp @2>@sandNoiseP .> litUVP( T$P( T(.>litTapPT 4PT 8PT <P T 0.>litColorP $P (P ,.>@velvDuneP 80P 2>duneLitColorP X$P X(P X,2>gColorTopP4  0P4  4P4  82>gColorBotPL `@PL `DPL `H.>@blendP 2>gradColorP0P4P8.>colorP@P@P@2>@baseAlphaP.>@alphaPx0\}}Qk:6617, R    8 8 X X x x     $$88LL``tt,,HH``||  ((<<XXll00LLhhll0044PP\\p p             0 0 D!D!d!d!!!""###### # #(#(#<#<#X#X###$$$%%%%&& & & - -@ -@ -` .` . . . / / 0 0 0 0 1 1 1 1 1 18 18 1T 1T 1p 1p 1 2 2 5 5 6 6 7 7 7 7 7 70 70 7T 7T 7p 8p 8 8 8 8 8 8 8 ; ; ; ;( <( <T =T =| =| = > > ? ? ? ? A A A A E E4 X4 XL ^L ^l ^l ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^^^4^4^\^\^x^x^^^^^^^^^^^ _ _8_8_T_T_p_p_$$@@XXtt$$@@\\xx((* (t8PtXpt+rtr*(     2222222222)2) ?q{ ?q{ ? ? ? ?q ?b ?b ?" ?" ? ? ? ? = bl bl r r r b S S   -02222222222)2) +) y y M M   6%2 6%2 64  i i < <  -0f}TNT R! T<TRT&PT,NT,NT&PTRTR$"  }$<}@X}Z}^{}{gYgcgcge|c|zNL9(97! #!#!9*97+ )$"y-<y <y <yM\y@\ywywywywywywywywywywyw?=?=?=?=] *] *] 3] ?]EY] [; 9; 9; 9; 90 .J$J*6J*6J*6J:FJ*FJH)''%/ +/ +/-/-/-h Hp<`(Lp @d   18 PPX@float4@ float3 position color  uv 0uv2 @normal Lloc \eye blisFrontFace"pOpaque_fs_v2f color"Opaque_fs_f2f  @@float2          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 516 #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 56 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" float4x4 modelIT : modelit ; float4x4 modelViewProj : modelviewproj ; float4x4 model : model ; float4 eyePositionWS : eyePositionWS ; #line 73 float4 obbCenter_Width ; float4 obbHeight_vOff ; #line 78 #line 81 struct Opaque_vs_a2v { float4 position : POSITION ; float4 color : COLOR0 ; float3 normal : NORMAL ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; } ; struct Opaque_vs_v2f { float4 position : SV_POSITION ; float4 color : COLOR0 ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; float3 normal : TEXCOORD2 ; float4 loc : TEXCOORD3 ; float4 eye : TEXCOORD4 ; } ; #line 104 void Opaque_vs_main ( in Opaque_vs_a2v 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 . color = Opaque_vs_IN . color ; float4 pos = mul ( float4 ( Opaque_vs_IN . position . xyz , 1 ) , model ) ; Opaque_vs_OUT . loc . xyz = pos . xyz ; Opaque_vs_OUT . eye = float4 ( eyePositionWS . xyz - Opaque_vs_OUT . loc . xyz , 1 ) ; Opaque_vs_OUT . uv . xy = Opaque_vs_IN . uv . xy ; Opaque_vs_OUT . uv . zw = Opaque_vs_IN . uv . zw ; #line 117 float3 obbCenter = obbCenter_Width . xyz ; float obbWidth = obbCenter_Width . w ; float obbHeight = obbHeight_vOff . x ; float xDist = Opaque_vs_IN . position . x - ( obbCenter . x - obbWidth ) ; float yDist = Opaque_vs_IN . position . y - ( obbCenter . y - obbHeight ) ; Opaque_vs_OUT . uv2 . xy = float2 ( xDist / ( obbWidth * 2 ) , yDist / ( obbHeight * 2 ) ) ; Opaque_vs_OUT . uv2 . zw = float2 ( 0 , 0 ) ; Opaque_vs_OUT . normal = normalize ( mul ( Opaque_vs_IN . normal , ( float3x3 ) modelIT ) ) ; #line 129 Opaque_vs_OUT . loc . w = 0 ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 147 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #line 152 #line 155 float4 l_c , l_a ; float4 l_s ; float4 l_d ; float velvetInt , velvetRatio ; float scaledTime ; #line 162 float uvScrollSpeed ; #line 165 Texture2D < float4 > texColor ; Texture2D < float4 > texAlpha ; Texture2D < float4 > noiseWhiteTex ; #line 170 TextureCube < float4 > sandHiIrrCube ; Texture2D < float4 > sandFastTexture ; float4 sandBias ; float4 sandScale ; Texture2D < float4 > heightTexture ; float4 heightBiasUv ; float4 heightScaleUv ; float heightBiasY ; Texture2D < float4 > duneTexture ; Texture2D < float4 > duneColorTexture ; float4 gradColorTop ; #line 188 float gradCenter ; float gradLength ; float4 gradColorBot ; #line 200 #line 207 #line 210 Texture2D < float4 > sfTexMask ; #line 213 struct Opaque_fs_v2f { float4 position : SV_POSITION ; float4 color : COLOR0 ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; float3 normal : TEXCOORD2 ; float4 loc : TEXCOORD3 ; float4 eye : TEXCOORD4 ; bool isFrontFace : SV_IsFrontFace ; #line 226 } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 237 float OrenNayarDiffuse ( float3 light , float3 view , float3 norm , float roughness ) { float VdotN = dot ( view , norm ) ; float LdotN = dot ( light , norm ) ; float cos_theta_i = LdotN ; float theta_r = acos ( VdotN ) ; float theta_i = acos ( cos_theta_i ) ; float cos_phi_diff = dot ( normalize ( view - norm * VdotN ) , normalize ( light - norm * LdotN ) ) ; float alpha = max ( theta_i , theta_r ) ; float beta = min ( theta_i , theta_r ) ; float sigma2 = roughness * roughness ; float A = 1.0 - 0.5 * sigma2 / ( sigma2 + 0.33 ) ; float B = 0.45 * sigma2 / ( sigma2 + 0.09 ) ; return saturate ( cos_theta_i ) * ( A + ( B * saturate ( cos_phi_diff ) * sin ( alpha ) * tan ( beta ) ) ) ; } #line 257 void Opaque_fs_main ( in Opaque_fs_v2f Opaque_fs_IN , out Opaque_fs_f2f Opaque_fs_OUT ) { float face = Opaque_fs_IN . isFrontFace ? - 1.f : 1.f ; #line 263 float sfVOffset = obbHeight_vOff . y ; sfVOffset += scaledTime ; float4 offsetUv = Opaque_fs_IN . uv + float4 ( 0 , sfVOffset * uvScrollSpeed , 0 , sfVOffset * uvScrollSpeed ) ; float3 tColor = float3 ( 0 , 0 , 0 ) ; float tAlpha = 0 ; float tMask = 0 ; float tNoise = 0 ; float kTapRad = 0.005 ; int kBlurIterations = 1 ; for ( int i = 0 ; i < kBlurIterations ; i ++ ) { tColor += float4 ( pow ( texColor . Sample ( LinearWrapSampler , float2 ( offsetUv . x , offsetUv . y - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . xyz , 2.2f ) , texColor . Sample ( LinearWrapSampler , float2 ( offsetUv . x , offsetUv . y - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . a ) . rgb ; tAlpha += texAlpha . Sample ( LinearWrapSampler , float2 ( offsetUv . z , offsetUv . w - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . a ; } tColor /= kBlurIterations ; tAlpha /= kBlurIterations ; kBlurIterations = 1 ; for ( int i = 0 ; i < kBlurIterations ; i ++ ) { const float kNoiseDensityMult = 2 ; float2 rawNoise = noiseWhiteTex . Sample ( LinearWrapAnisoSampler , kNoiseDensityMult * float2 ( offsetUv . x , offsetUv . y - i * kTapRad ) ) . xy . xy ; float2 uvOffset = 0.125 * ( rawNoise - 0.5 ) ; tNoise += rawNoise . r ; tMask += sfTexMask . Sample ( LinearClampSampler , uvOffset + float2 ( Opaque_fs_IN . uv2 . x , Opaque_fs_IN . uv2 . y - i * kTapRad ) ) . r ; } tMask /= kBlurIterations ; tNoise /= kBlurIterations ; float noiseAmount = tNoise ; #line 301 float2 heightUV = ( float2 ( Opaque_fs_IN . loc . x , Opaque_fs_IN . loc . z ) + heightBiasUv . xy ) * heightScaleUv . xy ; float heightTap = heightTexture . Sample ( LinearClampSampler , heightUV ) . r ; float duneHeightOff = 1.125 ; float duneHeight = heightBiasY + ( float ) duneHeightOff + ( float ) heightTap ; float sideIntensity = saturate ( 1 * ( duneHeight - Opaque_fs_IN . loc . y ) ) ; sideIntensity *= sideIntensity ; #line 309 float uScaleMult = 0.6 ; float vScaleMult = 0.6 ; float2 sandUV = 4.0 * float2 ( offsetUv . x * uScaleMult , offsetUv . y * vScaleMult ) + sandBias . xy * sandScale . xy ; float sandNoise = 2.0 * ( sandFastTexture . Sample ( PointWrapAnisoSampler , sandUV ) . x - 0.5 ) ; #line 315 float2 litUV = ( float2 ( Opaque_fs_IN . loc . x , Opaque_fs_IN . loc . z ) + heightBiasUv . xy ) * heightScaleUv . xy ; float4 litTap = duneColorTexture . Sample ( LinearClampSampler , litUV ) ; float3 litColor = 4.0 * litTap . rgb * litTap . rgb ; float velvDune = litTap . a ; velvDune *= 0.333 * sandNoise ; float3 duneLitColor = ( 1.0 + velvDune ) * litColor ; #line 325 float3 gColorTop = gradColorTop . rgb ; float3 gColorBot = gColorTop ; #line 330 #line 338 gColorBot = duneLitColor ; gColorBot = gradColorBot . rgb ; #line 347 float blend = smoothstep ( gradCenter - gradLength * 0.5 , gradCenter + gradLength * 0.5 , Opaque_fs_IN . uv2 . y ) ; float3 gradColor = lerp ( gColorBot , gColorTop , blend ) ; #line 354 float3 color = 0 ; #line 402 color = Opaque_fs_IN . color . rgb * 2 * tColor * gradColor * ( l_c . xyz + l_a . xyz ) ; color = lerp ( color , duneLitColor , sideIntensity ) ; #line 412 float baseAlpha = Opaque_fs_IN . color . a ; float alpha = baseAlpha * tAlpha * ( 1 - ( tMask ) + tNoise * 0.25 ) ; #line 424 Opaque_fs_OUT . color . rgb = color ; Opaque_fs_OUT . color . a = alpha ; clip ( Opaque_fs_OUT . color . a - 0.5f ) ; #line 434 } 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 466 D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__4911.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh (P6617)D3DSHDR, ` /lqM)!!e=AIqa @ @ P@@@@ $0<HT`lx ,%Opaque_fs_main&Q  LinearClampSampler&Q  LinearWrapSampler*Q LinearWrapAnisoSampler*Q PointWrapAnisoSampler"QobbHeight_vOffQl_cQ l_aQXscaledTime"Q\uvScrollSpeedQtexColorQtexAlpha"QnoiseWhiteTex"QsandFastTextureQ`sand /BiasQpsandScale"QheightTexture"QheightBiasUv"QheightScaleUvQheightBiasY&QduneColorTexture"QgradColorTopQgradCenterQgradLength"QgradColorBotQsfTexMasksh , ` <Opaque_fs_mainnonew 1 ?\T ,$, ` <Opaque_fs_mainnone-.le, `ef,'D:\Dev\TGC\Journey\head\Journey\shaderD:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__4911.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory..1_^r8v8Ab/RST/LinkInfo/names/src/headerblock/src/files/d:\dev\tgc\journey\head\journey\shader" Q3 38776\"X(L,]98\[:$;<=>?@ABCDEFGHIJKLMNOPQRST%  !"#&'()*+,-./01234567UVWYXZ^ 8PhXpP@ 00 @PT`\`p@1``@1 @1XpP@ 00 @PT`\`p@1``@1 @1 484P44444h444X4p444@44(4 484P44444h444X 4p4 44@44(4@p@`@P@@ @00@ @@P@T@\@`@p@@@@@@@G4G4G4pG4XG4@G4(G4G4B4B4B4D4B4B4hB4PB48B4 1@1`@`1 @ AnisoClampSamplerLinearClampSamplerLinearWrapAnisoSamplerLinearWrapSamplerLinearWrapTSamplerPointClampSamplerPointWrapAnisoSamplerPointWrapSamplerduneColorTextureduneTexturegradCentergradColorBotgradColorTopgradLengthheightBiasUvheightBiasYheightScaleUvheightTexturel_al_cl_dl_smodelmodelITmodelViewProjnoiseWhiteTexobbCenter_WidthobbHeight_vOffsandBiassandFastTexturesandHiIrrCubesandScalesfTexMasktexAlphatexColoruvScrollSpeedvelvetIntvelvetRatio05sv05spOpaque_fs_mainOpaque_vs_mainj 8P}Rh}RCOLORNORMALPOSITIONTEXCOORD05svDXBC}GgMzbK8P$L RDEFhh<A>RD11< ($ \$Globals\ @0T`@0b@0hv 0@PTX\`p&1cameraNearTimesFarfloatcameraFarMinusNearcameraNearFarfloat4modelITfloat4x4$modelViewProjmodeleyePositionWSobbCenter_WidthobbHeight_vOffl_cl_al_sl_dvelvetIntvelvetRatioscaledTimeuvScrollSpeedsandBiassandScaleheightBiasUvheightScaleUvheightBiasYgradColorTopgradCentergradLengthgradColorBotMicrosoft (R) HLSL Shader Compiler 10.1ISGNPOSITIONCOLORNORMALTEXCOORDOSGNSV_POSITIONCOLORTEXCOORDSHEX PHjYF _r__r_g e e e er e e h+@6rF FF " FF B FF  FF 6 F+@6rFFF "FF BFF 6rF6rFAr FF + @62 F6 62F 6B: 6 6*A :6 A  6:A":6"A"+@8B*:  *+@8 :"  + @FF "FF BFF FFD:8r F+ @6r F>STAT-  SPDBMicrosoft C/C++ MSF 7.00 DSWxS8 <.1_^-zvE¤$2Q3BlendAlpha [ 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 ; ZL- \dPh&g79A$A#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__4911.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #line 7 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 516 #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 56 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" float4x4 modelIT : modelit ; float4x4 modelViewProj : modelviewproj ; float4x4 model : model ; float4 eyePositionWS : eyePositionWS ; #line 73 float4 obbCenter_Width ; float4 obbHeight_vOff ; #line 78 #line 81 struct Opaque_vs_a2v { float4 position : POSITION ; float4 color : COLOR0 ; float3 normal : NORMAL ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; } ; struct Opaque_vs_v2f { float4 position : SV_POSITION ; float4 color : COLOR0 ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; float3 normal : TEXCOORD2 ; float4 loc : TEXCOORD3 ; float4 eye : TEXCOORD4 ; } ; #line 104 void Opaque_vs_main ( in Opaque_vs_a2v 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 . color = Opaque_vs_IN . color ; float4 pos = mul ( float4 ( Opaque_vs_IN . position . xyz , 1 ) , model ) ; Opaque_vs_OUT . loc . xyz = pos . xyz ; Opaque_vs_OUT . eye = float4 ( eyePositionWS . xyz - Opaque_vs_OUT . loc . xyz , 1 ) ; Opaque_vs_OUT . uv . xy = Opaque_vs_IN . uv . xy ; Opaque_vs_OUT . uv . zw = Opaque_vs_IN . uv . zw ; #line 117 float3 obbCenter = obbCenter_Width . xyz ; float obbWidth = obbCenter_Width . w ; float obbHeight = obbHeight_vOff . x ; float xDist = Opaque_vs_IN . position . x - ( obbCenter . x - obbWidth ) ; float yDist = Opaque_vs_IN . position . y - ( obbCenter . y - obbHeight ) ; Opaque_vs_OUT . uv2 . xy = float2 ( xDist / ( obbWidth * 2 ) , yDist / ( obbHeight * 2 ) ) ; Opaque_vs_OUT . uv2 . zw = float2 ( 0 , 0 ) ; Opaque_vs_OUT . normal = normalize ( mul ( Opaque_vs_IN . normal , ( float3x3 ) modelIT ) ) ; #line 129 Opaque_vs_OUT . loc . w = 0 ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 147 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #line 152 #line 155 float4 l_c , l_a ; float4 l_s ; float4 l_d ; float velvetInt , velvetRatio ; float scaledTime ; #line 162 float uvScrollSpeed ; #line 165 Texture2D < float4 > texColor ; Texture2D < float4 > texAlpha ; Texture2D < float4 > noiseWhiteTex ; #line 170 TextureCube < float4 > sandHiIrrCube ; Texture2D < float4 > sandFastTexture ; float4 sandBias ; float4 sandScale ; Texture2D < float4 > heightTexture ; float4 heightBiasUv ; float4 heightScaleUv ; float heightBiasY ; Texture2D < float4 > duneTexture ; Texture2D < float4 > duneColorTexture ; float4 gradColorTop ; #line 188 float gradCenter ; float gradLength ; float4 gradColorBot ; #line 200 #line 207 #line 210 Texture2D < float4 > sfTexMask ; #line 213 struct Opaque_fs_v2f { float4 position : SV_POSITION ; float4 color : COLOR0 ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; float3 normal : TEXCOORD2 ; float4 loc : TEXCOORD3 ; float4 eye : TEXCOORD4 ; bool isFrontFace : SV_IsFrontFace ; #line 226 } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 237 float OrenNayarDiffuse ( float3 light , float3 view , float3 norm , float roughness ) { float VdotN = dot ( view , norm ) ; float LdotN = dot ( light , norm ) ; float cos_theta_i = LdotN ; float theta_r = acos ( VdotN ) ; float theta_i = acos ( cos_theta_i ) ; float cos_phi_diff = dot ( normalize ( view - norm * VdotN ) , normalize ( light - norm * LdotN ) ) ; float alpha = max ( theta_i , theta_r ) ; float beta = min ( theta_i , theta_r ) ; float sigma2 = roughness * roughness ; float A = 1.0 - 0.5 * sigma2 / ( sigma2 + 0.33 ) ; float B = 0.45 * sigma2 / ( sigma2 + 0.09 ) ; return saturate ( cos_theta_i ) * ( A + ( B * saturate ( cos_phi_diff ) * sin ( alpha ) * tan ( beta ) ) ) ; } #line 257 void Opaque_fs_main ( in Opaque_fs_v2f Opaque_fs_IN , out Opaque_fs_f2f Opaque_fs_OUT ) { float face = Opaque_fs_IN . isFrontFace ? - 1.f : 1.f ; #line 263 float sfVOffset = obbHeight_vOff . y ; sfVOffset += scaledTime ; float4 offsetUv = Opaque_fs_IN . uv + float4 ( 0 , sfVOffset * uvScrollSpeed , 0 , sfVOffset * uvScrollSpeed ) ; float3 tColor = float3 ( 0 , 0 , 0 ) ; float tAlpha = 0 ; float tMask = 0 ; float tNoise = 0 ; float kTapRad = 0.005 ; int kBlurIterations = 1 ; for ( int i = 0 ; i < kBlurIterations ; i ++ ) { tColor += float4 ( pow ( texColor . Sample ( LinearWrapSampler , float2 ( offsetUv . x , offsetUv . y - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . xyz , 2.2f ) , texColor . Sample ( LinearWrapSampler , float2 ( offsetUv . x , offsetUv . y - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . a ) . rgb ; tAlpha += texAlpha . Sample ( LinearWrapSampler , float2 ( offsetUv . z , offsetUv . w - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . a ; } tColor /= kBlurIterations ; tAlpha /= kBlurIterations ; kBlurIterations = 1 ; for ( int i = 0 ; i < kBlurIterations ; i ++ ) { const float kNoiseDensityMult = 2 ; float2 rawNoise = noiseWhiteTex . Sample ( LinearWrapAnisoSampler , kNoiseDensityMult * float2 ( offsetUv . x , offsetUv . y - i * kTapRad ) ) . xy . xy ; float2 uvOffset = 0.125 * ( rawNoise - 0.5 ) ; tNoise += rawNoise . r ; tMask += sfTexMask . Sample ( LinearClampSampler , uvOffset + float2 ( Opaque_fs_IN . uv2 . x , Opaque_fs_IN . uv2 . y - i * kTapRad ) ) . r ; } tMask /= kBlurIterations ; tNoise /= kBlurIterations ; float noiseAmount = tNoise ; #line 301 float2 heightUV = ( float2 ( Opaque_fs_IN . loc . x , Opaque_fs_IN . loc . z ) + heightBiasUv . xy ) * heightScaleUv . xy ; float heightTap = heightTexture . Sample ( LinearClampSampler , heightUV ) . r ; float duneHeightOff = 1.125 ; float duneHeight = heightBiasY + ( float ) duneHeightOff + ( float ) heightTap ; float sideIntensity = saturate ( 1 * ( duneHeight - Opaque_fs_IN . loc . y ) ) ; sideIntensity *= sideIntensity ; #line 309 float uScaleMult = 0.6 ; float vScaleMult = 0.6 ; float2 sandUV = 4.0 * float2 ( offsetUv . x * uScaleMult , offsetUv . y * vScaleMult ) + sandBias . xy * sandScale . xy ; float sandNoise = 2.0 * ( sandFastTexture . Sample ( PointWrapAnisoSampler , sandUV ) . x - 0.5 ) ; #line 315 float2 litUV = ( float2 ( Opaque_fs_IN . loc . x , Opaque_fs_IN . loc . z ) + heightBiasUv . xy ) * heightScaleUv . xy ; float4 litTap = duneColorTexture . Sample ( LinearClampSampler , litUV ) ; float3 litColor = 4.0 * litTap . rgb * litTap . rgb ; float velvDune = litTap . a ; velvDune *= 0.333 * sandNoise ; float3 duneLitColor = ( 1.0 + velvDune ) * litColor ; #line 325 float3 gColorTop = gradColorTop . rgb ; float3 gColorBot = gColorTop ; #line 330 #line 338 gColorBot = duneLitColor ; gColorBot = gradColorBot . rgb ; #line 347 float blend = smoothstep ( gradCenter - gradLength * 0.5 , gradCenter + gradLength * 0.5 , Opaque_fs_IN . uv2 . y ) ; float3 gradColor = lerp ( gColorBot , gColorTop , blend ) ; #line 354 float3 color = 0 ; #line 402 color = Opaque_fs_IN . color . rgb * 2 * tColor * gradColor * ( l_c . xyz + l_a . xyz ) ; color = lerp ( color , duneLitColor , sideIntensity ) ; #line 412 float baseAlpha = Opaque_fs_IN . color . a ; float alpha = baseAlpha * tAlpha * ( 1 - ( tMask ) + tNoise * 0.25 ) ; #line 424 Opaque_fs_OUT . color . rgb = color ; Opaque_fs_OUT . color . a = alpha ; clip ( Opaque_fs_OUT . color . a - 0.5f ) ; #line 434 } 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 466 k7D:\Dev\TGC\Journey\head\Journey\shaderd:\dev\tgc\journey\head\journey\shader#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__4911.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #line 7 BlendState ourBlendState { BlendEnable [ 0 ] = FALSE ; BlendEnable [ 1 ] = FALSE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; Src01!)(0D76()B< G GMicrosoft (R) HLSL Shader Compiler 10.1=hlslFlags0x4005hlslTargetvs_5_0hlslEntryOpaque_vs_mainhlslDefines /DALPHATESTENABLE=1 /DSAMPLETERRAIN=1 /DPHYRE_D3DFX=1 /DGRADIENT=16ttOpaque_vs_main2> Opaque_vs_INPtPtPtP t PtPtPtPtP t P$t$P(t(P,t0P0t4P4t8P8t<P<t@P@tDPDtHPHtL6> Opaque_vs_OUTP\t`P`tdPdthPhtlPLtPPPtTPTtXPXt\P@t@PDtDPHtHP0t0P4t4P8t8P<t<P t P$t$P(t(P,t,PtPtPtPtPtPtPtP t PLPPPT*>posPpPPP02>obbCenterPdP.>@obbWidthP2>@obbHeightP .>@xDistP(.>@yDistP0\}}Qk:6617P  ZDjjjjjjjjjj4j4jTkTkhmhm|m|mmmmmmmnnoooo<o<oPqPqdrdrxuxuvvwwxxxxxx x x(y(y@y@y\y\ytytyzzzzzzzzzz z z({({H}H}h}h}}}}}}}}}e&Qe ce ce ce ce c20OCOMOMOMOM+)Z$RZ$RZX6464. ,* (* (N3JN3JNLNLO3KO3KOMOM`3>`3>`)@`NZ`NZ`D\1 /a*]a*]a*]a_a_a_! <`| 18 88@@float4@ float3Z position color  normal ,uv <uv2"LOpaque_vs_a2vz position color  uv 0uv2 @normal Lloc \eye"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 516 #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 56 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" float4x4 modelIT : modelit ; float4x4 modelViewProj : modelviewproj ; float4x4 model : model ; float4 eyePositionWS : eyePositionWS ; #line 73 float4 obbCenter_Width ; float4 obbHeight_vOff ; #line 78 #line 81 struct Opaque_vs_a2v { float4 position : POSITION ; float4 color : COLOR0 ; float3 normal : NORMAL ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; } ; struct Opaque_vs_v2f { float4 position : SV_POSITION ; float4 color : COLOR0 ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; float3 normal : TEXCOORD2 ; float4 loc : TEXCOORD3 ; float4 eye : TEXCOORD4 ; } ; #line 104 void Opaque_vs_main ( in Opaque_vs_a2v 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 . color = Opaque_vs_IN . color ; float4 pos = mul ( float4 ( Opaque_vs_IN . position . xyz , 1 ) , model ) ; Opaque_vs_OUT . loc . xyz = pos . xyz ; Opaque_vs_OUT . eye = float4 ( eyePositionWS . xyz - Opaque_vs_OUT . loc . xyz , 1 ) ; Opaque_vs_OUT . uv . xy = Opaque_vs_IN . uv . xy ; Opaque_vs_OUT . uv . zw = Opaque_vs_IN . uv . zw ; #line 117 float3 obbCenter = obbCenter_Width . xyz ; float obbWidth = obbCenter_Width . w ; float obbHeight = obbHeight_vOff . x ; float xDist = Opaque_vs_IN . position . x - ( obbCenter . x - obbWidth ) ; float yDist = Opaque_vs_IN . position . y - ( obbCenter . y - obbHeight ) ; Opaque_vs_OUT . uv2 . xy = float2 ( xDist / ( obbWidth * 2 ) , yDist / ( obbHeight * 2 ) ) ; Opaque_vs_OUT . uv2 . zw = float2 ( 0 , 0 ) ; Opaque_vs_OUT . normal = normalize ( mul ( Opaque_vs_IN . normal , ( float3x3 ) modelIT ) ) ; #line 129 Opaque_vs_OUT . loc . w = 0 ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 147 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fx" #line 152 #line 155 float4 l_c , l_a ; float4 l_s ; float4 l_d ; float velvetInt , velvetRatio ; float scaledTime ; #line 162 float uvScrollSpeed ; #line 165 Texture2D < float4 > texColor ; Texture2D < float4 > texAlpha ; Texture2D < float4 > noiseWhiteTex ; #line 170 TextureCube < float4 > sandHiIrrCube ; Texture2D < float4 > sandFastTexture ; float4 sandBias ; float4 sandScale ; Texture2D < float4 > heightTexture ; float4 heightBiasUv ; float4 heightScaleUv ; float heightBiasY ; Texture2D < float4 > duneTexture ; Texture2D < float4 > duneColorTexture ; float4 gradColorTop ; #line 188 float gradCenter ; float gradLength ; float4 gradColorBot ; #line 200 #line 207 #line 210 Texture2D < float4 > sfTexMask ; #line 213 struct Opaque_fs_v2f { float4 position : SV_POSITION ; float4 color : COLOR0 ; float4 uv : TEXCOORD0 ; float4 uv2 : TEXCOORD1 ; float3 normal : TEXCOORD2 ; float4 loc : TEXCOORD3 ; float4 eye : TEXCOORD4 ; bool isFrontFace : SV_IsFrontFace ; #line 226 } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 237 float OrenNayarDiffuse ( float3 light , float3 view , float3 norm , float roughness ) { float VdotN = dot ( view , norm ) ; float LdotN = dot ( light , norm ) ; float cos_theta_i = LdotN ; float theta_r = acos ( VdotN ) ; float theta_i = acos ( cos_theta_i ) ; float cos_phi_diff = dot ( normalize ( view - norm * VdotN ) , normalize ( light - norm * LdotN ) ) ; float alpha = max ( theta_i , theta_r ) ; float beta = min ( theta_i , theta_r ) ; float sigma2 = roughness * roughness ; float A = 1.0 - 0.5 * sigma2 / ( sigma2 + 0.33 ) ; float B = 0.45 * sigma2 / ( sigma2 + 0.09 ) ; return saturate ( cos_theta_i ) * ( A + ( B * saturate ( cos_phi_diff ) * sin ( alpha ) * tan ( beta ) ) ) ; } #line 257 void Opaque_fs_main ( in Opaque_fs_v2f Opaque_fs_IN , out Opaque_fs_f2f Opaque_fs_OUT ) { float face = Opaque_fs_IN . isFrontFace ? - 1.f : 1.f ; #line 263 float sfVOffset = obbHeight_vOff . y ; sfVOffset += scaledTime ; float4 offsetUv = Opaque_fs_IN . uv + float4 ( 0 , sfVOffset * uvScrollSpeed , 0 , sfVOffset * uvScrollSpeed ) ; float3 tColor = float3 ( 0 , 0 , 0 ) ; float tAlpha = 0 ; float tMask = 0 ; float tNoise = 0 ; float kTapRad = 0.005 ; int kBlurIterations = 1 ; for ( int i = 0 ; i < kBlurIterations ; i ++ ) { tColor += float4 ( pow ( texColor . Sample ( LinearWrapSampler , float2 ( offsetUv . x , offsetUv . y - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . xyz , 2.2f ) , texColor . Sample ( LinearWrapSampler , float2 ( offsetUv . x , offsetUv . y - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . a ) . rgb ; tAlpha += texAlpha . Sample ( LinearWrapSampler , float2 ( offsetUv . z , offsetUv . w - i * kTapRad * ( 1 - Opaque_fs_IN . uv2 . y ) ) ) . a ; } tColor /= kBlurIterations ; tAlpha /= kBlurIterations ; kBlurIterations = 1 ; for ( int i = 0 ; i < kBlurIterations ; i ++ ) { const float kNoiseDensityMult = 2 ; float2 rawNoise = noiseWhiteTex . Sample ( LinearWrapAnisoSampler , kNoiseDensityMult * float2 ( offsetUv . x , offsetUv . y - i * kTapRad ) ) . xy . xy ; float2 uvOffset = 0.125 * ( rawNoise - 0.5 ) ; tNoise += rawNoise . r ; tMask += sfTexMask . Sample ( LinearClampSampler , uvOffset + float2 ( Opaque_fs_IN . uv2 . x , Opaque_fs_IN . uv2 . y - i * kTapRad ) ) . r ; } tMask /= kBlurIterations ; tNoise /= kBlurIterations ; float noiseAmount = tNoise ; #line 301 float2 heightUV = ( float2 ( Opaque_fs_IN . loc . x , Opaque_fs_IN . loc . z ) + heightBiasUv . xy ) * heightScaleUv . xy ; float heightTap = heightTexture . Sample ( LinearClampSampler , heightUV ) . r ; float duneHeightOff = 1.125 ; float duneHeight = heightBiasY + ( float ) duneHeightOff + ( float ) heightTap ; float sideIntensity = saturate ( 1 * ( duneHeight - Opaque_fs_IN . loc . y ) ) ; sideIntensity *= sideIntensity ; #line 309 float uScaleMult = 0.6 ; float vScaleMult = 0.6 ; float2 sandUV = 4.0 * float2 ( offsetUv . x * uScaleMult , offsetUv . y * vScaleMult ) + sandBias . xy * sandScale . xy ; float sandNoise = 2.0 * ( sandFastTexture . Sample ( PointWrapAnisoSampler , sandUV ) . x - 0.5 ) ; #line 315 float2 litUV = ( float2 ( Opaque_fs_IN . loc . x , Opaque_fs_IN . loc . z ) + heightBiasUv . xy ) * heightScaleUv . xy ; float4 litTap = duneColorTexture . Sample ( LinearClampSampler , litUV ) ; float3 litColor = 4.0 * litTap . rgb * litTap . rgb ; float velvDune = litTap . a ; velvDune *= 0.333 * sandNoise ; float3 duneLitColor = ( 1.0 + velvDune ) * litColor ; #line 325 float3 gColorTop = gradColorTop . rgb ; float3 gColorBot = gColorTop ; #line 330 #line 338 gColorBot = duneLitColor ; gColorBot = gradColorBot . rgb ; #line 347 float blend = smoothstep ( gradCenter - gradLength * 0.5 , gradCenter + gradLength * 0.5 , Opaque_fs_IN . uv2 . y ) ; float3 gradColor = lerp ( gColorBot , gColorTop , blend ) ; #line 354 float3 color = 0 ; #line 402 color = Opaque_fs_IN . color . rgb * 2 * tColor * gradColor * ( l_c . xyz + l_a . xyz ) ; color = lerp ( color , duneLitColor , sideIntensity ) ; #line 412 float baseAlpha = Opaque_fs_IN . color . a ; float alpha = baseAlpha * tAlpha * ( 1 - ( tMask ) + tNoise * 0.25 ) ; #line 424 Opaque_fs_OUT . color . rgb = color ; Opaque_fs_OUT . color . a = alpha ; clip ( Opaque_fs_OUT . color . a - 0.5f ) ; #line 434 } 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 466 D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__4911.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh (P6617)D3DSHDR  ` /8 a=}! $0<H%Opaque_vs_mainQ  modelIT"Q `modelViewProjQ model"Q eyePositionWS"Q obbCenter_Width"Q obbHeight_vOff /sh   ` Opaque_vs_mainnonew 1 ?\T ,$  ` Opaque_vs_mainnone-.  ` 'D:\Dev\TGC\Journey\head\Journey\shaderD:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__4911.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__4911.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory..1_^-zvE¤$2T/LinkInfo/names/src/headerblock/src/files/d:\dev\tgc\journey\head\journey\shader" Q3 38776 @(h,Q.-PO/$0123456789:;<=>?@ABCDEFGHI%  !"#&'()*+,JKLNMRCOLORNORMALPOSITIONTEXCOORDPEffectVariantPMaterialOpaqueVertexColorNormalST   ' - 4#p`P@0 555p5X5@5(55666866h6P686 1XhX1PXZP!PAP #P# XXXP1 #XXXXXXXXHP! PAP!PaXX PQ P P P 4 P E hPha^AdP>&vA