Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Assets/NewBehaviourScript.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using UnityEngine;
using System.Collections;

/// <summary>
/// Author: Matt Gipson
/// Contact: Deadwynn@gmail.com
/// Domain: www.livingvalkyrie.com
///
/// Description: NewBehaviourScript
/// </summary>
public class NewBehaviourScript : MonoBehaviour {
#region Fields

#endregion

void Start() { }

void Update() { }

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

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

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

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

73 changes: 73 additions & 0 deletions Assets/Specular.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Shader "Custom/Specular" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_SpecColor("Specular color", Color) = (1,1,1,1)
_Shininess("Shininess", float) = 10
_Attenuation("Fall off", Range(0,5)) = 1
}
SubShader {
Tags{"LightMode"="ForwardBase"}
Pass{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag

//user defined
uniform float4 _Color;
uniform float4 _SpecColor;
uniform float _Shininess;
uniform float _Attenuation;

//unity
uniform float4 _LightColor0;

//input
struct input{
float4 vertexPos : POSITION;
float3 vertexNormal : NORMAL;
};

struct v2f{
float4 pixelPos : SV_POSITION;
float4 pixelCol : COLOR;

float3 normalDirection : TEXCOORD0;
float4 pixelWorldPos : TEXCOORD1;
};

v2f vert(input i){
v2f toReturn;

//normal, view and light directions
toReturn.normalDirection = normalize(mul(float4(i.vertexNormal, 0.0), _World2Object).xyz);
toReturn.pixelWorldPos = mul(_Object2World, i.vertexPos);

toReturn.pixelPos = mul(UNITY_MATRIX_MVP, i.vertexPos);
return toReturn;
}

float4 frag(v2f i) : COLOR {
//direction declarations
float3 viewDirection = normalize(float3(float4(_WorldSpaceCameraPos.xyz, 1.0) - i.pixelWorldPos.xyz));
float3 lightDirection = normalize(_WorldSpaceLightPos0.xyz);

//reflections
float3 diffuseReflection = _SpecColor * _Attenuation * _LightColor0.xyz * max(0.0, dot(i.normalDirection, lightDirection));
float3 specularReflection = reflect(-lightDirection, i.normalDirection);
specularReflection = dot(specularReflection, viewDirection);
specularReflection = pow(max(0.0, specularReflection), _Shininess);
specularReflection = max(0.0, dot(i.normalDirection, lightDirection)) * specularReflection;

//final
float3 finalLight = specularReflection + diffuseReflection + UNITY_LIGHTMODEL_AMBIENT;

i.pixelCol = float4(finalLight * _Color, 1.0);

return i.pixelCol;
}

ENDCG
}
}
//FallBack "Diffuse"
}
9 changes: 9 additions & 0 deletions Assets/Specular.shader.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/UnityVS.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/UnityVS/Editor.meta

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

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
guid: 38d405c119fcc7c4e83d4a478a40ff2f
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
guid: 4ad02dc83da735c4e8d945332b9202f6
Binary file not shown.
20 changes: 20 additions & 0 deletions Assets/UnityVS/Editor/UnityVS.VersionSpecific.dll.meta

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

Binary file added Assets/marble.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions Assets/marble.jpg.meta

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

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

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

Binary file added Lab 10 Report.docx
Binary file not shown.
Binary file added ProjectSettings/AudioManager.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.1.2f1
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.