Skip to content
Browse files

Added shader-based animation test.

  • Loading branch information...
1 parent 24072f1 commit 285ea76e0b5b9c8f36afe797bd6c79b4b9f6da73 @keijiro committed
View
30 Assets/AnimatedChecker.mat
@@ -0,0 +1,30 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 3
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_Name: AnimatedChecker
+ m_Shader: {fileID: 4800000, guid: e8f2b1396f82545b6bbc4971cca5eee0, type: 1}
+ m_SavedProperties:
+ serializedVersion: 2
+ m_TexEnvs:
+ data:
+ first:
+ name: _MainTex
+ second:
+ m_Texture: {fileID: 2800000, guid: 6ef7573014e9541f4b52611a2c37cab0, type: 1}
+ m_Scale: {x: 4, y: 4}
+ m_Offset: {x: 0, y: 0}
+ m_Floats: {}
+ m_Colors:
+ data:
+ first:
+ name: _ParamsA
+ second: {r: 6, g: 2, b: .119999997, a: 0}
+ data:
+ first:
+ name: _ParamsB
+ second: {r: 12, g: 10, b: .0299999993, a: 0}
View
2 Assets/AnimatedChecker.mat.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 782314b0ead9c415a9ec8b0bcafd7c4d
View
4 Assets/ScriptBasedMeshAnimation.js
@@ -3,10 +3,6 @@
@script RequireComponent(MeshFilter)
@script RequireComponent(MeshRenderer)
-function Awake() {
- Application.targetFrameRate = 60.0;
-}
-
var waveParams = [6.0, 2.0, 0.12, 12.0, 10.0, 0.03];
function Update() {
View
17 Assets/ScriptBasedMeshAnimation.unity
@@ -19,7 +19,7 @@ RenderSettings:
m_FogDensity: .00999999978
m_LinearFogStart: 0
m_LinearFogEnd: 300
- m_AmbientLight: {r: .200000003, g: .200000003, b: .200000003, a: 1}
+ m_AmbientLight: {r: 0, g: 0, b: 0, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: .5
m_FlareStrength: 1
@@ -85,6 +85,7 @@ GameObject:
- 33: {fileID: 674035587}
- 23: {fileID: 674035586}
- 114: {fileID: 674035588}
+ - 114: {fileID: 674035589}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
@@ -148,6 +149,16 @@ MonoBehaviour:
- 12
- 10
- .0299999993
+--- !u!114 &674035589
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 674035584}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 041d7ab368ef046df984396f184bada8, type: 1}
+ m_Name:
--- !u!1 &1900351364
GameObject:
m_ObjectHideFlags: 0
@@ -198,10 +209,10 @@ Transform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1912743918}
- m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381676, w: .875426054}
+ m_LocalRotation: {x: .707106829, y: 0, z: 0, w: .707106709}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
- m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
+ m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
--- !u!108 &1912743920
View
6 Assets/SetFrameRate.js
@@ -0,0 +1,6 @@
+#pragma strict
+
+function Awake() {
+ Application.targetFrameRate = 60.0;
+
+}
View
7 Assets/SetFrameRate.js.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 041d7ab368ef046df984396f184bada8
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
314 Assets/ShaderBasedMeshAnimation.unity
@@ -0,0 +1,314 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!29 &1
+Scene:
+ m_ObjectHideFlags: 0
+ m_PVSData:
+ m_QueryMode: 1
+ m_PVSObjectsArray: []
+ m_PVSPortalsArray: []
+ m_OcclusionBakeSettings:
+ viewCellSize: 1
+ bakeMode: 2
+ memoryUsage: 10485760
+--- !u!104 &2
+RenderSettings:
+ m_Fog: 0
+ m_FogColor: {r: .5, g: .5, b: .5, a: 1}
+ m_FogMode: 3
+ m_FogDensity: .00999999978
+ m_LinearFogStart: 0
+ m_LinearFogEnd: 300
+ m_AmbientLight: {r: 0, g: 0, b: 0, a: 1}
+ m_SkyboxMaterial: {fileID: 0}
+ m_HaloStrength: .5
+ m_FlareStrength: 1
+ m_HaloTexture: {fileID: 0}
+ m_SpotCookie: {fileID: 0}
+ m_ObjectHideFlags: 0
+--- !u!127 &3
+GameManager:
+ m_ObjectHideFlags: 0
+--- !u!157 &4
+LightmapSettings:
+ m_ObjectHideFlags: 0
+ m_LightProbes: {fileID: 0}
+ m_Lightmaps: []
+ m_LightmapsMode: 1
+ m_BakedColorSpace: 0
+ m_UseDualLightmapsInForward: 0
+ m_LightmapEditorSettings:
+ m_Resolution: 50
+ m_LastUsedResolution: 0
+ m_TextureWidth: 1024
+ m_TextureHeight: 1024
+ m_BounceBoost: 1
+ m_BounceIntensity: 1
+ m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1}
+ m_SkyLightIntensity: 0
+ m_Quality: 0
+ m_Bounces: 1
+ m_FinalGatherRays: 1000
+ m_FinalGatherContrastThreshold: .0500000007
+ m_FinalGatherGradientThreshold: 0
+ m_FinalGatherInterpolationPoints: 15
+ m_AOAmount: 0
+ m_AOMaxDistance: .100000001
+ m_AOContrast: 1
+ m_LODSurfaceMappingDistance: 1
+ m_Padding: 0
+ m_TextureCompression: 0
+ m_LockAtlas: 0
+--- !u!196 &5
+NavMeshSettings:
+ m_ObjectHideFlags: 0
+ m_BuildSettings:
+ agentRadius: .5
+ agentHeight: 2
+ agentSlope: 45
+ agentClimb: .400000006
+ ledgeDropHeight: 0
+ maxJumpAcrossDistance: 0
+ accuratePlacement: 0
+ minRegionArea: 2
+ widthInaccuracy: 16.666666
+ heightInaccuracy: 10
+ m_NavMesh: {fileID: 0}
+--- !u!1 &674035584
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 100000, guid: 3bccfea38e5e742e195ce1ff4cfa8e5d, type: 3}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 3
+ m_Component:
+ - 4: {fileID: 674035585}
+ - 33: {fileID: 674035587}
+ - 23: {fileID: 674035586}
+ - 114: {fileID: 674035588}
+ m_Layer: 0
+ m_Name: Plane
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &674035585
+Transform:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 400000, guid: 3bccfea38e5e742e195ce1ff4cfa8e5d, type: 3}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 674035584}
+ m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
+ m_LocalPosition: {x: -0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+ m_Children: []
+ m_Father: {fileID: 0}
+--- !u!23 &674035586
+Renderer:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 2300000, guid: 3bccfea38e5e742e195ce1ff4cfa8e5d,
+ type: 3}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 674035584}
+ m_Enabled: 1
+ m_CastShadows: 1
+ m_ReceiveShadows: 1
+ m_LightmapIndex: 255
+ m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
+ m_Materials:
+ - {fileID: 2100000, guid: 782314b0ead9c415a9ec8b0bcafd7c4d, type: 2}
+ m_SubsetIndices:
+ m_StaticBatchRoot: {fileID: 0}
+ m_UseLightProbes: 0
+ m_LightProbeAnchor: {fileID: 0}
+ m_ScaleInLightmap: 1
+--- !u!33 &674035587
+MeshFilter:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 3300000, guid: 3bccfea38e5e742e195ce1ff4cfa8e5d,
+ type: 3}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 674035584}
+ m_Mesh: {fileID: 4300000, guid: 3bccfea38e5e742e195ce1ff4cfa8e5d, type: 3}
+--- !u!114 &674035588
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 674035584}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 041d7ab368ef046df984396f184bada8, type: 1}
+ m_Name:
+--- !u!1 &1900351364
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 3
+ m_Component:
+ - 4: {fileID: 1900351365}
+ m_Layer: 0
+ m_Name: Camera Pivot
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &1900351365
+Transform:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1900351364}
+ m_LocalRotation: {x: -.369643897, y: .23911728, z: -.0990456343, w: -.892399192}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_LocalEulerAnglesHint: {x: 45, y: 330.000031, z: 0}
+ m_Children:
+ - {fileID: 1968762362}
+ m_Father: {fileID: 0}
+--- !u!1 &1912743918
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 3
+ m_Component:
+ - 4: {fileID: 1912743919}
+ - 108: {fileID: 1912743920}
+ m_Layer: 0
+ m_Name: Directional light
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &1912743919
+Transform:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1912743918}
+ m_LocalRotation: {x: .707106829, y: 0, z: 0, w: .707106709}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
+ m_Children: []
+ m_Father: {fileID: 0}
+--- !u!108 &1912743920
+Light:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1912743918}
+ m_Enabled: 1
+ serializedVersion: 3
+ m_Type: 1
+ m_Color: {r: 1, g: 1, b: 1, a: 1}
+ m_Intensity: .5
+ m_Range: 10
+ m_SpotAngle: 30
+ m_CookieSize: 10
+ m_Shadows:
+ m_Type: 0
+ m_Resolution: -1
+ m_Strength: 1
+ m_Bias: .0500000007
+ m_Softness: 4
+ m_SoftnessFade: 1
+ m_Cookie: {fileID: 0}
+ m_DrawHalo: 0
+ m_ActuallyLightmapped: 0
+ m_Flare: {fileID: 0}
+ m_RenderMode: 0
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_Lightmapping: 1
+ m_ShadowSamples: 1
+ m_ShadowRadius: 0
+ m_ShadowAngle: 0
+ m_IndirectIntensity: 1
+ m_AreaSize: {x: 1, y: 1}
+--- !u!1 &1968762361
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 3
+ m_Component:
+ - 4: {fileID: 1968762362}
+ - 20: {fileID: 1968762363}
+ - 92: {fileID: 1968762365}
+ - 124: {fileID: 1968762366}
+ - 81: {fileID: 1968762364}
+ m_Layer: 0
+ m_Name: Main Camera
+ m_TagString: MainCamera
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &1968762362
+Transform:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1968762361}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: -3}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+ m_Children: []
+ m_Father: {fileID: 1900351365}
+--- !u!20 &1968762363
+Camera:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1968762361}
+ m_Enabled: 1
+ serializedVersion: 2
+ m_ClearFlags: 1
+ m_BackGroundColor: {r: .141791046, g: .141791046, b: .141791046, a: .0196078438}
+ m_NormalizedViewPortRect:
+ serializedVersion: 2
+ x: 0
+ y: 0
+ width: 1
+ height: 1
+ near clip plane: .300000012
+ far clip plane: 1000
+ field of view: 30
+ orthographic: 0
+ orthographic size: 100
+ m_Depth: -1
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_RenderingPath: -1
+ m_TargetTexture: {fileID: 0}
+ m_HDR: 0
+--- !u!81 &1968762364
+AudioListener:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1968762361}
+ m_Enabled: 1
+--- !u!92 &1968762365
+Behaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1968762361}
+ m_Enabled: 1
+--- !u!124 &1968762366
+Behaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1968762361}
+ m_Enabled: 1
View
2 Assets/ShaderBasedMeshAnimation.unity.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 4ce407966916e42e7b12564cd53fac51
View
36 Assets/WavyAnimated.shader
@@ -0,0 +1,36 @@
+Shader "Custom/WavyAnimated" {
+ Properties {
+ _MainTex ("Base (RGB)", 2D) = "white" {}
+ _ParamsA ("Wave Params A", Vector) = (6.0, 2.0, 0.12, 0.0)
+ _ParamsB ("Wave Params B", Vector) = (12.0, 10.0, 0.03, 0.0)
+ }
+ SubShader {
+ Tags { "RenderType"="Opaque" }
+ LOD 200
+
+ CGPROGRAM
+ #pragma surface surf Lambert vertex:vert
+
+ sampler2D _MainTex;
+ half4 _ParamsA;
+ half4 _ParamsB;
+
+ void vert (inout appdata_full v) {
+ half time = _Time.y;
+ half u = v.texcoord.x;
+ half w1 = sin(time * _ParamsA.x - u * _ParamsA.y) * _ParamsA.z;
+ half w2 = sin(time * _ParamsB.x - u * _ParamsB.y) * _ParamsB.z;
+ v.vertex.y = (w1 + w2) * u;
+ }
+
+ struct Input {
+ float2 uv_MainTex;
+ };
+
+ void surf (Input IN, inout SurfaceOutput o) {
+ o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
+ }
+ ENDCG
+ }
+ FallBack "Diffuse"
+}
View
2 Assets/WavyAnimated.shader.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: e8f2b1396f82545b6bbc4971cca5eee0
View
BIN ProjectSettings/EditorBuildSettings.asset
Binary file not shown.

0 comments on commit 285ea76

Please sign in to comment.
Something went wrong with that request. Please try again.