Skip to content

Commit

Permalink
Adding files
Browse files Browse the repository at this point in the history
  • Loading branch information
rc1 committed Jun 6, 2016
1 parent 3ea863f commit 8a47137
Show file tree
Hide file tree
Showing 32 changed files with 233 additions and 0 deletions.
Binary file added Assets/CaptureTexture.renderTexture
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/CaptureTexture.renderTexture.meta

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

92 changes: 92 additions & 0 deletions Assets/CylindricalUnwrap.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Shader "CylindricalUnwrap"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100

Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"

struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};

struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};

sampler2D _MainTex;
float4 _MainTex_ST;

v2f vert (appdata v)
{
v2f o;
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}

fixed4 frag (v2f i) : SV_Target
{
float PI = 3.14159265;

float angle;
float azim;
float dist;

float get_s, get_t, pos_s;

angle = i.uv.x * 360.0 - 180.0;

if (angle >= -180.0 && angle < -90.0) {
azim = angle+180.0 - 45.0;
pos_s = 0.0;
}

if (angle >= -90.0 && angle < 0.0) {
azim = angle + 45.0;
pos_s = 0.25;
}

if (angle >= 0.0 && angle < 90.0) {
azim = angle - 45.0;
pos_s = 0.5;
}

if (angle >= 90.0 && angle < 180.0) {
azim = angle - 180.0 + 45.0;
pos_s = 0.75;
}

dist = sqrt(pow(tan(PI*azim/180.0),2.0) + 1.0);
get_s = (tan(PI*azim/180.0) + 1.0)/8.0 + pos_s;
get_t = (i.uv.y-0.5)*dist + 0.5;

fixed4 col;

if (i.uv.y < 0.5 - 0.5/sqrt(2.0) || i.uv.y > 0.5 + 0.5/sqrt(2.0)) {
col = fixed4(0.0,0.0,0.0,0.0);
} else {
col = tex2D(_MainTex, float2(get_s, get_t));
}

return col;
}
ENDCG
}
}
}
9 changes: 9 additions & 0 deletions Assets/CylindricalUnwrap.shader.meta

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

Binary file added Assets/CylindricalUnwrapMaterial.mat
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/CylindricalUnwrapMaterial.mat.meta

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

Binary file added Assets/Example.unity
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Example.unity.meta

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

21 changes: 21 additions & 0 deletions Assets/HorizontalFieldOfView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using UnityEngine;
using System.Collections;

[ExecuteInEditMode]
public class HorizontalFieldOfView : MonoBehaviour {

[Range(0,180)]
public float horitzonalFieldOfView = 90;
private Camera _camera;

void Start () {
_camera = GetComponent<Camera> ();
}

void Update() {
float horitzonalFieldOfViewRad = Mathf.Deg2Rad * horitzonalFieldOfView;
float cameraHorizontal = Mathf.Tan ( horitzonalFieldOfViewRad * 0.5f ) / _camera.aspect;
float verticalFieldOfView = Mathf.Atan ( cameraHorizontal ) * 2.0f;
_camera.fieldOfView = verticalFieldOfView * Mathf.Rad2Deg;
}
}
12 changes: 12 additions & 0 deletions Assets/HorizontalFieldOfView.cs.meta

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

9 changes: 9 additions & 0 deletions Assets/Utils.meta

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

22 changes: 22 additions & 0 deletions Assets/Utils/CameraFulstrumGizmo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using UnityEngine;
using System.Collections;

[RequireComponent(typeof(Camera))]

public class CameraFulstrumGizmo : MonoBehaviour {

public virtual void OnDrawGizmos() {
Matrix4x4 temp = Gizmos.matrix;
Gizmos.matrix = Matrix4x4.TRS(transform.position, transform.rotation, Vector3.one);
Gizmos.color = new Color (1.0f, 1.0f, 0.0f, 0.1f);
if (GetComponent<Camera>().orthographic) {
float spread = GetComponent<Camera>().farClipPlane - GetComponent<Camera>().nearClipPlane;
float center = (GetComponent<Camera>().farClipPlane + GetComponent<Camera>().nearClipPlane)*0.5f;
Gizmos.DrawWireCube(new Vector3(0,0,center), new Vector3(GetComponent<Camera>().orthographicSize*2*GetComponent<Camera>().aspect, GetComponent<Camera>().orthographicSize*2, spread));
} else {
Gizmos.DrawFrustum(Vector3.zero, GetComponent<Camera>().fieldOfView, GetComponent<Camera>().farClipPlane, GetComponent<Camera>().nearClipPlane, GetComponent<Camera>().aspect);
}
Gizmos.matrix = temp;
}

}
12 changes: 12 additions & 0 deletions Assets/Utils/CameraFulstrumGizmo.cs.meta

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

18 changes: 18 additions & 0 deletions Assets/Utils/Move.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using UnityEngine;
using System.Collections;

public class Move : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
Vector3 position = transform.position;
position.y = Mathf.Sin (Time.time*3) * 200.0f;
transform.position = position;
transform.Rotate (0, 10 * Time.deltaTime, 0);
}
}
12 changes: 12 additions & 0 deletions Assets/Utils/Move.cs.meta

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

Binary file added ProjectSettings/AudioManager.asset
Binary file not shown.
Binary file added ProjectSettings/ClusterInputManager.asset
Binary file not shown.
Binary file added ProjectSettings/DynamicsManager.asset
Binary file not shown.
Binary file added ProjectSettings/EditorBuildSettings.asset
Binary file not shown.
Binary file added ProjectSettings/EditorSettings.asset
Binary file not shown.
Binary file added ProjectSettings/GraphicsSettings.asset
Binary file not shown.
Binary file added ProjectSettings/InputManager.asset
Binary file not shown.
Binary file added ProjectSettings/NavMeshAreas.asset
Binary file not shown.
Binary file added ProjectSettings/NetworkManager.asset
Binary file not shown.
Binary file added ProjectSettings/Physics2DSettings.asset
Binary file not shown.
Binary file added ProjectSettings/ProjectSettings.asset
Binary file not shown.
2 changes: 2 additions & 0 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
m_EditorVersion: 5.3.4f1
m_StandardAssetsVersion: 0
Binary file added ProjectSettings/QualitySettings.asset
Binary file not shown.
Binary file added ProjectSettings/TagManager.asset
Binary file not shown.
Binary file added ProjectSettings/TimeManager.asset
Binary file not shown.
Binary file added ProjectSettings/UnityAdsSettings.asset
Binary file not shown.
Binary file added ProjectSettings/UnityConnectSettings.asset
Binary file not shown.

0 comments on commit 8a47137

Please sign in to comment.