Skip to content

Commit

Permalink
Some tweaks for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
keijiro committed Dec 23, 2018
1 parent 6a43ff3 commit de9a80f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static Mesh ConvertMesh(Mesh mesh)

for (var i = 0; i < src_idx.Length; i += 3)
{
var pid = (float)i / src_idx.Length;
var pid = i / 3;

var i0 = src_idx[i + 0];
var i1 = src_idx[i + 1];
Expand Down
14 changes: 9 additions & 5 deletions Assets/VideolabTest/Sphere/Sphere.shader
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Shader "VideolabTest/Sphere"
out fixed4 params : COLOR // bc_coord.xyz, alpha
) : SV_Position
{
uint pid = texcoord0.w * 65536;
uint pid = texcoord0.w;
uint vid = texcoord1.w;
uint group = Hash(pid) & 7;

Expand All @@ -47,10 +47,14 @@ Shader "VideolabTest/Sphere"
half3 normal = normalize(cross(p1 - p0, p2 - p0));

half alpha = saturate(
(group == 0) * _Effect1 + (group == 1) * _Effect2 +
(group == 2) * _Effect3 + (group == 3) * _Effect4 +
(group == 4) * _Effect5 + (group == 5) * _Effect6 +
(group == 6) * _Effect7 + (group == 7) * _Effect8
(group == 0 ? 1.0 : 0.0) * _Effect1 +
(group == 1 ? 1.0 : 0.0) * _Effect2 +
(group == 2 ? 1.0 : 0.0) * _Effect3 +
(group == 3 ? 1.0 : 0.0) * _Effect4 +
(group == 4 ? 1.0 : 0.0) * _Effect5 +
(group == 5 ? 1.0 : 0.0) * _Effect6 +
(group == 6 ? 1.0 : 0.0) * _Effect7 +
(group == 7 ? 1.0 : 0.0) * _Effect8
);
alpha *= (dot(_WorldSpaceLightPos0.xyz, normal) + 1) / 2;

Expand Down
2 changes: 1 addition & 1 deletion Assets/VideolabTest/Sphere/Sphere_TripMesh.asset

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion ProjectSettings/GraphicsSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ GraphicsSettings:
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ PlayerSettings:
StripUnusedMeshComponents: 0
VertexChannelCompressionMask:
serializedVersion: 2
m_Bits: 238
m_Bits: 230
iPhoneSdkVersion: 988
iOSTargetOSVersionString: 8.0
tvOSSdkVersion: 0
Expand Down

0 comments on commit de9a80f

Please sign in to comment.