Skip to content

Commit

Permalink
Updates for PR, contributors and curly braces.
Browse files Browse the repository at this point in the history
  • Loading branch information
herocrab committed Apr 6, 2021
1 parent bf7f771 commit 8fc14e0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Xenko contributors (https://xenko.com) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Copyright (c) Stride contributors (https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.

using System;
Expand All @@ -11,7 +11,8 @@ namespace Stride.Rendering.Images {
/// A fog filter.
/// </summary>
[DataContract("Outline")]
public class Outline : ImageEffect {
public class Outline : ImageEffect
{
private readonly ImageEffectShader outlineFilter;
private Texture depthTexture;
private float zMin, zMax;
Expand All @@ -20,7 +21,8 @@ public class Outline : ImageEffect {
/// Initializes a new instance of the <see cref="Outline"/> class.
/// </summary>
public Outline()
: this("OutlineEffect") {
: this("OutlineEffect")
{
}

[DataMember(10)]
Expand All @@ -36,12 +38,14 @@ public Outline()
/// Initializes a new instance of the <see cref="Outline"/> class.
/// </summary>
/// <param name="shaderName">Name of the outline shader.</param>
public Outline(string shaderName) : base(shaderName) {
public Outline(string shaderName) : base(shaderName)
{
if (shaderName == null) throw new ArgumentNullException("outlineFilterName");
outlineFilter = new ImageEffectShader(shaderName);
}

protected override void InitializeCore() {
protected override void InitializeCore()
{
base.InitializeCore();
ToLoadAndUnload(outlineFilter);
}
Expand All @@ -51,24 +55,28 @@ protected override void InitializeCore() {
/// </summary>
/// <param name="colorBuffer">A color buffer to process.</param>
/// <param name="depthBuffer">The depth buffer corresponding to the color buffer provided.</param>
public void SetColorDepthInput(Texture colorBuffer, Texture depthBuffer, float zMin, float zMax) {
public void SetColorDepthInput(Texture colorBuffer, Texture depthBuffer, float zMin, float zMax)
{
SetInput(0, colorBuffer);
depthTexture = depthBuffer;
this.zMin = zMin;
this.zMax = zMax;
}

protected override void SetDefaultParameters() {
protected override void SetDefaultParameters()
{
NormalWeight = 2f;
DepthWeight = 0.2f;
NormalNearCutoff = 0.1f;
base.SetDefaultParameters();
}

protected override void DrawCore(RenderDrawContext context) {
protected override void DrawCore(RenderDrawContext context)
{
Texture color = GetInput(0);
Texture output = GetOutput(0);
if (color == null || output == null || depthTexture == null) {
if (color == null || output == null || depthTexture == null)
{
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// <auto-generated>
// Do not edit this file yourself!
//
// This code was generated by Xenko Shader Mixin Code Generator.
// To generate it yourself, please install Xenko.VisualStudio.Package .vsix
// and re-save the associated .xkfx.
// This code was generated by Stride Shader Mixin Code Generator.
// To generate it yourself, please install Stride.VisualStudio.Package .vsix
// and re-save the associated .sdfx
// </auto-generated>

using Stride.Graphics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Stride.Graphics;
using Stride.Rendering.Compositing;
using Stride.Rendering.Materials;
using Stride.Rendering.SubsurfaceScattering;

namespace Stride.Rendering.Images
{
Expand Down Expand Up @@ -39,7 +38,11 @@ public PostProcessingEffects(IServiceRegistry services)
/// </summary>
public PostProcessingEffects()
{
Outline = new Outline {Enabled = false};
Outline = new Outline
{
Enabled = false
};

AmbientOcclusion = new AmbientOcclusion();
LocalReflections = new LocalReflections();
DepthOfField = new DepthOfField();
Expand Down

0 comments on commit 8fc14e0

Please sign in to comment.