stride/samples/Particles/ParticlesSample/ParticlesSample.Game/Effects/ParticleCustomEffect.sdfx

33 lines
1.3 KiB
Text
Raw Permalink Normal View History

2021-04-19 03:49:55 +00:00
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
2018-06-19 09:06:54 +00:00
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
2020-04-14 14:37:41 +00:00
namespace Stride.Rendering
2018-06-19 09:06:54 +00:00
{
partial effect ParticleCustomEffect
{
// Use the ParticleBaseKeys for constant attributes, defined in the game engine
using params ParticleBaseKeys;
// Use the ParticleCustomShaderKeys for constant attributes, defined in this project
using params ParticleCustomShaderKeys;
2020-04-14 14:37:41 +00:00
// Inherit from the ParticleBaseEffect.sdfx, defined in the game engine
2018-06-19 09:06:54 +00:00
mixin ParticleBaseEffect;
2020-04-14 14:37:41 +00:00
// Use the ParticleCustomShader.sdsl, defined in this project
2018-06-19 09:06:54 +00:00
mixin ParticleCustomShader;
// If the user-defined effect for the baseColor is not null use it
if (ParticleCustomShaderKeys.BaseColor != null)
{
mixin compose baseColor = ParticleCustomShaderKeys.BaseColor;
}
// If the user-defined effect for the baseIntensity (alpha) is not null use it
if (ParticleCustomShaderKeys.BaseIntensity != null)
{
mixin compose baseIntensity = ParticleCustomShaderKeys.BaseIntensity;
}
};
}