Skip to content

[DO NOT MERGE] Asset store workspace for Unity6 #72

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,14 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3}
m_Name: LiberationSans SDF - Fallback
m_EditorClassIdentifier:
hashCode: -1699145518
material: {fileID: 2180264}
materialHashCode: 462855346
m_Version: 1.1.0
m_Material: {fileID: 2180264}
m_SourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75,
type: 3}
m_SourceFontFile: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_FaceInfo:
m_FaceIndex: 0
m_FamilyName: Liberation Sans
m_StyleName: Regular
m_PointSize: 86
Expand All @@ -194,7 +192,7 @@ MonoBehaviour:
m_AtlasTextures:
- {fileID: 28268798066460806}
m_AtlasTextureIndex: 0
m_IsMultiAtlasTexturesEnabled: 0
m_IsMultiAtlasTexturesEnabled: 1
m_ClearDynamicDataOnBuild: 1
m_UsedGlyphRects: []
m_FreeGlyphRects:
Expand Down Expand Up @@ -233,15 +231,21 @@ MonoBehaviour:
m_KerningTable:
kerningPairs: []
m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
m_GlyphPairAdjustmentRecords: []
m_MarkToBaseAdjustmentRecords: []
m_MarkToMarkAdjustmentRecords: []
fallbackFontAssets: []
m_FallbackFontAssetTable: []
m_CreationSettings:
sourceFontFileName:
sourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
faceIndex: 0
pointSizeSamplingMode: 0
pointSize: 86
padding: 9
paddingMode: 0
packingMode: 4
atlasWidth: 512
atlasHeight: 512
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,48 @@
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ab2114bdc8544297b417dfefe9f1e410, type: 3}
m_Name: Default Style Sheet
m_EditorClassIdentifier:
m_StyleList:
- m_Name: Normal
m_HashCode: -1183493901
m_OpeningDefinition:
m_ClosingDefinition:
m_OpeningTagArray:
m_ClosingTagArray:
- m_Name: H1
m_HashCode: 2425
m_OpeningDefinition: <size=2em><b><#40ff80>*
m_ClosingDefinition: '*</size></b></color>'
m_OpeningTagArray: 3c00000073000000690000007a000000650000003d00000032000000650000006d0000003e0000003c000000620000003e0000003c000000230000003400000030000000660000006600000038000000300000003e0000002a000000
m_ClosingTagArray: 2a0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000
- m_Name: Quote
m_HashCode: 92254330
m_HashCode: 93368250
m_OpeningDefinition: <i><size=75%><margin=10%>
m_ClosingDefinition: </i></size></width></margin>
m_OpeningTagArray: 3c000000690000003e0000003c00000073000000690000007a000000650000003d0000003700000035000000250000003e0000003c0000006d000000610000007200000067000000690000006e0000003d0000003100000030000000250000003e000000
m_ClosingTagArray: 3c0000002f000000690000003e0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f00000077000000690000006400000074000000680000003e0000003c0000002f0000006d000000610000007200000067000000690000006e0000003e000000
- m_Name: A
m_HashCode: 65
m_OpeningDefinition: <color=#40a0ff><u>
m_ClosingDefinition: </u></color>
m_OpeningTagArray: 3c000000630000006f0000006c0000006f000000720000003d000000230000003400000030000000610000003000000066000000660000003e0000003c000000750000003e000000
m_ClosingTagArray: 3c0000002f000000750000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000
- m_Name: Link
m_HashCode: 2687968
m_HashCode: 2656128
m_OpeningDefinition: <u><#40a0ff><link="ID_01">
m_ClosingDefinition: </u></color></link>
m_OpeningTagArray: 3c000000750000003e0000003c000000230000003400000030000000610000003000000066000000660000003e0000003c0000006c000000690000006e0000006b0000003d0000002200000049000000440000005f0000003000000031000000220000003e000000
m_ClosingTagArray: 3c0000002f000000750000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e0000003c0000002f0000006c000000690000006e0000006b0000003e000000
- m_Name: Title
m_HashCode: 98732960
m_HashCode: 97690656
m_OpeningDefinition: <size=125%><b><align=center>
m_ClosingDefinition: </size></b></align>
m_OpeningTagArray: 3c00000073000000690000007a000000650000003d000000310000003200000035000000250000003e0000003c000000620000003e0000003c000000610000006c00000069000000670000006e0000003d00000063000000650000006e0000007400000065000000720000003e000000
Expand Down
17 changes: 10 additions & 7 deletions InputGlyphs/Assets/TextMesh Pro/Resources/TMP Settings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2705215ac5b84b70bacc50632be6e391, type: 3}
m_Name: TMP Settings
m_EditorClassIdentifier:
m_enableWordWrapping: 1
assetVersion: 2
m_TextWrappingMode: 1
m_enableKerning: 1
m_ActiveFontFeatures: 00000000
m_enableExtraPadding: 0
m_enableTintAllSprites: 0
m_enableParseEscapeCharacters: 1
m_EnableRaycastTarget: 1
m_GetFontFeaturesAtRuntime: 1
m_missingGlyphCharacter: 0
m_ClearDynamicDataOnBuild: 1
m_warningsDisabled: 0
m_defaultFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_defaultFontAssetPath: Fonts & Materials/
Expand All @@ -29,18 +32,18 @@ MonoBehaviour:
m_defaultTextMeshProTextContainerSize: {x: 20, y: 5}
m_defaultTextMeshProUITextContainerSize: {x: 200, y: 50}
m_autoSizeTextContainer: 0
m_IsTextObjectScaleStatic: 0
m_fallbackFontAssets: []
m_matchMaterialPreset: 1
m_defaultSpriteAsset: {fileID: 11400000, guid: c41005c129ba4d66911b75229fd70b45,
type: 2}
m_HideSubTextObjects: 1
m_defaultSpriteAsset: {fileID: 11400000, guid: c41005c129ba4d66911b75229fd70b45, type: 2}
m_defaultSpriteAssetPath: Sprite Assets/
m_enableEmojiSupport: 1
m_MissingCharacterSpriteUnicode: 0
m_EmojiFallbackTextAssets: []
m_defaultColorGradientPresetsPath: Color Gradient Presets/
m_defaultStyleSheet: {fileID: 11400000, guid: f952c082cb03451daed3ee968ac6c63e,
type: 2}
m_defaultStyleSheet: {fileID: 11400000, guid: f952c082cb03451daed3ee968ac6c63e, type: 2}
m_StyleSheetsResourcePath:
m_leadingCharacters: {fileID: 4900000, guid: d82c1b31c7e74239bff1220585707d2b, type: 3}
m_followingCharacters: {fileID: 4900000, guid: fade42e8bc714b018fac513c043d323b,
type: 3}
m_followingCharacters: {fileID: 4900000, guid: fade42e8bc714b018fac513c043d323b, type: 3}
m_UseModernHangulLineBreakingRules: 0
178 changes: 178 additions & 0 deletions InputGlyphs/Assets/TextMesh Pro/Shaders/SDFFunctions.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
float2 UnpackUV(float uv)
{
float2 output;
output.x = floor(uv / 4096.0);
output.y = uv - 4096.0 * output.x;

return output * 0.001953125;
}

float4 BlendARGB(float4 overlying, float4 underlying)
{
overlying.rgb *= overlying.a;
underlying.rgb *= underlying.a;
float3 blended = overlying.rgb + ((1 - overlying.a) * underlying.rgb);
float alpha = underlying.a + (1 - underlying.a) * overlying.a;
return float4(blended / alpha, alpha);
}

float3 GetSpecular(float3 n, float3 l)
{
float spec = pow(max(0.0, dot(n, l)), _Reflectivity);
return _SpecularColor.rgb * spec * _SpecularPower;
}

void GetSurfaceNormal_float(texture2D atlas, float textureWidth, float textureHeight, float2 uv, bool isFront, out float3 nornmal)
{
float3 delta = float3(1.0 / textureWidth, 1.0 / textureHeight, 0.0);

// Read "height field"
float4 h = float4(
SAMPLE_TEXTURE2D(atlas, SamplerState_Linear_Clamp, uv - delta.xz).a,
SAMPLE_TEXTURE2D(atlas, SamplerState_Linear_Clamp, uv + delta.xz).a,
SAMPLE_TEXTURE2D(atlas, SamplerState_Linear_Clamp, uv - delta.zy).a,
SAMPLE_TEXTURE2D(atlas, SamplerState_Linear_Clamp, uv + delta.zy).a);

bool raisedBevel = _BevelType;

h += _BevelOffset;

float bevelWidth = max(.01, _BevelWidth);

// Track outline
h -= .5;
h /= bevelWidth;
h = saturate(h + .5);

if (raisedBevel) h = 1 - abs(h * 2.0 - 1.0);
h = lerp(h, sin(h * 3.141592 / 2.0), float4(_BevelRoundness, _BevelRoundness, _BevelRoundness, _BevelRoundness));
h = min(h, 1.0 - float4(_BevelClamp, _BevelClamp, _BevelClamp, _BevelClamp));
h *= _BevelAmount * bevelWidth * _GradientScale * -2.0;

float3 va = normalize(float3(-1.0, 0.0, h.y - h.x));
float3 vb = normalize(float3(0.0, 1.0, h.w - h.z));

float3 f = float3(1, 1, 1);
if (isFront) f = float3(1, 1, -1);
nornmal = cross(va, vb) * f;
}

void EvaluateLight_float(float4 faceColor, float3 n, out float4 color)
{
n.z = abs(n.z);
float3 light = normalize(float3(sin(_LightAngle), cos(_LightAngle), 1.0));

float3 col = max(faceColor.rgb, 0) + GetSpecular(n, light)* faceColor.a;
//faceColor.rgb += col * faceColor.a;
col *= 1 - (dot(n, light) * _Diffuse);
col *= lerp(_Ambient, 1, n.z * n.z);

//fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n));
//faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a;

color = float4(col, faceColor.a);
}

// Add custom function to handle time in HDRP


//
void GenerateUV_float(float2 inUV, float4 transform, float2 animSpeed, out float2 outUV)
{
outUV = inUV * transform.xy + transform.zw + (animSpeed * _Time.y);
}

void ComputeUVOffset_float(float texWidth, float texHeight, float2 offset, float SDR, out float2 uvOffset)
{
uvOffset = float2(-offset.x * SDR / texWidth, -offset.y * SDR / texHeight);
}

void ScreenSpaceRatio2_float(float4x4 projection, float4 position, float2 objectScale, float screenWidth, float screenHeight, float fontScale, out float SSR)
{
float2 pixelSize = position.w;
pixelSize /= (objectScale * mul((float2x2)projection, float2(screenWidth, screenHeight)));
SSR = rsqrt(dot(pixelSize, pixelSize)*2) * fontScale;
}

// UV : Texture coordinate of the source distance field texture
// TextureSize : Size of the source distance field texture
// Filter : Enable perspective filter (soften)
void ScreenSpaceRatio_float(float2 UV, float TextureSize, bool Filter, out float SSR)
{
if(Filter)
{
float2 a = float2(ddx(UV.x), ddy(UV.x));
float2 b = float2(ddx(UV.y), ddy(UV.y));
float s = lerp(dot(a,a), dot(b,b), 0.5);
SSR = rsqrt(s) / TextureSize;
}
else
{
float s = rsqrt(abs(ddx(UV.x) * ddy(UV.y) - ddy(UV.x) * ddx(UV.y)));
SSR = s / TextureSize;
}
}

// SSR : Screen Space Ratio
// SD : Signed Distance (encoded : Distance / SDR + .5)
// SDR : Signed Distance Ratio
//
// IsoPerimeter : Dilate / Contract the shape
void ComputeSDF_float(float SSR, float SD, float SDR, float isoPerimeter, float softness, out float outAlpha)
{
softness *= SSR * SDR;
float d = (SD - 0.5) * SDR; // Signed distance to edge, in Texture space
outAlpha = saturate((d * 2.0 * SSR + 0.5 + isoPerimeter * SDR * SSR + softness * 0.5) / (1.0 + softness)); // Screen pixel coverage (alpha)
}

void ComputeSDF2_float(float SSR, float SD, float SDR, float2 isoPerimeter, float2 softness, out float2 outAlpha)
{
softness *= SSR * SDR;
float d = (SD - 0.5f) * SDR;
outAlpha = saturate((d * 2.0f * SSR + 0.5f + isoPerimeter * SDR * SSR + softness * 0.5) / (1.0 + softness));
}

void ComputeSDF4_float(float SSR, float SD, float SDR, float4 isoPerimeter, float4 softness, out float4 outAlpha)
{
softness *= SSR * SDR;
float d = (SD - 0.5f) * SDR;
outAlpha = saturate((d * 2.0f * SSR + 0.5f + isoPerimeter * SDR * SSR + softness * 0.5) / (1.0 + softness));
}

void ComputeSDF44_float(float SSR, float4 SD, float SDR, float4 isoPerimeter, float4 softness, bool outline, out float4 outAlpha)
{
softness *= SSR * SDR;
float4 d = (SD - 0.5f) * SDR;
if(outline) d.w = max(max(d.x, d.y), d.z);
outAlpha = saturate((d * 2.0f * SSR + 0.5f + isoPerimeter * SDR * SSR + softness * 0.5) / (1.0 + softness));
}

void Composite_float(float4 overlying, float4 underlying, out float4 outColor)
{
outColor = BlendARGB(overlying, underlying);
}

// Face only
void Layer1_float(float alpha, float4 color0, out float4 outColor)
{
color0.a *= alpha;
outColor = color0;
}

// Face + 1 Outline
void Layer2_float(float2 alpha, float4 color0, float4 color1, out float4 outColor)
{
color1.a *= alpha.y;
color0.rgb *= color0.a; color1.rgb *= color1.a;
outColor = lerp(color1, color0, alpha.x);
outColor.rgb /= outColor.a;
}

// Face + 3 Outline
void Layer4_float(float4 alpha, float4 color0, float4 color1, float4 color2, float4 color3, out float4 outColor)
{
color3.a *= alpha.w;
color0.rgb *= color0.a; color1.rgb *= color1.a; color2.rgb *= color2.a; color3.rgb *= color3.a;
outColor = lerp(lerp(lerp(color3, color2, alpha.z), color1, alpha.y), color0, alpha.x);
outColor.rgb /= outColor.a;
}
10 changes: 10 additions & 0 deletions InputGlyphs/Assets/TextMesh Pro/Shaders/SDFFunctions.hlsl.meta

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

Loading