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
Binary file added Lab-09-ShaderLab/Assets/GlobeTex.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 Lab-09-ShaderLab/Assets/GlobeTex.jpg.meta

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

Binary file added Lab-09-ShaderLab/Assets/TextureMatierial.mat
Binary file not shown.
8 changes: 8 additions & 0 deletions Lab-09-ShaderLab/Assets/TextureMatierial.mat.meta

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

58 changes: 58 additions & 0 deletions Lab-09-ShaderLab/Assets/TextureShader.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Shader "Custom/TextureShader"
{
Properties
{
_Color ("Color Tint", Color) = (1, 1, 1, 1)
_MainTex ("Diffuse Texture", 2D) = "white" {}
}
SubShader
{
Pass
{
CGPROGRAM

#pragma vertex vertexFunction
#pragma fragment fragmentFunction

uniform float4 _Color;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;

struct inputStruct
{
float4 vertexPos : POSITION;
float4 textureCoord : TEXCOORD0;
float3 vertexNormal : NORMAL;
};

struct outputStruct
{
float4 pixelPos : SV_POSITION;
float4 colour : COLOR;
float4 tex: TEXCOORD0;
};

outputStruct vertexFunction(inputStruct input)
{
outputStruct toReturn;

toReturn.pixelPos = mul(UNITY_MATRIX_MVP, input.vertexPos);
toReturn.tex = input.textureCoord;
toReturn.colour = float4(input.vertexNormal, 1.0);

return toReturn;
}

float4 fragmentFunction(outputStruct input) : COLOR
{
float4 tex = tex2D(_MainTex, _MainTex_ST.xy * input.tex.xy + _MainTex_ST.zw);
return _Color;
}

ENDCG
}
}

//Fallback
//Fallback "Diffuse"
}
9 changes: 9 additions & 0 deletions Lab-09-ShaderLab/Assets/TextureShader.shader.meta

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

Binary file added Lab-09-ShaderLab/Assets/dale.unity
Binary file not shown.
8 changes: 8 additions & 0 deletions Lab-09-ShaderLab/Assets/dale.unity.meta

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

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions Lab-09-ShaderLab/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 not shown.
Binary file added Lab-09-ShaderLab/ProjectSettings/TagManager.asset
Binary file not shown.
Binary file not shown.