RYHPT54611E.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_textureFlagsXXp hh p@0 @@PP!@@%PD<& '`,+@8+.6P0 Dx(EXH!Data/Shaders/S_SandFall_vs__SandFall_fs__59857.cgfx#C8998E93C03C3768A305106C859FA35C#materialData/Shaders/S_SandFall_vs__SandFall_fs__59857.fx#C8998E93C03C3768A305106C859FA35C #line 1 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" #define D_PLATFORM_D3D11x64 #define SAMPLETERRAIN #define GRADIENT #define LIT #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 58 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.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 149 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.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__59857.fx(1ALPHATESTENABLEGRADIENTLITSAMPLETERRAIN(GGGGGGGG?????AA?<05spDXBCC?.W\<8  ,66RDEF <Aw RD11< ($   !8N W ` n  |     LinearClampSamplerLinearWrapSamplerLinearWrapAnisoSamplerPointWrapAnisoSamplertexColortexAlphanoiseWhiteTexsandHiIrrCubesandFastTextureheightTextureduneColorTexturenoiseMotionTexsfTexMask$Globals$ @8\`@8j@8p~ 0@PTX\`p  # 2 ; F Q ^ j cameraNearTimesFarfloatcameraFarMinusNearcameraNearFarfloat4modelITfloat4x4,modelViewProjmodeleyePositionWSobbCenter_WidthobbHeight_vOffl_cl_al_sl_dvelvetIntvelvetRatioscaledTimeuvScrollSpeedsandBiassandScaleheightBiasUvheightScaleUvheightBiasYgradColorTopgradShadTopBotinShadowgradCentergradLengthgradColorBotsparkleMultsparkleScaleMicrosoft (R) HLSL Shader Compiler 10.1ISGN SV_POSITIONCOLORTEXCOORDSV_IsFrontFaceOSGN, SV_TARGETSHEX+P jYF !Z` Z` Z`Z`XpUUXpUUXpUUX0pUUXpUUXpUUXpUUXpUUXpUUbbb2brbrbrc e h7  @@?6" "* 8": 8: +R@FF+r@+B@+@+@6@ ף;6"@6B@6rF6*6*0": +:8  +"@6BA"*8 6 A" 6 ECUrFF~` /rF8 rF@ @ @ @rFrFF+:8  +"@6BA"*8 6 A": 6*ECUF6y` : :@+rVrFF+BB:*6B@6@6:6":6":0"B**+B@+8 :6:A":6 8 ECU t`66@8 @>>"*+B8B *6B*A"*6 ECUB |` * "@+* :+B*B*2F 82FF ECUFs` 6:6@?: ::+@6A: 8::4:@3:@?8::6@?6@?8 :8" 8 2F@@@8 2F F 2FFECUFF~`6"@ 8 @@2F 82FF ECUF6y` 8 r@@@@8V 6 8 @~>8   @?8r6rF 6 6rF 6" 8* @?6:A: 8* @?: 6:A::: @????:8::4:@3:@?8:@:@@@8::8::6rFArFF8rFrFF6A :8 : 8rFFFD 8rFFFD 8rF F F D 8rF rFFFFD 8rF+ @6" @>82 F F8@>8" : +@2FF 82FF ECUr FF~`8 r F @@@@6r @r F F F F D 8r F 6@?8 r F@AAA8r F r F F 8 r F@@@@8r F r F F 8 r F@@@@8r F r F F "F F D"8r VF :6rF6rF"F F D"8r VF 6"@?"FF FF 6:6A4:6:A:@?K:8:@0n:@'=8:::@4Y8:::@ ?8::8:@:@I@1:::::6:A4::6:A:@?K:8:@0n:@'=8:::@4Y8:::@ ?8::8:@:@I@1::::::8rVF 6rFArFF"FFD"8rVF8r F 6r FA rFF "FFD"8rVF"FF4::3::8"8@?@>::6:A:@?8@ff>"@Q=":4:@3:@?4"@3"@?8"M":8"M":M:":8"":8":8" 6 A" 4"@3"@?ECUrF F~` /rF8 rF@ @ @ @rF6rF8 r F@@@@8rFF 8rFF+@"FF 6A4":6@":6"A 4 @3 @?+"@8 @)> 8rF6@*BL?6" A"@?8"" F F6 A:@?8:: :8 @L? "FF6"A"@?4"@3"@?4"@$4(6@?8:8"8"8":6@ #=6A:@?8::":6@8 ":@A8  @A"FF 4"@3"@?4"@$4(/"8":"8 8rVF rFF8rFF8 rF @@@@@@@8rVF8rFrFF"FFK"8"@ #<4"@3"@?6"A"@?8"8 rF@fff?fff?fff?8rF rFFFFD 8rF8rFF 8rVF8rF 8rF 8 rF@L?L?L?rFFFFD 8rFFF6" A4 6 A @?4 @$4(/ 8 @B 8rFrFF6rFArFF8FF F6:8* +"@6B:A"*8B*@>"*8 6r F6 6"@" 1"@"@ 6  >STAT9 )SPDBMicrosoft C/C++ MSF 7.00 DS(8 <.1_^.dܯE.Eh?^Q3SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; RenderTargetWriteMask [ 0 ] = 15 ; AlphaToCoverageEnable = false ; } ; DepthStencilState ourDepthStencilState { DepthEnable = true ; DepthFunc = less ; StencilEnable = false ; } ; RasterizerState ourRasterState { CullMode = None ; DepthBias = 0.0f ; ScissorEnable = false ; MultiSampleEnable = false ; DepthClipEnable = false ; AntialiasedLineEnable = falseZL]dPh&u)Q 5A$b}VUvvju2#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__59857.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" #line 8 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 57 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" float4x4 modelIT : modelit ; float4x4 modelViewProj : modelviewproj ; float4x4 model : model ; float4 eyePositionWS : eyePositionWS ; #line 74 float4 obbCenter_Width ; float4 obbHeight_vOff ; #line 79 #line 82 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 105 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 118 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 130 Opaque_vs_OUT . loc . w = 0 ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 148 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" #line 153 #line 156 float4 l_c , l_a ; float4 l_s ; float4 l_d ; float velvetInt , velvetRatio ; float scaledTime ; #line 163 float uvScrollSpeed ; #line 166 Texture2D < float4 > texColor ; Texture2D < float4 > texAlpha ; Texture2D < float4 > noiseWhiteTex ; #line 171 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 ; float4 gradShadTopBot ; float inShadow ; float gradCenter ; float gradLength ; float4 gradColorBot ; Texture2D < float4 > noiseMotionTex ; float sparkleMult ; float4 sparkleScale ; #line 208 #line 211 Texture2D < float4 > sfTexMask ; #line 214 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 227 } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 238 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 258 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 264 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 302 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 310 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 316 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 326 float3 gColorTop = gradColorTop . rgb ; float3 gColorBot = gColorTop ; float gShadowTop = gradShadTopBot [ 0 ] ; float gShadowBot = gShadowTop ; const float terrainScale = 0.5 ; float2 colorShadowUv = float2 ( 1 - ( terrainScale * Opaque_fs_IN . loc . x + 0.5 ) / 256.0 , ( terrainScale * Opaque_fs_IN . loc . z + 0.5 ) / 512.0 ) ; float4 colorShadowTap = float4 ( pow ( duneTexture . Sample ( LinearClampSampler , colorShadowUv ) . xyz , 2.2f ) , duneTexture . Sample ( LinearClampSampler , colorShadowUv ) . a ) ; gColorBot = colorShadowTap . rgb ; gShadowBot = saturate ( 10.0 * ( colorShadowTap . a - 0.25 ) ) ; #line 342 gColorBot = gradColorBot . rgb ; gShadowBot = gradShadTopBot [ 1 ] ; float blend = smoothstep ( gradCenter - gradLength * 0.5 , gradCenter + gradLength * 0.5 , Opaque_fs_IN . uv2 . y ) ; float3 gradColor = lerp ( gColorBot , gColorTop , blend ) ; float gradShadow = lerp ( gShadowBot , gShadowTop , blend ) ; float3 color = 0 ; float3 Nn = normalize ( Opaque_fs_IN . normal * face ) ; float3 Vn = normalize ( Opaque_fs_IN . eye . xyz ) ; float3 Ln = normalize ( l_d . xyz ) ; float3 Hn = normalize ( Vn + Ln ) ; float specularPow = l_s . w ; float2 noiseUv = sparkleScale . xy * ( Opaque_fs_IN . uv . xy * float2 ( 1 , 0.125 ) + float2 ( 0 , 0.125 * sfVOffset * uvScrollSpeed ) ) ; float3 Nnoise = 2.0 * noiseMotionTex . Sample ( LinearWrapAnisoSampler , noiseUv ) . xyz - 1.0 ; Nnoise = normalize ( Nnoise ) ; float noiseFade = 1.0 ; float3 Nnt = 24.0 * Nn + noiseFade * Nnoise ; float3 Nnv = 4.0 * Nn + noiseFade * Nnoise ; float3 Nns = normalize ( 4.0 * Nn + noiseFade * Nnoise ) ; float diffuse = gradShadow * OrenNayarDiffuse ( Ln , Vn , normalize ( Nnt ) , 0.5 ) ; diffuse = saturate ( diffuse - inShadow ) ; float4 lightCubeTap = float4 ( pow ( sandHiIrrCube . Sample ( LinearClampSampler , Nnt ) . xyz , 2.2f ) , sandHiIrrCube . Sample ( LinearClampSampler , Nnt ) . a ) ; float3 fillColor = lightCubeTap . rgb ; float3 albedo = Opaque_fs_IN . color . rgb * 2.0 * tColor * gradColor ; float velv = saturate ( 1 - ( abs ( dot ( Vn , Nnv ) ) - 0.12 ) ) ; albedo *= 1 + 0.166 * velv ; float a = sqrt ( 2.0 / 3.14159268 ) ; float schlickSmithShadow = 0.8 * 1.0 / ( ( diffuse * ( 1.0 - a ) + a ) * ( dot ( Nns , Vn ) * ( 1.0 - a ) + a ) ) ; float base = saturate ( 1.0 - dot ( Vn , Hn ) ) ; float exponential = pow ( max ( base , 0.00000000000001 ) , 5.0 ) ; float F0spec = 0.04 ; float fresnelSpec = exponential + F0spec * ( 1.0 - exponential ) ; float specPow = 0.0 ; float specular = fresnelSpec * schlickSmithShadow * ( 8.0 + specPow ) / 25.0 * pow ( max ( saturate ( dot ( Hn , Nns ) ) , 0.00000000000001 ) , specPow ) ; color = albedo * ( l_c . xyz * diffuse + fillColor ) + 3.0 * l_c . rgb * diffuse * specular ; float sparkleFade = 1.0 - saturate ( length ( Opaque_fs_IN . eye . xyz ) * 0.01 ) ; sparkleFade *= sparkleFade ; float3 Nna = normalize ( 0.9 * Nn + noiseFade * Nnoise ) ; color += albedo * l_s . rgb * sparkleFade * sparkleMult * velvetInt * pow ( max ( 1.0 - abs ( dot ( Vn , normalize ( Nna + 0.8 * Vn ) ) ) , 0.00000000000001 ) , 64.0 ) ; #line 405 color = lerp ( color , duneLitColor , sideIntensity ) ; #line 413 float baseAlpha = Opaque_fs_IN . color . a ; float alpha = baseAlpha * tAlpha * ( 1 - ( tMask ) + tNoise * 0.25 ) ; #line 425 Opaque_fs_OUT . color . rgb = color ; Opaque_fs_OUT . color . a = alpha ; clip ( Opaque_fs_OUT . color . a - 0.5f ) ; #line 435 } 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 467  CD:\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__59857.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" #line 8 BlendState ourBlendState { BlendEnable [ 0 ] = FALSE ; BlendEnable [ 1 ] = FALSE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; 0?)(0t]xA()B< G GMicrosoft (R) HLSL Shader Compiler 10.1=hlslFlags0x4005hlslTargetps_5_0hlslEntryOpaque_fs_mainhlslDefines /DALPHATESTENABLE=1 /DLIT=1 /DSAMPLETERRAIN=1 /DPHYRE_D3DFX=1 /DGRADIENT=16"))HOpaque_fs_main2> Opaque_fs_INPH)PH)PH)P H) PH)PH)PH)PH)P H) P$H)$P(H)(P,H),P0H)0P4H)4P8H)8P<H)<P@H)@PDH)DPHH)HPLH)PPPH)TPTH)XPXH)\P\H)`P`H)dPdH)hPhH)lPlH)p6> Opaque_fs_OUTPH)PH)PH)P H) P **>@facePl`2>@sfVOffsetP.>offsetUvP | P | P ,P  @.>tColorP@< P@<$P@<(P<@P<DP<H.>@tAlphaPT'XPX<.>@tMaskPh(  Pt@.>@tNoiseP| ,PDP !.>@kTapRadP06>tkBlurIterationsP4PL$*>tiP`<P4:> kNoiseDensityMultP8.> rawNoiseP|8P|<.> uvOffsetPHPL.> heightUVP 0P 42>@heightTapP P6>@duneHeightOffP  ,2>@duneHeightP\ H6>@sideIntensityP 2>@uScaleMultP( ,2>@vScaleMultP< 0.> sandUVP ,P @2>@sandNoisePT .> litUVP ,0P ,4.>litTapP D4P D8P D<P  0.>litColorP 4P 8P \<.>@velvDuneP 80PP 2>duneLitColorP 0P 4P 82>gColorTopP P@P PDP PH2>gColorBotP PP TP X2>@gShadowTopP 2>@gShadowBotP .>@blendP<,2>gradColorP(@P(DP(H2>@gradShadowP, .>colorP%@P%DP%HP()l P()l$P()l(P)P)P)*>NnPPPTPX*>VnPH`PHdPHh*>LnPpPtPx*>HnP P P .> noiseUvPP,.>NnoisePhPhPh2>@noiseFadeP*>NntP( P( P( *>NnvPPP*>NnsP4P4P4.>@diffuseP882>lightCubeTapPpPtPx2>fillColorPpPtPx.>albedoP P$P(*>@velvP 0*>@aP :>@schlickSmithShadowP!*>@baseP4"2>@exponentialP".>@F0specP"P,2>@fresnelSpecPT#L.>@specPowPh#,.>@specularP$2>@sparkleFadeP8&*>NnaP'PP'TP'X2>@baseAlphaP).>@alphaP`**M"  'x (  $ * i -T , * 6 1 p `T  % &   " ( 3 > , @4 X cL P D e4  gL  +  *  (   & 2  4  4 ! -  / # 3 K8 /8 O [ / _ j /L ) l n F> P.> lightPpPtPx*> viewP`PdPh*> normPPP2>@roughnessP.>@VdotNP4.>@LdotNPL,2>@cos_theta_iP 8,.>@theta_rPX<.>@theta_iPL2>@cos_phi_diffP.>@alphaP\*>@betaP0<.>@sigma2PL*>@APL*>@BP(N0qU3̱onNwŒ:BBB%+ $%HHl l             @@TThh||  44PPdd||((<<ddxx  ((@@\\pp88LL``tt  !!!! ! !$!$!@!@!T!T!p!p!!!""""""##0$0$D$D$`$`$x$x$$$$$$$$$ % ( %( %, &, &@ &@ &\ '\ 'p 'p ' . . . . / / / / 0 0 1 1@ 1@ 1\ 2\ 2p 2p 2 2 2 2 2 2 2 2 2 3 3 6 6( 7( 7< 8< 8X 8X 8t 8t 8 8 8 8 8 9 9 9 9 9 98 98 9T <T <t <t < = = > > > > ? ? @ @4 @4 @P BP Bl Bl B F F I I Y Y [ [ _ ___ _ _@_@_`_`_____________0_0_L_L_h_h_____`````` ` `(b(b@b@b\b\bxbxbgggggggghhhh,h,hHiHililiiijjjjjjjjmmmm0m0mLmLmhmhmmmmmmmnnnn,n,nLnLnhohoooooqqrrrr r r(s(sPsPslslstttttttttttt4v4v8v8vLvLv`v`v|v|vvvvvvvvvvv v v$v$v@v@vXvXvtvtvvvvvvvvvvvvv0v0vLvLvhvhvvvvvvvvvvv v v$v$v@v@vTvTvpvpvvvvvvvvvvvvv4v4vPvPvlvlvvvvvvvvvvvvv$v$v@v@v\v\vtvtvvvvvvvvvvvvv0v0vLvLvhvhvvvvvvvvvvv v v(v(vDvDv`v`v|v|vvvvvvvvvvvvv4v4vPvPvlvlvvvwwwwwwwwyy@y@yTyTy|y|yzz||||||~~~~4~4~L~L~h~h~|~|~~~~~~~~~    4 4 P P l l           !! ! !%>):>:><><><Y"WY"WY"WY?OY?OY?OY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WY"WYW/+/+/-/-*\$k$k$k+ )K4K=KIGCG)8G#:G#:G#AG#AGCGCGEGE    ) 'w<Bw<Bw0Dw0HwP_wekwekwPmwPqw.sw u5#151515353G=GEGEGEGEGE F2BF2BF'DFD 5;GIPkz`|`|ZTTTa*a6a 8a<Ja<Ta<_a _W*LW*LW*SWUWUWUWU >%>):>:><><><)bi\iPkPkPkEm?o?o9o9o3---; 9; 9; 9; 90 .J$J*6J*6J*6J:FJ*FJH)''%/ +/ +/-/-/- Hp4Tt Dd8\(Hl        184 ddl@float4@ float3 position color  uv 0uv2 @normal Lloc \eye blisFrontFace"pOpaque_fs_v2f color"Opaque_fs_f2f  @@float2@        ; } ; #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 57 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" float4x4 modelIT : modelit ; float4x4 modelViewProj : modelviewproj ; float4x4 model : model ; float4 eyePositionWS : eyePositionWS ; #line 74 float4 obbCenter_Width ; float4 obbHeight_vOff ; #line 79 #line 82 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 105 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 118 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 130 Opaque_vs_OUT . loc . w = 0 ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 148 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" #line 153 #line 156 float4 l_c , l_a ; float4 l_s ; float4 l_d ; float velvetInt , velvetRatio ; float scaledTime ; #line 163 float uvScrollSpeed ; #line 166 Texture2D < float4 > texColor ; Texture2D < float4 > texAlpha ; Texture2D < float4 > noiseWhiteTex ; #line 171 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 ; float4 gradShadTopBot ; float inShadow ; float gradCenter ; float gradLength ; float4 gradColorBot ; Texture2D < float4 > noiseMotionTex ; float sparkleMult ; float4 sparkleScale ; #line 208 #line 211 Texture2D < float4 > sfTexMask ; #line 214 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 227 } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 238 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 258 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 264 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 302 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 310 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 316 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 326 float3 gColorTop = gradColorTop . rgb ; float3 gColorBot = gColorTop ; float gShadowTop = gradShadTopBot [ 0 ] ; float gShadowBot = gShadowTop ; const float terrainScale = 0.5 ; float2 colorShadowUv = float2 ( 1 - ( terrainScale * Opaque_fs_IN . loc . x + 0.5 ) / 256.0 , ( terrainScale * Opaque_fs_IN . loc . z + 0.5 ) / 512.0 ) ; float4 colorShadowTap = float4 ( pow ( duneTexture . Sample ( LinearClampSampler , colorShadowUv ) . xyz , 2.2f ) , duneTexture . Sample ( LinearClampSampler , colorShadowUv ) . a ) ; gColorBot = colorShadowTap . rgb ; gShadowBot = saturate ( 10.0 * ( colorShadowTap . a - 0.25 ) ) ; #line 342 gColorBot = gradColorBot . rgb ; gShadowBot = gradShadTopBot [ 1 ] ; float blend = smoothstep ( gradCenter - gradLength * 0.5 , gradCenter + gradLength * 0.5 , Opaque_fs_IN . uv2 . y ) ; float3 gradColor = lerp ( gColorBot , gColorTop , blend ) ; float gradShadow = lerp ( gShadowBot , gShadowTop , blend ) ; float3 color = 0 ; float3 Nn = normalize ( Opaque_fs_IN . normal * face ) ; float3 Vn = normalize ( Opaque_fs_IN . eye . xyz ) ; float3 Ln = normalize ( l_d . xyz ) ; float3 Hn = normalize ( Vn + Ln ) ; float specularPow = l_s . w ; float2 noiseUv = sparkleScale . xy * ( Opaque_fs_IN . uv . xy * float2 ( 1 , 0.125 ) + float2 ( 0 , 0.125 * sfVOffset * uvScrollSpeed ) ) ; float3 Nnoise = 2.0 * noiseMotionTex . Sample ( LinearWrapAnisoSampler , noiseUv ) . xyz - 1.0 ; Nnoise = normalize ( Nnoise ) ; float noiseFade = 1.0 ; float3 Nnt = 24.0 * Nn + noiseFade * Nnoise ; float3 Nnv = 4.0 * Nn + noiseFade * Nnoise ; float3 Nns = normalize ( 4.0 * Nn + noiseFade * Nnoise ) ; float diffuse = gradShadow * OrenNayarDiffuse ( Ln , Vn , normalize ( Nnt ) , 0.5 ) ; diffuse = saturate ( diffuse - inShadow ) ; float4 lightCubeTap = float4 ( pow ( sandHiIrrCube . Sample ( LinearClampSampler , Nnt ) . xyz , 2.2f ) , sandHiIrrCube . Sample ( LinearClampSampler , Nnt ) . a ) ; float3 fillColor = lightCubeTap . rgb ; float3 albedo = Opaque_fs_IN . color . rgb * 2.0 * tColor * gradColor ; float velv = saturate ( 1 - ( abs ( dot ( Vn , Nnv ) ) - 0.12 ) ) ; albedo *= 1 + 0.166 * velv ; float a = sqrt ( 2.0 / 3.14159268 ) ; float schlickSmithShadow = 0.8 * 1.0 / ( ( diffuse * ( 1.0 - a ) + a ) * ( dot ( Nns , Vn ) * ( 1.0 - a ) + a ) ) ; float base = saturate ( 1.0 - dot ( Vn , Hn ) ) ; float exponential = pow ( max ( base , 0.00000000000001 ) , 5.0 ) ; float F0spec = 0.04 ; float fresnelSpec = exponential + F0spec * ( 1.0 - exponential ) ; float specPow = 0.0 ; float specular = fresnelSpec * schlickSmithShadow * ( 8.0 + specPow ) / 25.0 * pow ( max ( saturate ( dot ( Hn , Nns ) ) , 0.00000000000001 ) , specPow ) ; color = albedo * ( l_c . xyz * diffuse + fillColor ) + 3.0 * l_c . rgb * diffuse * specular ; float sparkleFade = 1.0 - saturate ( length ( Opaque_fs_IN . eye . xyz ) * 0.01 ) ; sparkleFade *= sparkleFade ; float3 Nna = normalize ( 0.9 * Nn + noiseFade * Nnoise ) ; color += albedo * l_s . rgb * sparkleFade * sparkleMult * velvetInt * pow ( max ( 1.0 - abs ( dot ( Vn , normalize ( Nna + 0.8 * Vn ) ) ) , 0.00000000000001 ) , 64.0 ) ; #line 405 color = lerp ( color , duneLitColor , sideIntensity ) ; #line 413 float baseAlpha = Opaque_fs_IN . color . a ; float alpha = baseAlpha * tAlpha * ( 1 - ( tMask ) + tNoise * 0.25 ) ; #line 425 Opaque_fs_OUT . color . rgb = color ; Opaque_fs_OUT . color . a = alpha ; clip ( Opaque_fs_OUT . color . a - 0.5f ) ; #line 435 } 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 467 D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__59857.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh (:BPB)B 18   OrenNayarDiffuseD3DSHDR+ `  OrenNayarDiffuse /UI!E)muI]q59e! @@ @ @@@@ $0<HT`lx ,8DP\ht%Opaque_fs_main&Q LinearClampSampler&Q LinearWrapSampler*QLinearWrapAnisoSampler*QPointWrapAnisoSampler"QobbHeight_vOffQl_cQ0l_sQ@l_dQPvelvetIntQXscaledTime"Q\uvScrollSpeedQtexColorQtexAlpha"QnoiseWhiteTex"Q@@ /sandHiIrrCube"QsandFastTextureQ`sandBiasQpsandScale"QheightTexture"QheightBiasUv"QheightScaleUvQheightBiasY&QduneColorTexture"QgradColorTop"QgradShadTopBotQinShadowQgradCenterQgradLength"QgradColorBot"QnoiseMotionTexQsparkleMult"QsparkleScaleQsfTexMasky.sh + ` " &Opaque_fs_mainnonew 1 ?\T ,(+ ` " &Opaque_fs_mainnone-.+ `>+'D:\Dev\TGC\Journey\head\Journey\shaderD:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__59857.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migrator.1_^.dܯE.Eh?^T/LinkInfo/names/src/headerblock/src/files/d:\dev\tgc\journey\head\journey\shader" Q3 l7X`CAIl (,}QP|{s)STUVWXYZ[\]^_`abcdefghijklmnopqr*  !"#$%&'(+,-./0123456789:;<=>?@ABCDEFGHIJKLMNORtuvxwyz~ 8PhXp `0P@PT\@`0p @1``@1 @1Xp `0P@PT\@`0p @1``@1 @1 484P444444h44X4p444@444(4 484P444444h44X4p 444@4 44(4@@@@p @`0@P@@P@T@\@@`@0p@ @@@@@@@@@@G4G4G4G4pG4XG4@G4(G4B4B4B4D4B4B4B4hB4PB48B4 1@1`@`1 @ AnisoClampSamplerLinearClampSamplerLinearWrapAnisoSamplerLinearWrapSamplerLinearWrapTSamplerPointClampSamplerPointWrapAnisoSamplerPointWrapSamplerduneColorTextureduneTexturegradCentergradColorBotgradColorTopgradLengthgradShadTopBotheightBiasUvheightBiasYheightScaleUvheightTextureinShadowl_al_cl_dl_smodelmodelITmodelViewProjnoiseMotionTexnoiseWhiteTexobbCenter_WidthobbHeight_vOffsandBiassandFastTexturesandHiIrrCubesandScalesfTexMasksparkleMultsparkleScaletexAlphatexColoruvScrollSpeedvelvetIntvelvetRatio05sv05spOpaque_fs_mainOpaque_vs_mainj 8P}Rh}RCOLORNORMALPOSITIONTEXCOORD05svDXBCX }8OOsp:8x RDEF8h<ARD11< ($ \$Globals\0LpL @`@@&59 =0A@EPLOTL[XLf\Lt`}pLLLLLcameraNearTimesFarfloatCcameraFarMinusNearcameraNearFarfloat4modelITfloat4x4modelViewProjmodeleyePositionWSobbCenter_WidthobbHeight_vOffl_cl_al_sl_dvelvetIntvelvetRatioscaledTimeuvScrollSpeedsandBiassandScaleheightBiasUvheightScaleUvheightBiasYgradColorTopgradShadTopBotinShadowgradCentergradLengthgradColorBotsparkleMultsparkleScaleMicrosoft (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 DS_^8 <.1_^H3B` Q3SrcBlendAlpha [ 0 ] = ONE ; DestBlendAlpha [ 0 ] = ONE ; BlendOpAlpha [ 0 ] = ADD ; RenderTargetWriteMask [ 0 ] = 15 ; AlphaToCoverageEnable = false ; } ; DepthStencilState ourDepthStencilState { DepthEnable = true ; DepthFunc = less ; StencilEnable = false ; } ; RasterizerState ourRasterState { CullMode = None ; DepthBias = 0.0f ; ScissorEnable = false ; MultiSampleEnable = false ; DepthClipEnable = false ; AntialiasedLineEnable = falseZL- \dPh&g79A$A#line 1 "D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__59857.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" #line 8 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 57 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" float4x4 modelIT : modelit ; float4x4 modelViewProj : modelviewproj ; float4x4 model : model ; float4 eyePositionWS : eyePositionWS ; #line 74 float4 obbCenter_Width ; float4 obbHeight_vOff ; #line 79 #line 82 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 105 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 118 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 130 Opaque_vs_OUT . loc . w = 0 ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 148 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" #line 153 #line 156 float4 l_c , l_a ; float4 l_s ; float4 l_d ; float velvetInt , velvetRatio ; float scaledTime ; #line 163 float uvScrollSpeed ; #line 166 Texture2D < float4 > texColor ; Texture2D < float4 > texAlpha ; Texture2D < float4 > noiseWhiteTex ; #line 171 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 ; float4 gradShadTopBot ; float inShadow ; float gradCenter ; float gradLength ; float4 gradColorBot ; Texture2D < float4 > noiseMotionTex ; float sparkleMult ; float4 sparkleScale ; #line 208 #line 211 Texture2D < float4 > sfTexMask ; #line 214 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 227 } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 238 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 258 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 264 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 302 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 310 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 316 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 326 float3 gColorTop = gradColorTop . rgb ; float3 gColorBot = gColorTop ; float gShadowTop = gradShadTopBot [ 0 ] ; float gShadowBot = gShadowTop ; const float terrainScale = 0.5 ; float2 colorShadowUv = float2 ( 1 - ( terrainScale * Opaque_fs_IN . loc . x + 0.5 ) / 256.0 , ( terrainScale * Opaque_fs_IN . loc . z + 0.5 ) / 512.0 ) ; float4 colorShadowTap = float4 ( pow ( duneTexture . Sample ( LinearClampSampler , colorShadowUv ) . xyz , 2.2f ) , duneTexture . Sample ( LinearClampSampler , colorShadowUv ) . a ) ; gColorBot = colorShadowTap . rgb ; gShadowBot = saturate ( 10.0 * ( colorShadowTap . a - 0.25 ) ) ; #line 342 gColorBot = gradColorBot . rgb ; gShadowBot = gradShadTopBot [ 1 ] ; float blend = smoothstep ( gradCenter - gradLength * 0.5 , gradCenter + gradLength * 0.5 , Opaque_fs_IN . uv2 . y ) ; float3 gradColor = lerp ( gColorBot , gColorTop , blend ) ; float gradShadow = lerp ( gShadowBot , gShadowTop , blend ) ; float3 color = 0 ; float3 Nn = normalize ( Opaque_fs_IN . normal * face ) ; float3 Vn = normalize ( Opaque_fs_IN . eye . xyz ) ; float3 Ln = normalize ( l_d . xyz ) ; float3 Hn = normalize ( Vn + Ln ) ; float specularPow = l_s . w ; float2 noiseUv = sparkleScale . xy * ( Opaque_fs_IN . uv . xy * float2 ( 1 , 0.125 ) + float2 ( 0 , 0.125 * sfVOffset * uvScrollSpeed ) ) ; float3 Nnoise = 2.0 * noiseMotionTex . Sample ( LinearWrapAnisoSampler , noiseUv ) . xyz - 1.0 ; Nnoise = normalize ( Nnoise ) ; float noiseFade = 1.0 ; float3 Nnt = 24.0 * Nn + noiseFade * Nnoise ; float3 Nnv = 4.0 * Nn + noiseFade * Nnoise ; float3 Nns = normalize ( 4.0 * Nn + noiseFade * Nnoise ) ; float diffuse = gradShadow * OrenNayarDiffuse ( Ln , Vn , normalize ( Nnt ) , 0.5 ) ; diffuse = saturate ( diffuse - inShadow ) ; float4 lightCubeTap = float4 ( pow ( sandHiIrrCube . Sample ( LinearClampSampler , Nnt ) . xyz , 2.2f ) , sandHiIrrCube . Sample ( LinearClampSampler , Nnt ) . a ) ; float3 fillColor = lightCubeTap . rgb ; float3 albedo = Opaque_fs_IN . color . rgb * 2.0 * tColor * gradColor ; float velv = saturate ( 1 - ( abs ( dot ( Vn , Nnv ) ) - 0.12 ) ) ; albedo *= 1 + 0.166 * velv ; float a = sqrt ( 2.0 / 3.14159268 ) ; float schlickSmithShadow = 0.8 * 1.0 / ( ( diffuse * ( 1.0 - a ) + a ) * ( dot ( Nns , Vn ) * ( 1.0 - a ) + a ) ) ; float base = saturate ( 1.0 - dot ( Vn , Hn ) ) ; float exponential = pow ( max ( base , 0.00000000000001 ) , 5.0 ) ; float F0spec = 0.04 ; float fresnelSpec = exponential + F0spec * ( 1.0 - exponential ) ; float specPow = 0.0 ; float specular = fresnelSpec * schlickSmithShadow * ( 8.0 + specPow ) / 25.0 * pow ( max ( saturate ( dot ( Hn , Nns ) ) , 0.00000000000001 ) , specPow ) ; color = albedo * ( l_c . xyz * diffuse + fillColor ) + 3.0 * l_c . rgb * diffuse * specular ; float sparkleFade = 1.0 - saturate ( length ( Opaque_fs_IN . eye . xyz ) * 0.01 ) ; sparkleFade *= sparkleFade ; float3 Nna = normalize ( 0.9 * Nn + noiseFade * Nnoise ) ; color += albedo * l_s . rgb * sparkleFade * sparkleMult * velvetInt * pow ( max ( 1.0 - abs ( dot ( Vn , normalize ( Nna + 0.8 * Vn ) ) ) , 0.00000000000001 ) , 64.0 ) ; #line 405 color = lerp ( color , duneLitColor , sideIntensity ) ; #line 413 float baseAlpha = Opaque_fs_IN . color . a ; float alpha = baseAlpha * tAlpha * ( 1 - ( tMask ) + tNoise * 0.25 ) ; #line 425 Opaque_fs_OUT . color . rgb = color ; Opaque_fs_OUT . color . a = alpha ; clip ( Opaque_fs_OUT . color . a - 0.5f ) ; #line 435 } 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 467  CD:\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__59857.fx" #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" #line 8 BlendState ourBlendState { BlendEnable [ 0 ] = FALSE ; BlendEnable [ 1 ] = FALSE ; SrcBlend [ 0 ] = Src_Alpha ; DestBlend [ 0 ] = Inv_Src_Alpha ; BlendOp [ 0 ] = ADD ; 0^:)(0t]xA()B< G GMicrosoft (R) HLSL Shader Compiler 10.1=hlslFlags0x4005hlslTargetvs_5_0hlslEntryOpaque_vs_mainhlslDefines /DALPHATESTENABLE=1 /DLIT=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(.>@yDistP0qU3̱onNwŒ:BBBP  ZDkkkkkkkkkk4k4kTlTlhnhn|n|nnnnnnnoopppp<p<pPrPrdsdsxvxvwwxxyyyyyy y y(z(z@z@z\z\ztztz{{{{{{{{{{ { {(|(|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 57 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" float4x4 modelIT : modelit ; float4x4 modelViewProj : modelviewproj ; float4x4 model : model ; float4 eyePositionWS : eyePositionWS ; #line 74 float4 obbCenter_Width ; float4 obbHeight_vOff ; #line 79 #line 82 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 105 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 118 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 130 Opaque_vs_OUT . loc . w = 0 ; } #line 0 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh" #line 642 #line 148 "D:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fx" #line 153 #line 156 float4 l_c , l_a ; float4 l_s ; float4 l_d ; float velvetInt , velvetRatio ; float scaledTime ; #line 163 float uvScrollSpeed ; #line 166 Texture2D < float4 > texColor ; Texture2D < float4 > texAlpha ; Texture2D < float4 > noiseWhiteTex ; #line 171 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 ; float4 gradShadTopBot ; float inShadow ; float gradCenter ; float gradLength ; float4 gradColorBot ; Texture2D < float4 > noiseMotionTex ; float sparkleMult ; float4 sparkleScale ; #line 208 #line 211 Texture2D < float4 > sfTexMask ; #line 214 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 227 } ; struct Opaque_fs_f2f { float4 color : SV_TARGET0 ; } ; #line 238 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 258 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 264 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 302 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 310 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 316 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 326 float3 gColorTop = gradColorTop . rgb ; float3 gColorBot = gColorTop ; float gShadowTop = gradShadTopBot [ 0 ] ; float gShadowBot = gShadowTop ; const float terrainScale = 0.5 ; float2 colorShadowUv = float2 ( 1 - ( terrainScale * Opaque_fs_IN . loc . x + 0.5 ) / 256.0 , ( terrainScale * Opaque_fs_IN . loc . z + 0.5 ) / 512.0 ) ; float4 colorShadowTap = float4 ( pow ( duneTexture . Sample ( LinearClampSampler , colorShadowUv ) . xyz , 2.2f ) , duneTexture . Sample ( LinearClampSampler , colorShadowUv ) . a ) ; gColorBot = colorShadowTap . rgb ; gShadowBot = saturate ( 10.0 * ( colorShadowTap . a - 0.25 ) ) ; #line 342 gColorBot = gradColorBot . rgb ; gShadowBot = gradShadTopBot [ 1 ] ; float blend = smoothstep ( gradCenter - gradLength * 0.5 , gradCenter + gradLength * 0.5 , Opaque_fs_IN . uv2 . y ) ; float3 gradColor = lerp ( gColorBot , gColorTop , blend ) ; float gradShadow = lerp ( gShadowBot , gShadowTop , blend ) ; float3 color = 0 ; float3 Nn = normalize ( Opaque_fs_IN . normal * face ) ; float3 Vn = normalize ( Opaque_fs_IN . eye . xyz ) ; float3 Ln = normalize ( l_d . xyz ) ; float3 Hn = normalize ( Vn + Ln ) ; float specularPow = l_s . w ; float2 noiseUv = sparkleScale . xy * ( Opaque_fs_IN . uv . xy * float2 ( 1 , 0.125 ) + float2 ( 0 , 0.125 * sfVOffset * uvScrollSpeed ) ) ; float3 Nnoise = 2.0 * noiseMotionTex . Sample ( LinearWrapAnisoSampler , noiseUv ) . xyz - 1.0 ; Nnoise = normalize ( Nnoise ) ; float noiseFade = 1.0 ; float3 Nnt = 24.0 * Nn + noiseFade * Nnoise ; float3 Nnv = 4.0 * Nn + noiseFade * Nnoise ; float3 Nns = normalize ( 4.0 * Nn + noiseFade * Nnoise ) ; float diffuse = gradShadow * OrenNayarDiffuse ( Ln , Vn , normalize ( Nnt ) , 0.5 ) ; diffuse = saturate ( diffuse - inShadow ) ; float4 lightCubeTap = float4 ( pow ( sandHiIrrCube . Sample ( LinearClampSampler , Nnt ) . xyz , 2.2f ) , sandHiIrrCube . Sample ( LinearClampSampler , Nnt ) . a ) ; float3 fillColor = lightCubeTap . rgb ; float3 albedo = Opaque_fs_IN . color . rgb * 2.0 * tColor * gradColor ; float velv = saturate ( 1 - ( abs ( dot ( Vn , Nnv ) ) - 0.12 ) ) ; albedo *= 1 + 0.166 * velv ; float a = sqrt ( 2.0 / 3.14159268 ) ; float schlickSmithShadow = 0.8 * 1.0 / ( ( diffuse * ( 1.0 - a ) + a ) * ( dot ( Nns , Vn ) * ( 1.0 - a ) + a ) ) ; float base = saturate ( 1.0 - dot ( Vn , Hn ) ) ; float exponential = pow ( max ( base , 0.00000000000001 ) , 5.0 ) ; float F0spec = 0.04 ; float fresnelSpec = exponential + F0spec * ( 1.0 - exponential ) ; float specPow = 0.0 ; float specular = fresnelSpec * schlickSmithShadow * ( 8.0 + specPow ) / 25.0 * pow ( max ( saturate ( dot ( Hn , Nns ) ) , 0.00000000000001 ) , specPow ) ; color = albedo * ( l_c . xyz * diffuse + fillColor ) + 3.0 * l_c . rgb * diffuse * specular ; float sparkleFade = 1.0 - saturate ( length ( Opaque_fs_IN . eye . xyz ) * 0.01 ) ; sparkleFade *= sparkleFade ; float3 Nna = normalize ( 0.9 * Nn + noiseFade * Nnoise ) ; color += albedo * l_s . rgb * sparkleFade * sparkleMult * velvetInt * pow ( max ( 1.0 - abs ( dot ( Vn , normalize ( Nna + 0.8 * Vn ) ) ) , 0.00000000000001 ) , 64.0 ) ; #line 405 color = lerp ( color , duneLitColor , sideIntensity ) ; #line 413 float baseAlpha = Opaque_fs_IN . color . a ; float alpha = baseAlpha * tAlpha * ( 1 - ( tMask ) + tNoise * 0.25 ) ; #line 425 Opaque_fs_OUT . color . rgb = color ; Opaque_fs_OUT . color . a = alpha ; clip ( Opaque_fs_OUT . color . a - 0.5f ) ; #line 435 } 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 467 D:\\Dev\\TGC\\Journey\\head\\Journey\\Data\\Shaders\\S_SandFall_vs__SandFall_fs__59857.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migratory.sh (:BPB)BD3DSHDR  ` /8 a=}! $0<H%Opaque_vs_mainQ  modelIT"Q `modelViewProjQ model"Q eyePositionWS"Q obbCenter_Width"Q obbHeight_vOff /y.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__59857.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/S_SandFall_vs__SandFall_fs__59857.fxD:/Dev/TGC/Journey/head/Journey/Data/Shaders/Migrator.1_^H3B` T/LinkInfo/names/src/headerblock/src/files/d:\dev\tgc\journey\head\journey\shader" Q3 78`CA @(h,\32[Z4)56789:;<=>?@ABCDEFGHIJKLMNOPQRST*  !"#$%&'(+,-./01UVWYX]COLORNORMALPOSITIONTEXCOORDPEffectVariantPMaterialOpaqueVertexColorNormalST   ' - 4(p`P@0 5555p5X5@5(56668666h6P686 1XhX1PXZP!PAP (P( XXXP1 (XXXXXXXXHP! PAP!PaXX PQ P P P < P N hPha^  AdP>&vA