Skip to content

Commit

Permalink
update test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Keijiro Takahashi authored and Keijiro Takahashi committed Oct 22, 2015
1 parent 9992f43 commit c91887f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 130 deletions.
29 changes: 16 additions & 13 deletions Assets/FilterTest.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
using UnityEngine;
using System.Collections;

[ExecuteInEditMode]
public class FilterTest : MonoBehaviour
{
[SerializeField] Shader _shader;
enum DownSampleMode { Off, Half, Quarter }

public Texture2D baseTexture;
[SerializeField, HideInInspector]
Shader _shader;

public enum DownSampleMode { Off, Half, Quarter }
public DownSampleMode downSampleMode;
[SerializeField]
Texture2D _baseTexture;

[Range(0, 8)]
public int iteration = 1;
[SerializeField]
DownSampleMode _downSampleMode = DownSampleMode.Quarter;

[SerializeField, Range(0, 8)]
int _iteration = 4;

Material _material;

Expand All @@ -26,26 +29,26 @@ void OnRenderImage(RenderTexture source, RenderTexture destination)

RenderTexture rt1, rt2;

if (downSampleMode == DownSampleMode.Half)
if (_downSampleMode == DownSampleMode.Half)
{
rt1 = RenderTexture.GetTemporary(source.width / 2, source.height / 2);
rt2 = RenderTexture.GetTemporary(source.width / 2, source.height / 2);
Graphics.Blit(baseTexture, rt1);
Graphics.Blit(_baseTexture, rt1);
}
else if (downSampleMode == DownSampleMode.Quarter)
else if (_downSampleMode == DownSampleMode.Quarter)
{
rt1 = RenderTexture.GetTemporary(source.width / 4, source.height / 4);
rt2 = RenderTexture.GetTemporary(source.width / 4, source.height / 4);
Graphics.Blit(baseTexture, rt1, _material, 0);
Graphics.Blit(_baseTexture, rt1, _material, 0);
}
else
{
rt1 = RenderTexture.GetTemporary(source.width, source.height);
rt2 = RenderTexture.GetTemporary(source.width, source.height);
Graphics.Blit(baseTexture, rt1);
Graphics.Blit(_baseTexture, rt1);
}

for (var i = 0; i < iteration; i++)
for (var i = 0; i < _iteration; i++)
{
Graphics.Blit(rt1, rt2, _material, 1);
Graphics.Blit(rt2, rt1, _material, 2);
Expand Down
6 changes: 5 additions & 1 deletion Assets/FilterTest.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Assets/Test.unity
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_shader: {fileID: 4800000, guid: d15acd61a013b49a78ee24b8be44c1b0, type: 3}
baseTexture: {fileID: 2800000, guid: 3269ccfaba1474cad82f0f07b6651c7e, type: 3}
downSampleMode: 2
iteration: 4
_baseTexture: {fileID: 2800000, guid: 3269ccfaba1474cad82f0f07b6651c7e, type: 3}
_downSampleMode: 2
_iteration: 4
137 changes: 24 additions & 113 deletions ProjectSettings/QualitySettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,8 @@
QualitySettings:
m_ObjectHideFlags: 0
serializedVersion: 5
m_CurrentQuality: 3
m_CurrentQuality: 0
m_QualitySettings:
- serializedVersion: 2
name: Fastest
pixelLightCount: 0
shadows: 0
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 15
blendWeights: 1
textureQuality: 1
anisotropicTextures: 0
antiAliasing: 0
softParticles: 0
softVegetation: 0
vSyncCount: 0
lodBias: .300000012
maximumLODLevel: 0
particleRaycastBudget: 4
excludedTargetPlatforms: []
- serializedVersion: 2
name: Fast
pixelLightCount: 0
shadows: 0
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 20
blendWeights: 2
textureQuality: 0
anisotropicTextures: 0
antiAliasing: 0
softParticles: 0
softVegetation: 0
vSyncCount: 0
lodBias: .400000006
maximumLODLevel: 0
particleRaycastBudget: 16
excludedTargetPlatforms: []
- serializedVersion: 2
name: Simple
pixelLightCount: 1
shadows: 1
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 20
blendWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
softParticles: 0
softVegetation: 0
vSyncCount: 0
lodBias: .699999988
maximumLODLevel: 0
particleRaycastBudget: 64
excludedTargetPlatforms: []
- serializedVersion: 2
name: Good
pixelLightCount: 2
Expand All @@ -71,70 +14,38 @@ QualitySettings:
shadowProjection: 1
shadowCascades: 2
shadowDistance: 40
shadowNearPlaneOffset: 2
shadowCascade2Split: .333333343
shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669}
blendWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
softParticles: 0
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 1
maximumLODLevel: 0
particleRaycastBudget: 256
excludedTargetPlatforms: []
- serializedVersion: 2
name: Beautiful
pixelLightCount: 3
shadows: 2
shadowResolution: 2
shadowProjection: 1
shadowCascades: 2
shadowDistance: 70
blendWeights: 4
textureQuality: 0
anisotropicTextures: 2
antiAliasing: 2
softParticles: 1
softVegetation: 1
vSyncCount: 1
lodBias: 1.5
maximumLODLevel: 0
particleRaycastBudget: 1024
excludedTargetPlatforms: []
- serializedVersion: 2
name: Fantastic
pixelLightCount: 4
shadows: 2
shadowResolution: 2
shadowProjection: 1
shadowCascades: 4
shadowDistance: 150
blendWeights: 4
textureQuality: 0
anisotropicTextures: 2
antiAliasing: 2
softParticles: 1
softVegetation: 1
vSyncCount: 1
lodBias: 2
maximumLODLevel: 0
particleRaycastBudget: 4096
excludedTargetPlatforms: []
m_PerPlatformDefaultQuality:
Android: 2
BlackBerry: 2
FlashPlayer: 3
GLES Emulation: 3
PS3: 3
PS4: 3
PSM: 3
PSP2: 3
Samsung TV: 2
Standalone: 3
Tizen: 2
WP8: 3
Web: 3
Windows Store Apps: 3
XBOX360: 3
XboxOne: 3
iPhone: 2
Android: 0
BlackBerry: 0
FlashPlayer: 0
GLES Emulation: 0
PS3: 0
PS4: 0
PSM: 0
PSP2: 0
Samsung TV: 0
Standalone: 0
Tizen: 0
WP8: 0
Web: 0
WebGL: 0
Windows Store Apps: 0
XBOX360: 0
XboxOne: 0
iPhone: 0

0 comments on commit c91887f

Please sign in to comment.