/// <summary> /// Reverse Renderer /// </summary> /// <param name="Source"></param> /// <param name="op"></param> public ReverseRender(RenderStep Source, ReverseOperation op) : base() { //Set RenderSteps SourceRender = Source; Operation = op; //Set Prefab Shader Engine.Core.SetPrefabShader(Shader.ID, Engine.Core.Prefab_Shader_Reverse); }
/// <summary> /// Convolution Render Constructor /// </summary> /// <param name="source">Source RenderStep</param> /// <param name="mat3x3">3x3 Convolution Matrix</param> /// <param name="coef">Convolution Coef</param> public ConvolutionRender(RenderStep source, float[,] mat3x3, float coef) { //Set Prefab Shader Engine.Core.SetPrefabShader(Shader.ID, Engine.Core.Prefab_Shader_Conv); SourceRender = source; ConvMatrix = mat3x3; ConvCoef = coef; }
/// <summary> /// Mix Render Constructor /// </summary> /// <param name="rs1">First Render Step</param> /// <param name="rs2">Second Render Step</param> public MixRender(RenderStep rsA, RenderStep rsB, MixOperation op) : base() { //Set RenderSteps First = rsA; Second = rsB; Operation = op; //Set Prefab Shader Engine.Core.SetPrefabShader(Shader.ID, Engine.Core.Prefab_Shader_Mix); }
/// <summary> /// Convolution Render /// </summary> /// <param name="source">Source RenderStep</param> /// <param name="mat">4x4 Matrix, 3x3 Convolution Matrix and the coef at the bottom left</param> public ConvolutionRender(RenderStep source, Matrix4x4 mat) : base() { //Set Prefab Shader Engine.Core.SetPrefabShader(Shader.ID, Engine.Core.Prefab_Shader_Conv); SourceRender = source; ConvMatrix = new float[3, 3] { { mat.M11, mat.M12, mat.M13 }, { mat.M21, mat.M22, mat.M23 }, { mat.M31, mat.M32, mat.M33 } }; ConvCoef = mat.M44; }
/// <summary> /// Add a Blur FX on Edges /// </summary> /// <param name="Start"></param> /// <param name="ListOfRenderStep"></param> public static void EdgeBlurFX(RenderStep Start, List <RenderStep> ListOfRenderStep) { //Edge Detector ConvolutionRender edge_detect = new ConvolutionRender(Start, new float[3, 3] { { -1, -1, -1 }, { -1, 8, -1 }, { -1, -1, -1 } }, 1); ListOfRenderStep.Add(edge_detect); //Blur Edge ConvolutionRender blur_edge = new ConvolutionRender(edge_detect, new float[3, 3] { { 1, 2, 1 }, { 2, 4, 2 }, { 1, 2, 1 } }, 1.0f / 16.0f); ListOfRenderStep.Add(blur_edge); }
/// <summary> /// Select the Render Step result to show /// </summary> /// <param name="st">RenderStep</param> public void Show(RenderStep st) { m_show = st; }