From be6054b3d155b92506b5aded751b8b8f18772761 Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Wed, 16 Oct 2019 19:23:32 +0100 Subject: [PATCH] Shaderdata new->singleton --- .../game/core/gameObjects/materials/materials.cs | 4 ++-- .../lighting/scripts/advancedLighting_Shaders.cs | 12 ++++++------ .../game/core/lighting/scripts/deferredShading.cs | 2 +- .../game/core/lighting/scripts/shadowMaps_Init.cs | 2 +- .../game/core/rendering/scripts/gfxData/shaders.cs | 6 +++--- .../worldEditor/scripts/visibility/lightViz.cs | 14 +++++++------- .../worldEditor/scripts/visibility/miscViz.cs | 8 ++++---- .../worldEditor/scripts/visibility/shadowViz.cs | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Templates/BaseGame/game/core/gameObjects/materials/materials.cs b/Templates/BaseGame/game/core/gameObjects/materials/materials.cs index 9ea6fa1bd..af1f49cf7 100644 --- a/Templates/BaseGame/game/core/gameObjects/materials/materials.cs +++ b/Templates/BaseGame/game/core/gameObjects/materials/materials.cs @@ -1,4 +1,4 @@ -new ShaderData( BasicRibbonShader ) +singleton ShaderData( BasicRibbonShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderP.hlsl"; @@ -26,7 +26,7 @@ singleton CustomMaterial( BasicRibbonMat ) preload = true; }; -new ShaderData( TexturedRibbonShader ) +singleton ShaderData( TexturedRibbonShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderP.hlsl"; diff --git a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs index bc70856ad..8ccb8a517 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs @@ -61,7 +61,7 @@ new GFXStateBlockData( AL_VectorLightState ) }; // Vector Light Material -new ShaderData( AL_VectorLightShader ) +singleton shaderData( AL_VectorLightShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/farFrustumQuadV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/vectorLightP.hlsl"; @@ -140,7 +140,7 @@ new GFXStateBlockData( AL_ConvexLightState ) }; // Point Light Material -new ShaderData( AL_PointLightShader ) +singleton shaderData( AL_PointLightShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/convexGeometryV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/pointLightP.hlsl"; @@ -179,7 +179,7 @@ new CustomMaterial( AL_PointLightMaterial ) }; // Spot Light Material -new ShaderData( AL_SpotLightShader ) +singleton shaderData( AL_SpotLightShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/convexGeometryV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/spotLightP.hlsl"; @@ -256,7 +256,7 @@ new Material( AL_DefaultShadowMaterial ) }; // Particle System Point Light Material -new ShaderData( AL_ParticlePointLightShader ) +singleton shaderData( AL_ParticlePointLightShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/particlePointLightV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/particlePointLightP.hlsl"; @@ -281,7 +281,7 @@ new CustomMaterial( AL_ParticlePointLightMaterial ) }; //Probe Processing -new ShaderData( IrradianceShader ) +singleton shaderData( IrradianceShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/cubemapV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/irradianceP.hlsl"; @@ -294,7 +294,7 @@ new ShaderData( IrradianceShader ) pixVersion = 3.0; }; -new ShaderData( PrefiterCubemapShader ) +singleton shaderData( PrefiterCubemapShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/cubemapV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/prefilterP.hlsl"; diff --git a/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs b/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs index eb6afe74c..d0631fc50 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs @@ -27,7 +27,7 @@ new GFXStateBlockData( AL_DeferredCaptureState : PFX_DefaultStateBlock ) samplerStates[4] = SamplerWrapLinear; }; -new ShaderData( AL_ProbeShader ) +singleton shaderData( AL_ProbeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/probeShadingP.hlsl"; diff --git a/Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs b/Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs index f4875bf08..f1e9f175c 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs @@ -21,7 +21,7 @@ //----------------------------------------------------------------------------- -new ShaderData(BlurDepthShader) +singleton shaderData(BlurDepthShader) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/shadowMap/boxFilterV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/shadowMap/boxFilterP.hlsl"; diff --git a/Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs index da3b7c864..6a2981fa9 100644 --- a/Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs +++ b/Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs @@ -57,7 +57,7 @@ singleton ShaderData( OffscreenParticleCompositeShaderData ) //----------------------------------------------------------------------------- // Planar Reflection //----------------------------------------------------------------------------- -new ShaderData( ReflectBump ) +singleton shaderData( ReflectBump ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/planarReflectBumpV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/planarReflectBumpP.hlsl"; @@ -72,7 +72,7 @@ new ShaderData( ReflectBump ) pixVersion = 2.0; }; -new ShaderData( Reflect ) +singleton shaderData( Reflect ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/planarReflectV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/planarReflectP.hlsl"; @@ -89,7 +89,7 @@ new ShaderData( Reflect ) //----------------------------------------------------------------------------- // fxFoliageReplicator //----------------------------------------------------------------------------- -new ShaderData( fxFoliageReplicatorShader ) +singleton shaderData( fxFoliageReplicatorShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/fxFoliageReplicatorV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/fxFoliageReplicatorP.hlsl"; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs index 2edfa2898..913e19f95 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs @@ -20,7 +20,7 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- // Debug Shaders. -new ShaderData( AL_ColorBufferShader ) +singleton shaderData( AL_ColorBufferShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgColorBufferP.hlsl"; @@ -59,7 +59,7 @@ function toggleColorBufferViz( %enable ) } } -new ShaderData( AL_SpecMapShader ) +singleton shaderData( AL_SpecMapShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgSpecMapVisualizeP.hlsl"; @@ -121,7 +121,7 @@ new GFXStateBlockData( AL_DefaultVisualizeState ) samplerStates[1] = SamplerClampLinear; // depthviz }; -new ShaderData( AL_DepthVisualizeShader ) +singleton shaderData( AL_DepthVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgDepthVisualizeP.hlsl"; @@ -157,7 +157,7 @@ function AL_DepthVisualize::onEnabled( %this ) return true; } -new ShaderData( AL_GlowVisualizeShader ) +singleton shaderData( AL_GlowVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgGlowVisualizeP.hlsl"; @@ -178,7 +178,7 @@ singleton PostEffect( AL_GlowVisualize ) renderPriority = 9999; }; -new ShaderData( AL_NormalsVisualizeShader ) +singleton shaderData( AL_NormalsVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgNormalVisualizeP.hlsl"; @@ -214,7 +214,7 @@ function AL_NormalsVisualize::onEnabled( %this ) -new ShaderData( AL_LightColorVisualizeShader ) +singleton shaderData( AL_LightColorVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgLightColorVisualizeP.hlsl"; @@ -249,7 +249,7 @@ function AL_LightColorVisualize::onEnabled( %this ) } -new ShaderData( AL_LightSpecularVisualizeShader ) +singleton shaderData( AL_LightSpecularVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgLightSpecularVisualizeP.hlsl"; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs index 3bb990019..5fc159ce7 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs @@ -39,7 +39,7 @@ new GFXStateBlockData( Viz_DefaultVisualizeState ) samplerStates[4] = SamplerClampLinear; // depthviz }; -new ShaderData( Viz_TexelDensity ) +singleton shaderData( Viz_TexelDensity ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/Viz_TexelDensityP.hlsl"; @@ -79,7 +79,7 @@ function toggleTexelDensityViz( %enable ) // // -new ShaderData( Viz_SurfaceProperties ) +singleton shaderData( Viz_SurfaceProperties ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/Viz_SurfacePropertiesP.hlsl"; @@ -203,7 +203,7 @@ function Viz_SurfacePropertiesPFX::onEnabled( %this ) // // // -new ShaderData( Viz_ColorBlindness ) +singleton shaderData( Viz_ColorBlindness ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/Viz_ColorblindnessP.hlsl"; @@ -307,7 +307,7 @@ function Viz_ColorBlindnessPFX::onEnabled( %this ) // //Material Complexity Viz -new ShaderData( Viz_MaterialComplexity ) +singleton shaderData( Viz_MaterialComplexity ) { DXVertexShaderFile = "./shaders/Viz_materialComplexityV.hlsl"; DXPixelShaderFile = "./shaders/Viz_materialComplexityP.hlsl"; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.cs index 1bfa88488..bb07ba596 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.cs @@ -20,7 +20,7 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -new ShaderData( AL_ShadowVisualizeShader ) +singleton shaderData( AL_ShadowVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/guiMaterialV.hlsl"; DXPixelShaderFile = "./shaders/dbgShadowVisualizeP.hlsl";