forked from Unity-Technologies/Graphics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
498 changed files
with
10,577 additions
and
10,610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ts/RenderPipeline/LightweightPipeline/Scenes/010_MultiplePointLights/Scripts/Boomerang.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System.Collections; | ||
using System.Collections; | ||
using UnityEngine; | ||
|
||
public class Boomerang : MonoBehaviour | ||
|
2 changes: 1 addition & 1 deletion
2
...RenderPipeline/LightweightPipeline/Scenes/010_MultiplePointLights/Scripts/RotateAround.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System.Collections; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
|
55 changes: 29 additions & 26 deletions
55
...erPipeline/LightweightPipeline/Scenes/013_CameraMulti_Splitscreen/Scripts/AutoSizeGrid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,38 @@ | ||
using System.Collections; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
[ExecuteInEditMode] | ||
public class AutoSizeGrid : MonoBehaviour { | ||
public class AutoSizeGrid : MonoBehaviour | ||
{ | ||
public GridLayoutGroup layout; | ||
public bool dynamic = false; | ||
private int rows = 2; | ||
private int columns = 2; | ||
|
||
public GridLayoutGroup layout; | ||
public bool dynamic = false; | ||
private int rows = 2; | ||
private int columns = 2; | ||
// Use this for initialization | ||
void Start() | ||
{ | ||
SetCellSize(); | ||
} | ||
|
||
// Use this for initialization | ||
void Start () { | ||
SetCellSize (); | ||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
#if UNITY_EDITOR | ||
SetCellSize (); | ||
#else | ||
if(dynamic){ | ||
SetCellSize (); | ||
} | ||
#endif | ||
} | ||
|
||
void SetCellSize(){ | ||
Vector2 vec = new Vector2 (Screen.width / columns, Screen.height / rows); | ||
layout.cellSize = vec / transform.parent.localScale.x; | ||
} | ||
// Update is called once per frame | ||
void Update() | ||
{ | ||
#if UNITY_EDITOR | ||
SetCellSize(); | ||
#else | ||
if (dynamic) | ||
{ | ||
SetCellSize(); | ||
} | ||
#endif | ||
} | ||
|
||
void SetCellSize() | ||
{ | ||
Vector2 vec = new Vector2(Screen.width / columns, Screen.height / rows); | ||
layout.cellSize = vec / transform.parent.localScale.x; | ||
} | ||
} |
41 changes: 21 additions & 20 deletions
41
...erPipeline/LightweightPipeline/Scenes/028_PostProcessing_Custom/Scripts/HalfToneOpaque.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
using System; | ||
using System; | ||
using UnityEngine; | ||
using UnityEngine.Rendering.PostProcessing; | ||
|
||
[Serializable] | ||
[PostProcess(typeof(HalfToneOpaqueRenderer), PostProcessEvent.BeforeStack, "Custom/LWtest/Haltone Opaque")] | ||
public sealed class HalfToneOpaque : PostProcessEffectSettings { | ||
[Range(-2f, 2f), Tooltip("Pattern Midpoint")] | ||
public FloatParameter midpoint = new FloatParameter{ value = 0f }; | ||
[Range(0.001f, 0.1f), Tooltip("Pattern Scale")] | ||
public FloatParameter scale = new FloatParameter{ value = 0.025f }; | ||
[Range(1, 10), Tooltip("Steps")] | ||
public IntParameter steps = new IntParameter{ value = 4}; | ||
public TextureParameter pattern = new TextureParameter{ value = null}; | ||
public sealed class HalfToneOpaque : PostProcessEffectSettings | ||
{ | ||
[Range(-2f, 2f), Tooltip("Pattern Midpoint")] | ||
public FloatParameter midpoint = new FloatParameter { value = 0f }; | ||
[Range(0.001f, 0.1f), Tooltip("Pattern Scale")] | ||
public FloatParameter scale = new FloatParameter { value = 0.025f }; | ||
[Range(1, 10), Tooltip("Steps")] | ||
public IntParameter steps = new IntParameter { value = 4}; | ||
public TextureParameter pattern = new TextureParameter { value = null}; | ||
} | ||
|
||
public sealed class HalfToneOpaqueRenderer : PostProcessEffectRenderer<HalfToneOpaque> { | ||
|
||
public override void Render(PostProcessRenderContext context){ | ||
var sheet = context.propertySheets.Get(Shader.Find("Hidden/Custom/LWtest/HalftoneOpaque")); | ||
sheet.properties.SetTexture ("_Pattern", settings.pattern); | ||
sheet.properties.SetFloat("_Blend", settings.midpoint); | ||
sheet.properties.SetFloat("_Scale", settings.scale); | ||
sheet.properties.SetFloat("_Steps", settings.steps); | ||
context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0); | ||
} | ||
|
||
public sealed class HalfToneOpaqueRenderer : PostProcessEffectRenderer<HalfToneOpaque> | ||
{ | ||
public override void Render(PostProcessRenderContext context) | ||
{ | ||
var sheet = context.propertySheets.Get(Shader.Find("Hidden/Custom/LWtest/HalftoneOpaque")); | ||
sheet.properties.SetTexture("_Pattern", settings.pattern); | ||
sheet.properties.SetFloat("_Blend", settings.midpoint); | ||
sheet.properties.SetFloat("_Scale", settings.scale); | ||
sheet.properties.SetFloat("_Steps", settings.steps); | ||
context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 10 additions & 9 deletions
19
...nderPipeline/LightweightPipeline/Scenes/028_PostProcessing_Custom/Scripts/InvertOpaque.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
using System; | ||
using System; | ||
using UnityEngine; | ||
using UnityEngine.Rendering.PostProcessing; | ||
|
||
[Serializable] | ||
[PostProcess(typeof(InvertOpaqueRenderer), PostProcessEvent.BeforeTransparent, "Custom/LWtest/Invert Opaque")] | ||
public sealed class InvertOpaque : PostProcessEffectSettings { | ||
public sealed class InvertOpaque : PostProcessEffectSettings | ||
{ | ||
public BoolParameter enable = new BoolParameter(); | ||
} | ||
|
||
public sealed class InvertOpaqueRenderer : PostProcessEffectRenderer<InvertOpaque> { | ||
|
||
public override void Render(PostProcessRenderContext context){ | ||
var sheet = context.propertySheets.Get(Shader.Find("Hidden/Custom/LWtest/InvertOpaque")); | ||
context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0); | ||
} | ||
|
||
public sealed class InvertOpaqueRenderer : PostProcessEffectRenderer<InvertOpaque> | ||
{ | ||
public override void Render(PostProcessRenderContext context) | ||
{ | ||
var sheet = context.propertySheets.Get(Shader.Find("Hidden/Custom/LWtest/InvertOpaque")); | ||
context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...Pipeline/LightweightPipeline/Scenes/028_PostProcessing_Custom/Scripts/InvertOpaque.shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 12 additions & 10 deletions
22
...ests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/029_Particles/PlaySystems.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
using System.Collections; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
[ExecuteInEditMode] | ||
public class PlaySystems : MonoBehaviour { | ||
|
||
public class PlaySystems : MonoBehaviour | ||
{ | ||
public ParticleSystem[] particleSystems; | ||
[Range(0, 1)] | ||
[Range(0, 1)] | ||
public float simPoint = 0.5f; | ||
void OnEnable () { | ||
foreach(ParticleSystem ps in particleSystems){ | ||
void OnEnable() | ||
{ | ||
foreach (ParticleSystem ps in particleSystems) | ||
{ | ||
if (ps != null) | ||
{ | ||
float life = ps.main.duration * simPoint; | ||
ps.Simulate(life, true, true, false); | ||
} | ||
} | ||
} | ||
} | ||
|
||
void OnDisable() | ||
void OnDisable() | ||
{ | ||
foreach (ParticleSystem ps in particleSystems) | ||
{ | ||
if(ps != null) | ||
ps.Stop(); | ||
if (ps != null) | ||
ps.Stop(); | ||
} | ||
} | ||
} |
Oops, something went wrong.