Skip to content

Commit

Permalink
PopcornFX Gem 2.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PopcornFX Bot committed Mar 28, 2024
1 parent 1ac2112 commit 4212d65
Show file tree
Hide file tree
Showing 28 changed files with 75 additions and 327 deletions.
4 changes: 0 additions & 4 deletions Assets/shaders/Billboard/Default/BillboardDistortion.azsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
#include <viewsrg.srgi>

#include "../../Common/PopcornOptions.azsli"
#if PK_O3DE_NEW_PBR
#include <Atom/Features/Pipeline/Forward/ForwardPassSrg.azsli>
#else
#include <Atom/Features/PBR/ForwardPassSrg.azsli>
#endif

#include "../../Common/MaterialSrg.azsli"

Expand Down
14 changes: 0 additions & 14 deletions Assets/shaders/Billboard/Legacy/BillboardLit_Legacy.azsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ struct VSOutput
float3 m_emissiveColor : COLOR1;
float m_alphaCursor : UV4;
float4 m_clipPosition : UV5;
#if !PK_O3DE_NEW_LIT
float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV6;
#endif
};

VSOutput BillboardVS(VertexInput input)
Expand All @@ -57,14 +54,6 @@ VSOutput BillboardVS(VertexInput input)

ComputeBillboardVertex(particleIdx, input.m_uv, vtxWorldPos, vtxNormal, vtxTangent, vtxUV0, vtxUV1, vtxTexFrameLerp);

#if !PK_O3DE_NEW_LIT
// directional light shadow
const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight;
if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount)
DirectionalLightShadow::GetShadowCoords(shadowIndex, vtxWorldPos, vtxNormal, output.m_shadowCoords);
#endif


// TBN:
float3 vtxBitangent = cross(vtxNormal, vtxTangent.xyz) * vtxTangent.w;

Expand Down Expand Up @@ -162,9 +151,6 @@ ForwardPassOutput BillboardFS(VSOutput input, bool isFrontFace : SV_IsFrontFace)
// Compute lighting:
return ComputeParticleLighting( input.m_worldPosition,
input.m_position,
#if !PK_O3DE_NEW_LIT
input.m_shadowCoords,
#endif
vertexNormal,
normal,
tangent,
Expand Down
4 changes: 0 additions & 4 deletions Assets/shaders/Billboard/Legacy/Billboard_Legacy.azsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
#include <viewsrg.srgi>

#include "../../Common/PopcornOptions.azsli"
#if PK_O3DE_NEW_PBR
#include <Atom/Features/Pipeline/Forward/ForwardPassSrg.azsli>
#else
#include <Atom/Features/PBR/ForwardPassSrg.azsli>
#endif

#include "../../Common/MaterialSrg.azsli"

Expand Down
26 changes: 0 additions & 26 deletions Assets/shaders/Common/LightingHelper.azsli
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@

#include "PopcornOptions.azsli"

#if PK_O3DE_NEW_PBR
#include <Atom/Features/Pipeline/Forward/ForwardPassOutput.azsli>
#else
#include <Atom/Features/PBR/ForwardPassOutput.azsli>
#endif
#include <Atom/Features/PBR/AlphaUtils.azsli>
#include <Atom/Features/PBR/LightingOptions.azsli>

Expand All @@ -22,25 +18,16 @@
#include <Atom/RPI/TangentSpace.azsli>

#include <Atom/Features/PBR/DefaultObjectSrg.azsli>
#if PK_O3DE_NEW_PBR
#include <Atom/Features/Pipeline/Forward/ForwardPassSrg.azsli>
#else
#include <Atom/Features/PBR/ForwardPassSrg.azsli>
#endif

#include <Atom/Features/PBR/Lighting/StandardLighting.azsli>
#if PK_O3DE_NEW_PBR
#include <Atom/Features/PBR/Lights/IblForward.azsli>
#endif
#include <Atom/Features/PBR/Decals.azsli>
#include <Atom/Features/ColorManagement/TransformColor.azsli>

// Helper function to compute forward lighting output for particles:
ForwardPassOutput ComputeParticleLighting(float3 worldPosition,
float4 position,
#if !PK_O3DE_NEW_LIT
float3 shadowCoords[ViewSrg::MaxCascadeCount],
#endif
float3 vertexNormal,
float3 normal,
float3 tangent,
Expand Down Expand Up @@ -104,11 +91,6 @@ ForwardPassOutput ComputeParticleLighting(float3 worldPosition,
lightingData.Init(surface.position, surface.normal, surface.roughnessLinear);
#endif

#if !PK_O3DE_NEW_LIT
// Directional light shadow coordinates
lightingData.shadowCoords = shadowCoords;
#endif

// ------- Emissive -------

lightingData.emissiveLighting = emissive;
Expand Down Expand Up @@ -138,18 +120,10 @@ ForwardPassOutput ComputeParticleLighting(float3 worldPosition,
ApplyDecals(lightingData.tileIterator, surface);

// Apply Direct Lighting
#if PK_O3DE_NEW_LIT
ApplyDirectLighting(surface, lightingData, position);
#else
ApplyDirectLighting(surface, lightingData);
#endif

// Apply Image Based Lighting (IBL)
#if PK_O3DE_NEW_PBR
ApplyIblForward(surface, lightingData);
#else
ApplyIBL(surface, lightingData);
#endif

// Finalize Lighting
lightingData.FinalizeLighting();
Expand Down
2 changes: 0 additions & 2 deletions Assets/shaders/Common/PopcornOptions.azsli
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@

#pragma once

#define PK_O3DE_NEW_LIT 1
#define PK_O3DE_NEW_PBR 1
#define PK_O3DE_LIT_MULTI_VIEW 0

13 changes: 0 additions & 13 deletions Assets/shaders/Mesh/Legacy/MeshLit_Legacy.azsl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ struct VertexOutput
float2 m_texCoord0 : UV1;
float m_alphaCursor : UV2;
float4 m_clipPosition : UV3;
#if !PK_O3DE_NEW_LIT
float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV4;
#endif
};

VertexOutput MeshVS(VertexInput input)
Expand All @@ -60,13 +57,6 @@ VertexOutput MeshVS(VertexInput input)
float4 vtxWorldPos = mul(mat, float4(input.m_position.xyz, 1));
float3 vtxNormal = mul(mat, input.m_normal.xyz);

#if !PK_O3DE_NEW_LIT
// directional light shadow
const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight;
if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount)
DirectionalLightShadow::GetShadowCoords(shadowIndex, vtxWorldPos, vtxNormal, output.m_shadowCoords);
#endif

// TBN:
float3 vtxTangent = mul(mat, input.m_tangent.xyz);
float3 vtxBitangent = mul(mat, cross(input.m_normal, input.m_tangent.xyz) * -input.m_tangent.w);
Expand Down Expand Up @@ -133,9 +123,6 @@ ForwardPassOutput MeshFS(VertexOutput input, bool isFrontFace : SV_IsFrontFace)
// Compute lighting:
return ComputeParticleLighting( input.m_worldPosition,
input.m_position,
#if !PK_O3DE_NEW_LIT
input.m_shadowCoords,
#endif
vertexNormal,
normal,
tangent,
Expand Down
4 changes: 0 additions & 4 deletions Assets/shaders/Mesh/Legacy/Mesh_Legacy.azsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
#include <viewsrg.srgi>

#include "../../Common/PopcornOptions.azsli"
#if PK_O3DE_NEW_PBR
#include <Atom/Features/Pipeline/Forward/ForwardPassSrg.azsli>
#else
#include <Atom/Features/PBR/ForwardPassSrg.azsli>
#endif

#include "../../Common/MaterialSrg.azsli"
// Renderer:
Expand Down
4 changes: 0 additions & 4 deletions Assets/shaders/Ribbon/Default/RibbonDistortion.azsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
#include <viewsrg.srgi>

#include "../../Common/PopcornOptions.azsli"
#if PK_O3DE_NEW_PBR
#include <Atom/Features/Pipeline/Forward/ForwardPassSrg.azsli>
#else
#include <Atom/Features/PBR/ForwardPassSrg.azsli>
#endif

#include "../../Common/MaterialSrg.azsli"
#include "../../Common/RibbonSrg.azsli"
Expand Down
39 changes: 0 additions & 39 deletions Assets/shaders/Ribbon/Legacy/RibbonLit_Legacy.azsl
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ struct VertexOutput
float3 m_emissiveColor : COLOR1;
float m_alphaCursor : UV2;
float4 m_clipPosition : UV3;
#if !PK_O3DE_NEW_LIT
float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV4;
#endif
};

struct VertexOutputAtlasBlend
Expand All @@ -78,9 +75,6 @@ struct VertexOutputAtlasBlend
float3 m_emissiveColor : COLOR1;
float m_alphaCursor : UV4;
float4 m_clipPosition : UV5;
#if !PK_O3DE_NEW_LIT
float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV6;
#endif
};

struct VertexOutputCorrectDeformation
Expand All @@ -98,9 +92,6 @@ struct VertexOutputCorrectDeformation
float3 m_emissiveColor : COLOR1;
float m_alphaCursor : UV4;
float4 m_clipPosition : UV5;
#if !PK_O3DE_NEW_LIT
float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV6;
#endif
};

VertexOutput RibbonVS(VertexInput input)
Expand Down Expand Up @@ -132,13 +123,6 @@ VertexOutput RibbonVS(VertexInput input)
output.m_bitangent = cross(input.m_tangent.xyz, input.m_normal) * input.m_tangent.w;
output.m_worldPosition = input.m_position.xyz;

#if !PK_O3DE_NEW_LIT
// directional light shadow
const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight;
if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount)
DirectionalLightShadow::GetShadowCoords(shadowIndex, input.m_position.xyz, input.m_normal, output.m_shadowCoords);
#endif

return output;
}

Expand Down Expand Up @@ -174,13 +158,6 @@ VertexOutputAtlasBlend RibbonVS_AtlasBlend(VertexInputAtlasBlend input)
output.m_bitangent = cross(input.m_normal, input.m_tangent.xyz) * input.m_tangent.w;
output.m_worldPosition = input.m_position.xyz;

#if !PK_O3DE_NEW_LIT
// directional light shadow
const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight;
if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount)
DirectionalLightShadow::GetShadowCoords(shadowIndex, input.m_position.xyz, input.m_normal, output.m_shadowCoords);
#endif

return output;
}

Expand Down Expand Up @@ -216,13 +193,6 @@ VertexOutputCorrectDeformation RibbonVS_CorrectDeformation(VertexInputCorrectDef
output.m_bitangent = cross(input.m_normal, input.m_tangent.xyz) * input.m_tangent.w;
output.m_worldPosition = input.m_position.xyz;

#if !PK_O3DE_NEW_LIT
// directional light shadow
const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight;
if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount)
DirectionalLightShadow::GetShadowCoords(shadowIndex, input.m_position.xyz, input.m_normal, output.m_shadowCoords);
#endif

return output;
}

Expand Down Expand Up @@ -267,9 +237,6 @@ ForwardPassOutput RibbonFS(VertexOutput input, bool isFrontFace : SV_IsFrontFace
// Compute lighting:
return ComputeParticleLighting( input.m_worldPosition,
input.m_position,
#if !PK_O3DE_NEW_LIT
input.m_shadowCoords,
#endif
vertexNormal,
normal,
tangent,
Expand Down Expand Up @@ -327,9 +294,6 @@ ForwardPassOutput RibbonFS_AtlasBlend(VertexOutputAtlasBlend input, bool isFront
// Compute lighting:
return ComputeParticleLighting( input.m_worldPosition,
input.m_position,
#if !PK_O3DE_NEW_LIT
input.m_shadowCoords,
#endif
vertexNormal,
normal,
tangent,
Expand Down Expand Up @@ -378,9 +342,6 @@ ForwardPassOutput RibbonFS_CorrectDeformation(VertexOutputCorrectDeformation inp
// Compute lighting:
return ComputeParticleLighting( input.m_worldPosition,
input.m_position,
#if !PK_O3DE_NEW_LIT
input.m_shadowCoords,
#endif
vertexNormal,
normal,
tangent,
Expand Down
4 changes: 0 additions & 4 deletions Assets/shaders/Ribbon/Legacy/Ribbon_Legacy.azsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
#include <viewsrg.srgi>

#include "../../Common/PopcornOptions.azsli"
#if PK_O3DE_NEW_PBR
#include <Atom/Features/Pipeline/Forward/ForwardPassSrg.azsli>
#else
#include <Atom/Features/PBR/ForwardPassSrg.azsli>
#endif

#include "../../Common/MaterialSrg.azsli"
#include "../../Common/RibbonSrg.azsli"
Expand Down
Loading

0 comments on commit 4212d65

Please sign in to comment.