Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Unity 2019.4.1f1 #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
114 changes: 58 additions & 56 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,69 +1,71 @@
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/

# Autogenerated VS/MD solution and project files
/*.csproj
/*.unityproj
/*.sln
/*.suo
/*.user
/*.userprefs
/*.pidb
/*.booproj
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/

#Unity3D Generated File On Crash Reports
sysinfo.txt

# =========================
# Operating System Files
# =========================
# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta

# OSX
# =========================
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*

.DS_Store
.AppleDouble
.LSOverride
# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*

# Thumbnails
._*
# Visual Studio cache directory
.vs/

# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Gradle cache directory
.gradle/

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Windows
# =========================
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Windows image file caches
Thumbs.db
ehthumbs.db
# Unity3D generated file on crash reports
sysinfo.txt

# Folder config file
Desktop.ini
# Builds
*.apk
*.aab
*.unitypackage

# Recycle Bin used on file shares
$RECYCLE.BIN/
# Crashlytics generated file
crashlytics-build.properties

# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*

# Windows shortcuts
*.lnk
Assets/UnityVS.meta
Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll
Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Messaging.dll.meta
debug-glsl-error-in-d3dcompile-orig.txt
debug-glsl-error-in-d3dcompile.txt
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
28 changes: 15 additions & 13 deletions Assets/Shaders/Reflective/psx-unlit-add.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Shader "psx/reflective/unlit-Add" {
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "psx/reflective/unlit-Add" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_Cube("Cubemap", CUBE) = "" {}
@@ -34,7 +37,7 @@
v2f o;

//Vertex snapping
float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex);
float4 snapToPixel = UnityObjectToClipPos(v.vertex);
float4 vertex = snapToPixel;
vertex.xyz = snapToPixel.xyz / snapToPixel.w;
vertex.x = floor(160 * vertex.x) / 160;
@@ -44,19 +47,19 @@

//Reflection
float3 viewDir = WorldSpaceViewDir(v.vertex);
float3 worldN = mul((float3x3)_Object2World, v.normal * 1.0);
float3 worldN = mul((float3x3)unity_ObjectToWorld, v.normal * 1.0);
o.reflect = reflect(-viewDir, worldN);

//Vertex lighting
o.color = v.color*UNITY_LIGHTMODEL_AMBIENT;;
o.color = v.color * UNITY_LIGHTMODEL_AMBIENT;;

float distance = length(mul(UNITY_MATRIX_MV,v.vertex));

//Affine Texture Mapping
float4 affinePos = vertex;//vertex;
o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);
o.uv_MainTex *= distance + (vertex.w*(UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.normal = distance + (vertex.w*(UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.uv_MainTex *= distance + (vertex.w * (UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.normal = distance + (vertex.w * (UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;

//Affine texturing for cubemap
o.reflect *= o.normal;
@@ -72,12 +75,11 @@
o.colorFog.a = clamp(fogDensity,0,1);

//Cut out polygons
if (distance > unity_FogStart.z + unity_FogColor.a * 255)
if (distance > unity_FogEnd.z + unity_FogColor.a * 255)
{
o.pos.w = 0;
o.pos = 0;
}


return o;
}

@@ -86,13 +88,13 @@

float4 frag(v2f IN) : COLOR
{
half4 c = tex2D(_MainTex, IN.uv_MainTex / IN.normal.r)*IN.color;
half4 c = tex2D(_MainTex, IN.uv_MainTex / IN.normal.r) * IN.color;
c += texCUBE(_Cube, IN.reflect);
half4 color = c*(IN.colorFog.a);
color.rgb += IN.colorFog.rgb*(1 - IN.colorFog.a);
half4 color = c * (IN.colorFog.a);
color.rgb += IN.colorFog.rgb * (1 - IN.colorFog.a);
return color;
}
ENDCG
}
}
}
}
28 changes: 15 additions & 13 deletions Assets/Shaders/Reflective/psx-unlit-mult.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Shader "psx/reflective/unlit-Mult" {
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "psx/reflective/unlit-Mult" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_Cube("Cubemap", CUBE) = "" {}
@@ -34,7 +37,7 @@
v2f o;

//Vertex snapping
float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex);
float4 snapToPixel = UnityObjectToClipPos(v.vertex);
float4 vertex = snapToPixel;
vertex.xyz = snapToPixel.xyz / snapToPixel.w;
vertex.x = floor(160 * vertex.x) / 160;
@@ -44,19 +47,19 @@

//Reflection
float3 viewDir = WorldSpaceViewDir(v.vertex);
float3 worldN = mul((float3x3)_Object2World, v.normal * 1.0);
float3 worldN = mul((float3x3)unity_ObjectToWorld, v.normal * 1.0);
o.reflect = reflect(-viewDir, worldN);

//Vertex lighting
o.color = v.color*UNITY_LIGHTMODEL_AMBIENT;;
o.color = v.color * UNITY_LIGHTMODEL_AMBIENT;;

float distance = length(mul(UNITY_MATRIX_MV,v.vertex));

//Affine Texture Mapping
float4 affinePos = vertex;//vertex;
o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);
o.uv_MainTex *= distance + (vertex.w*(UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.normal = distance + (vertex.w*(UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.uv_MainTex *= distance + (vertex.w * (UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.normal = distance + (vertex.w * (UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;

//Affine texturing for cubemap
o.reflect *= o.normal;
@@ -72,12 +75,11 @@
o.colorFog.a = clamp(fogDensity,0,1);

//Cut out polygons
if (distance > unity_FogStart.z + unity_FogColor.a * 255)
if (distance > unity_FogEnd.z + unity_FogColor.a * 255)
{
o.pos.w = 0;
o.pos = 0;
}


return o;
}

@@ -86,13 +88,13 @@

float4 frag(v2f IN) : COLOR
{
half4 c = tex2D(_MainTex, IN.uv_MainTex / IN.normal.r)*IN.color;
half4 c = tex2D(_MainTex, IN.uv_MainTex / IN.normal.r) * IN.color;
c *= texCUBE(_Cube, IN.reflect);
half4 color = c*(IN.colorFog.a);
color.rgb += IN.colorFog.rgb*(1 - IN.colorFog.a);
half4 color = c * (IN.colorFog.a);
color.rgb += IN.colorFog.rgb * (1 - IN.colorFog.a);
return color;
}
ENDCG
}
}
}
}
28 changes: 15 additions & 13 deletions Assets/Shaders/Reflective/psx-unlit_noambient-add.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Shader "psx/reflective/unlit_noambient-Add" {
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "psx/reflective/unlit_noambient-Add" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_Cube("Cubemap", CUBE) = "" {}
@@ -23,7 +26,7 @@
float2 uv_MainTex : TEXCOORD0;
half3 normal : TEXCOORD1;
float3 reflect : COLOR2;
};
};

float4 _MainTex_ST;
uniform half4 unity_FogStart;
@@ -34,7 +37,7 @@
v2f o;

//Vertex snapping
float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex);
float4 snapToPixel = UnityObjectToClipPos(v.vertex);
float4 vertex = snapToPixel;
vertex.xyz = snapToPixel.xyz / snapToPixel.w;
vertex.x = floor(160 * vertex.x) / 160;
@@ -44,7 +47,7 @@

//Reflection
float3 viewDir = WorldSpaceViewDir(o.pos);
float3 worldN = mul((float3x3)_Object2World, v.normal * 1.0);
float3 worldN = mul((float3x3)unity_ObjectToWorld, v.normal * 1.0);
o.reflect = reflect(-viewDir, worldN);

//Vertex lighting
@@ -55,8 +58,8 @@
//Affine Texture Mapping
float4 affinePos = vertex;//vertex;
o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);
o.uv_MainTex *= distance + (vertex.w*(UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.normal = distance + (vertex.w*(UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.uv_MainTex *= distance + (vertex.w * (UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;
o.normal = distance + (vertex.w * (UNITY_LIGHTMODEL_AMBIENT.a * 8)) / distance / 2;

//Fog
float4 fogColor = unity_FogColor;
@@ -69,12 +72,11 @@
o.colorFog.a = clamp(fogDensity,0,1);

//Cut out polygons
if (distance > unity_FogStart.z + unity_FogColor.a * 255)
if (distance > unity_FogEnd.z + unity_FogColor.a * 255)
{
o.pos.w = 0;
o.pos = 0;
}


return o;
}

@@ -83,13 +85,13 @@

float4 frag(v2f IN) : COLOR
{
half4 c = tex2D(_MainTex, IN.uv_MainTex / IN.normal.r)*IN.color;
half4 c = tex2D(_MainTex, IN.uv_MainTex / IN.normal.r) * IN.color;
c += texCUBE(_Cube, IN.reflect);
half4 color = c*(IN.colorFog.a);
color.rgb += IN.colorFog.rgb*(1 - IN.colorFog.a);
half4 color = c * (IN.colorFog.a);
color.rgb += IN.colorFog.rgb * (1 - IN.colorFog.a);
return color;
}
ENDCG
}
}
}
}
Loading