HH
4 年前
当前提交
18ab67a0
共有 88 个文件被更改,包括 9481 次插入 和 23 次删除
-
150Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/PlayerCubeWithGun.prefab
-
2Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/Projectile.prefab
-
989Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
-
49Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeMovement.cs
-
19Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ShootProjectiles.cs
-
9Project/Assets/ML-Agents/Examples/Soccer/Materials/ClearPlastic.mat
-
2Project/ProjectSettings/DynamicsManager.asset
-
3Project/ProjectSettings/TagManager.asset
-
24Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentHealth.cs
-
11Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentHealth.cs.meta
-
109Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/FPSAgent.cs
-
11Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/FPSAgent.cs.meta
-
8Project/Assets/TextMesh Pro.meta
-
8Project/Assets/TextMesh Pro/Documentation.meta
-
1001Project/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf
-
7Project/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf.meta
-
8Project/Assets/TextMesh Pro/Fonts.meta
-
46Project/Assets/TextMesh Pro/Fonts/LiberationSans - OFL.txt
-
8Project/Assets/TextMesh Pro/Fonts/LiberationSans - OFL.txt.meta
-
1001Project/Assets/TextMesh Pro/Fonts/LiberationSans.ttf
-
19Project/Assets/TextMesh Pro/Fonts/LiberationSans.ttf.meta
-
8Project/Assets/TextMesh Pro/Resources.meta
-
9Project/Assets/TextMesh Pro/Resources/Fonts & Materials.meta
-
106Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Drop Shadow.mat
-
8Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Drop Shadow.mat.meta
-
548Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset
-
8Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset.meta
-
104Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline.mat
-
8Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline.mat.meta
-
1001Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset
-
8Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset.meta
-
1Project/Assets/TextMesh Pro/Resources/LineBreaking Following Characters.txt
-
8Project/Assets/TextMesh Pro/Resources/LineBreaking Following Characters.txt.meta
-
1Project/Assets/TextMesh Pro/Resources/LineBreaking Leading Characters.txt
-
8Project/Assets/TextMesh Pro/Resources/LineBreaking Leading Characters.txt.meta
-
9Project/Assets/TextMesh Pro/Resources/Shaders.meta
-
142Project/Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Custom-Atlas.shader
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Custom-Atlas.shader.meta
-
144Project/Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Mobile.shader
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Mobile.shader.meta
-
142Project/Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap.shader
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap.shader.meta
-
316Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF Overlay.shader
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF Overlay.shader.meta
-
246Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Masking.shader
-
9Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Masking.shader.meta
-
239Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Overlay.shader
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Overlay.shader.meta
-
239Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile.shader
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile.shader.meta
-
137Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface-Mobile.shader
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface-Mobile.shader.meta
-
156Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface.shader
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface.shader.meta
-
316Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF.shader
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF.shader.meta
-
113Project/Assets/TextMesh Pro/Resources/Shaders/TMP_Sprite.shader
-
9Project/Assets/TextMesh Pro/Resources/Shaders/TMP_Sprite.shader.meta
-
84Project/Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc.meta
-
85Project/Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc.meta
-
115Project/Assets/TextMesh Pro/Resources/Shaders/TMPro_Surface.cginc
-
7Project/Assets/TextMesh Pro/Resources/Shaders/TMPro_Surface.cginc.meta
-
9Project/Assets/TextMesh Pro/Resources/Sprite Assets.meta
-
638Project/Assets/TextMesh Pro/Resources/Sprite Assets/EmojiOne.asset
-
8Project/Assets/TextMesh Pro/Resources/Sprite Assets/EmojiOne.asset.meta
-
9Project/Assets/TextMesh Pro/Resources/Style Sheets.meta
-
68Project/Assets/TextMesh Pro/Resources/Style Sheets/Default Style Sheet.asset
-
8Project/Assets/TextMesh Pro/Resources/Style Sheets/Default Style Sheet.asset.meta
-
43Project/Assets/TextMesh Pro/Resources/TMP Settings.asset
-
8Project/Assets/TextMesh Pro/Resources/TMP Settings.asset.meta
-
8Project/Assets/TextMesh Pro/Sprites.meta
-
3Project/Assets/TextMesh Pro/Sprites/EmojiOne Attribution.txt
-
7Project/Assets/TextMesh Pro/Sprites/EmojiOne Attribution.txt.meta
-
156Project/Assets/TextMesh Pro/Sprites/EmojiOne.json
-
8Project/Assets/TextMesh Pro/Sprites/EmojiOne.json.meta
-
205Project/Assets/TextMesh Pro/Sprites/EmojiOne.png
-
431Project/Assets/TextMesh Pro/Sprites/EmojiOne.png.meta
989
Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class AgentHealth : MonoBehaviour |
|||
{ |
|||
public float currentHealth; |
|||
|
|||
public float damagePerHit; |
|||
|
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
|
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update() |
|||
{ |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9227871cd6ab8429d90afa4a5160924e |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using MLAgents; |
|||
using UnityEngine; |
|||
using Unity.MLAgents; |
|||
using Unity.MLAgents.Actuators; |
|||
using Unity.MLAgents.Sensors; |
|||
|
|||
public class FPSAgent : Agent |
|||
{ |
|||
private AgentCubeMovement m_CubeMovement; |
|||
|
|||
public ShootProjectiles shootController; |
|||
public bool useVectorObs; |
|||
Rigidbody m_AgentRb; |
|||
bool m_Shoot; |
|||
private Camera m_Cam; |
|||
|
|||
// Start is called before the first frame update
|
|||
public override void Initialize() |
|||
{ |
|||
m_CubeMovement = GetComponent<AgentCubeMovement>(); |
|||
m_Cam = Camera.main; |
|||
m_AgentRb = GetComponent<Rigidbody>(); |
|||
} |
|||
|
|||
public override void OnEpisodeBegin() |
|||
{ |
|||
// Unfreeze();
|
|||
// Unpoison();
|
|||
// Unsatiate();
|
|||
// m_Shoot = false;
|
|||
// m_AgentRb.velocity = Vector3.zero;
|
|||
// myLaser.transform.localScale = new Vector3(0f, 0f, 0f);
|
|||
// transform.position = new Vector3(Random.Range(-m_MyArea.range, m_MyArea.range),
|
|||
// 2f, Random.Range(-m_MyArea.range, m_MyArea.range))
|
|||
// + area.transform.position;
|
|||
transform.rotation = Quaternion.Euler(new Vector3(0f, Random.Range(0, 360))); |
|||
|
|||
// SetResetParameters();
|
|||
} |
|||
|
|||
public override void CollectObservations(VectorSensor sensor) |
|||
{ |
|||
if (useVectorObs) |
|||
{ |
|||
// var localVelocity = transform.InverseTransformDirection(m_AgentRb.velocity);
|
|||
// sensor.AddObservation(localVelocity.x);
|
|||
// sensor.AddObservation(localVelocity.z);
|
|||
// sensor.AddObservation(m_Frozen);
|
|||
sensor.AddObservation(m_Shoot); |
|||
} |
|||
// else if (useVectorFrozenFlag)
|
|||
// {
|
|||
// sensor.AddObservation(m_Frozen);
|
|||
// }
|
|||
} |
|||
|
|||
public void MoveAgent(ActionSegment<float> act) |
|||
{ |
|||
|
|||
// if (!m_Frozen)
|
|||
// {
|
|||
// var shootCommand = false;
|
|||
var forwardAxis = act[0]; |
|||
var rightAxis = act[1]; |
|||
var rotateAxis = act[2]; |
|||
var shootAxis = act[3]; |
|||
m_Shoot = shootAxis > 0 ? true : false; |
|||
|
|||
m_CubeMovement.RunOnGround(m_AgentRb, m_Cam.transform.TransformDirection(new Vector3(rightAxis, 0, forwardAxis))); |
|||
m_CubeMovement.RotateBody(rotateAxis, forwardAxis); |
|||
if (shootAxis > 0) |
|||
{ |
|||
shootController.Shoot(); |
|||
} |
|||
// }
|
|||
|
|||
if (m_AgentRb.velocity.sqrMagnitude > 25f) // slow it down
|
|||
{ |
|||
m_AgentRb.velocity *= 0.95f; |
|||
} |
|||
|
|||
} |
|||
|
|||
void OnCollisionEnter(Collision col) |
|||
{ |
|||
if (col.gameObject.CompareTag("projectile")) |
|||
{ |
|||
//IMPLEMENT HEALTH MECHANIC
|
|||
} |
|||
} |
|||
|
|||
public override void OnActionReceived(ActionBuffers actionBuffers) |
|||
{ |
|||
MoveAgent(actionBuffers.ContinuousActions); |
|||
} |
|||
|
|||
public override void Heuristic(in ActionBuffers actionsOut) |
|||
{ |
|||
var discreteActionsOut = actionsOut.ContinuousActions; |
|||
discreteActionsOut[0] = Input.GetKey(KeyCode.W) ? 1 : Input.GetKey(KeyCode.S) ? -1 : 0; //inputV
|
|||
discreteActionsOut[1] = Input.GetKey(KeyCode.E) ? 1 : Input.GetKey(KeyCode.Q) ? -1 : 0; //inputH
|
|||
discreteActionsOut[2] = Input.GetKey(KeyCode.D) ? 1 : Input.GetKey(KeyCode.A) ? -1 : 0; //rotate
|
|||
discreteActionsOut[3] = Input.GetKey(KeyCode.Space) ? 1 : 0; //shoot
|
|||
|
|||
} |
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 20ff6ddcc32eb44f6897ea0d9e837815 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: f54d1bd14bd3ca042bd867b519fee8cc |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 8e7e8f5a82a3a134e91c54efd2274ea9 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Project/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 1b8d251f9af63b746bf2f7ffe00ebb9b |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 6ab70aee4d56447429c680537fbf93ed |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Digitized data copyright (c) 2010 Google Corporation |
|||
with Reserved Font Arimo, Tinos and Cousine. |
|||
Copyright (c) 2012 Red Hat, Inc. |
|||
with Reserved Font Name Liberation. |
|||
|
|||
This Font Software is licensed under the SIL Open Font License, Version 1.1. |
|||
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL |
|||
|
|||
----------------------------------------------------------- |
|||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 |
|||
----------------------------------------------------------- |
|||
|
|||
PREAMBLE |
|||
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. |
|||
|
|||
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. |
|||
|
|||
DEFINITIONS |
|||
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. |
|||
|
|||
"Reserved Font Name" refers to any names specified as such after the copyright statement(s). |
|||
|
|||
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). |
|||
|
|||
"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. |
|||
|
|||
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. |
|||
|
|||
PERMISSION & CONDITIONS |
|||
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: |
|||
|
|||
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. |
|||
|
|||
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. |
|||
|
|||
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. |
|||
|
|||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. |
|||
|
|||
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. |
|||
|
|||
TERMINATION |
|||
This license becomes null and void if any of the above conditions are not met. |
|||
|
|||
DISCLAIMER |
|||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. |
|
|||
fileFormatVersion: 2 |
|||
guid: 6e59c59b81ab47f9b6ec5781fa725d2c |
|||
timeCreated: 1484171296 |
|||
licenseType: Pro |
|||
TextScriptImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Project/Assets/TextMesh Pro/Fonts/LiberationSans.ttf
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: e3265ab4bf004d28a9537516768c1c75 |
|||
timeCreated: 1484171297 |
|||
licenseType: Pro |
|||
TrueTypeFontImporter: |
|||
serializedVersion: 2 |
|||
fontSize: 16 |
|||
forceTextureCase: -2 |
|||
characterSpacing: 1 |
|||
characterPadding: 0 |
|||
includeFontData: 1 |
|||
use2xBehaviour: 0 |
|||
fontNames: [] |
|||
fallbackFontReferences: [] |
|||
customCharacters: |
|||
fontRenderingMode: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 243e06394e614e5d99fab26083b707fa |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 731f1baa9d144a9897cb1d341c2092b8 |
|||
folderAsset: yes |
|||
timeCreated: 1442040525 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_Name: LiberationSans SDF - Drop Shadow |
|||
m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3} |
|||
m_ShaderKeywords: OUTLINE_ON UNDERLAY_ON |
|||
m_LightmapFlags: 5 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _BumpMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _Cube: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _FaceTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 28684132378477856, guid: 8f586378b4e144a9851e7b34d9b748ee, |
|||
type: 2} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _OutlineTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- _Ambient: 0.5 |
|||
- _Bevel: 0.5 |
|||
- _BevelClamp: 0 |
|||
- _BevelOffset: 0 |
|||
- _BevelRoundness: 0 |
|||
- _BevelWidth: 0 |
|||
- _BumpFace: 0 |
|||
- _BumpOutline: 0 |
|||
- _ColorMask: 15 |
|||
- _Diffuse: 0.5 |
|||
- _DiffusePower: 1 |
|||
- _FaceDilate: 0.1 |
|||
- _FaceUVSpeedX: 0 |
|||
- _FaceUVSpeedY: 0 |
|||
- _GlowInner: 0.05 |
|||
- _GlowOffset: 0 |
|||
- _GlowOuter: 0.05 |
|||
- _GlowPower: 0.75 |
|||
- _GradientScale: 10 |
|||
- _LightAngle: 3.1416 |
|||
- _MaskSoftnessX: 0 |
|||
- _MaskSoftnessY: 0 |
|||
- _OutlineSoftness: 0 |
|||
- _OutlineUVSpeedX: 0 |
|||
- _OutlineUVSpeedY: 0 |
|||
- _OutlineWidth: 0.1 |
|||
- _PerspectiveFilter: 0.875 |
|||
- _Reflectivity: 10 |
|||
- _ScaleRatioA: 0.9 |
|||
- _ScaleRatioB: 0.73125 |
|||
- _ScaleRatioC: 0.64125 |
|||
- _ScaleX: 1 |
|||
- _ScaleY: 1 |
|||
- _ShaderFlags: 0 |
|||
- _Sharpness: 0 |
|||
- _SpecularPower: 2 |
|||
- _Stencil: 0 |
|||
- _StencilComp: 8 |
|||
- _StencilOp: 0 |
|||
- _StencilReadMask: 255 |
|||
- _StencilWriteMask: 255 |
|||
- _TextureHeight: 1024 |
|||
- _TextureWidth: 1024 |
|||
- _UnderlayDilate: 0 |
|||
- _UnderlayOffsetX: 0.5 |
|||
- _UnderlayOffsetY: -0.5 |
|||
- _UnderlaySoftness: 0.05 |
|||
- _VertexOffsetX: 0 |
|||
- _VertexOffsetY: 0 |
|||
- _WeightBold: 0.75 |
|||
- _WeightNormal: 0 |
|||
m_Colors: |
|||
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767} |
|||
- _Color: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0} |
|||
- _FaceColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _GlowColor: {r: 0, g: 1, b: 0, a: 0.5} |
|||
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767} |
|||
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} |
|
|||
fileFormatVersion: 2 |
|||
guid: e73a58f6e2794ae7b1b7e50b7fb811b0 |
|||
timeCreated: 1484172806 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
548
Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 2e498d1c8094910479dc3e1b768306a4 |
|||
timeCreated: 1484171803 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_Name: LiberationSans SDF - Outline |
|||
m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3} |
|||
m_ShaderKeywords: OUTLINE_ON |
|||
m_LightmapFlags: 5 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _BumpMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _Cube: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _FaceTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 28684132378477856, guid: 8f586378b4e144a9851e7b34d9b748ee, |
|||
type: 2} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _OutlineTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- _Ambient: 0.5 |
|||
- _Bevel: 0.5 |
|||
- _BevelClamp: 0 |
|||
- _BevelOffset: 0 |
|||
- _BevelRoundness: 0 |
|||
- _BevelWidth: 0 |
|||
- _BumpFace: 0 |
|||
- _BumpOutline: 0 |
|||
- _ColorMask: 15 |
|||
- _Diffuse: 0.5 |
|||
- _FaceDilate: 0.1 |
|||
- _FaceUVSpeedX: 0 |
|||
- _FaceUVSpeedY: 0 |
|||
- _GlowInner: 0.05 |
|||
- _GlowOffset: 0 |
|||
- _GlowOuter: 0.05 |
|||
- _GlowPower: 0.75 |
|||
- _GradientScale: 10 |
|||
- _LightAngle: 3.1416 |
|||
- _MaskSoftnessX: 0 |
|||
- _MaskSoftnessY: 0 |
|||
- _OutlineSoftness: 0 |
|||
- _OutlineUVSpeedX: 0 |
|||
- _OutlineUVSpeedY: 0 |
|||
- _OutlineWidth: 0.1 |
|||
- _PerspectiveFilter: 0.875 |
|||
- _Reflectivity: 10 |
|||
- _ScaleRatioA: 0.9 |
|||
- _ScaleRatioB: 0.73125 |
|||
- _ScaleRatioC: 0.64125 |
|||
- _ScaleX: 1 |
|||
- _ScaleY: 1 |
|||
- _ShaderFlags: 0 |
|||
- _Sharpness: 0 |
|||
- _SpecularPower: 2 |
|||
- _Stencil: 0 |
|||
- _StencilComp: 8 |
|||
- _StencilOp: 0 |
|||
- _StencilReadMask: 255 |
|||
- _StencilWriteMask: 255 |
|||
- _TextureHeight: 1024 |
|||
- _TextureWidth: 1024 |
|||
- _UnderlayDilate: 0 |
|||
- _UnderlayOffsetX: 0 |
|||
- _UnderlayOffsetY: 0 |
|||
- _UnderlaySoftness: 0 |
|||
- _VertexOffsetX: 0 |
|||
- _VertexOffsetY: 0 |
|||
- _WeightBold: 0.75 |
|||
- _WeightNormal: 0 |
|||
m_Colors: |
|||
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767} |
|||
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0} |
|||
- _FaceColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _GlowColor: {r: 0, g: 1, b: 0, a: 0.5} |
|||
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767} |
|||
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} |
|
|||
fileFormatVersion: 2 |
|||
guid: 79459efec17a4d00a321bdcc27bbc385 |
|||
timeCreated: 1484172856 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Project/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 8f586378b4e144a9851e7b34d9b748ee |
|||
timeCreated: 1484171803 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
)]}〕〉》」』】〙〗〟’”⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、%,.:;。!?]):;=}¢°"†‡℃〆%,. |
|
|||
fileFormatVersion: 2 |
|||
guid: fade42e8bc714b018fac513c043d323b |
|||
timeCreated: 1425440388 |
|||
licenseType: Store |
|||
TextScriptImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
([{〔〈《「『【〘〖〝‘“⦅«$—…‥〳〴〵\[({£¥"々〇〉》」$⦆¥₩ # |
|
|||
fileFormatVersion: 2 |
|||
guid: d82c1b31c7e74239bff1220585707d2b |
|||
timeCreated: 1425440388 |
|||
licenseType: Store |
|||
TextScriptImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 99f836c9cb9345dba2e72c4a1f2d0695 |
|||
folderAsset: yes |
|||
timeCreated: 1436068007 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "TextMeshPro/Bitmap Custom Atlas" { |
|||
|
|||
Properties { |
|||
_MainTex ("Font Atlas", 2D) = "white" {} |
|||
_FaceTex ("Font Texture", 2D) = "white" {} |
|||
_FaceColor ("Text Color", Color) = (1,1,1,1) |
|||
|
|||
_VertexOffsetX ("Vertex OffsetX", float) = 0 |
|||
_VertexOffsetY ("Vertex OffsetY", float) = 0 |
|||
_MaskSoftnessX ("Mask SoftnessX", float) = 0 |
|||
_MaskSoftnessY ("Mask SoftnessY", float) = 0 |
|||
|
|||
_ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767) |
|||
_Padding ("Padding", float) = 0 |
|||
|
|||
_StencilComp("Stencil Comparison", Float) = 8 |
|||
_Stencil("Stencil ID", Float) = 0 |
|||
_StencilOp("Stencil Operation", Float) = 0 |
|||
_StencilWriteMask("Stencil Write Mask", Float) = 255 |
|||
_StencilReadMask("Stencil Read Mask", Float) = 255 |
|||
|
|||
_ColorMask("Color Mask", Float) = 15 |
|||
} |
|||
|
|||
SubShader{ |
|||
|
|||
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } |
|||
|
|||
Stencil |
|||
{ |
|||
Ref[_Stencil] |
|||
Comp[_StencilComp] |
|||
Pass[_StencilOp] |
|||
ReadMask[_StencilReadMask] |
|||
WriteMask[_StencilWriteMask] |
|||
} |
|||
|
|||
|
|||
Lighting Off |
|||
Cull [_CullMode] |
|||
ZTest [unity_GUIZTestMode] |
|||
ZWrite Off |
|||
Fog { Mode Off } |
|||
Blend SrcAlpha OneMinusSrcAlpha |
|||
ColorMask[_ColorMask] |
|||
|
|||
Pass { |
|||
CGPROGRAM |
|||
#pragma vertex vert |
|||
#pragma fragment frag |
|||
|
|||
#pragma multi_compile __ UNITY_UI_CLIP_RECT |
|||
#pragma multi_compile __ UNITY_UI_ALPHACLIP |
|||
|
|||
|
|||
#include "UnityCG.cginc" |
|||
|
|||
struct appdata_t { |
|||
float4 vertex : POSITION; |
|||
fixed4 color : COLOR; |
|||
float2 texcoord0 : TEXCOORD0; |
|||
float2 texcoord1 : TEXCOORD1; |
|||
}; |
|||
|
|||
struct v2f { |
|||
float4 vertex : SV_POSITION; |
|||
fixed4 color : COLOR; |
|||
float2 texcoord0 : TEXCOORD0; |
|||
float2 texcoord1 : TEXCOORD1; |
|||
float4 mask : TEXCOORD2; |
|||
}; |
|||
|
|||
uniform sampler2D _MainTex; |
|||
uniform sampler2D _FaceTex; |
|||
uniform float4 _FaceTex_ST; |
|||
uniform fixed4 _FaceColor; |
|||
|
|||
uniform float _VertexOffsetX; |
|||
uniform float _VertexOffsetY; |
|||
uniform float4 _ClipRect; |
|||
uniform float _MaskSoftnessX; |
|||
uniform float _MaskSoftnessY; |
|||
|
|||
float2 UnpackUV(float uv) |
|||
{ |
|||
float2 output; |
|||
output.x = floor(uv / 4096); |
|||
output.y = uv - 4096 * output.x; |
|||
|
|||
return output * 0.001953125; |
|||
} |
|||
|
|||
v2f vert (appdata_t v) |
|||
{ |
|||
float4 vert = v.vertex; |
|||
vert.x += _VertexOffsetX; |
|||
vert.y += _VertexOffsetY; |
|||
|
|||
vert.xy += (vert.w * 0.5) / _ScreenParams.xy; |
|||
|
|||
float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert)); |
|||
|
|||
fixed4 faceColor = v.color; |
|||
faceColor *= _FaceColor; |
|||
|
|||
v2f OUT; |
|||
OUT.vertex = vPosition; |
|||
OUT.color = faceColor; |
|||
OUT.texcoord0 = v.texcoord0; |
|||
OUT.texcoord1 = TRANSFORM_TEX(UnpackUV(v.texcoord1), _FaceTex); |
|||
float2 pixelSize = vPosition.w; |
|||
pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); |
|||
|
|||
// Clamp _ClipRect to 16bit. |
|||
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); |
|||
OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)); |
|||
|
|||
return OUT; |
|||
} |
|||
|
|||
fixed4 frag (v2f IN) : SV_Target |
|||
{ |
|||
fixed4 color = tex2D(_MainTex, IN.texcoord0) * tex2D(_FaceTex, IN.texcoord1) * IN.color; |
|||
|
|||
// Alternative implementation to UnityGet2DClipping with support for softness. |
|||
#if UNITY_UI_CLIP_RECT |
|||
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); |
|||
color *= m.x * m.y; |
|||
#endif |
|||
|
|||
#if UNITY_UI_ALPHACLIP |
|||
clip(color.a - 0.001); |
|||
#endif |
|||
|
|||
return color; |
|||
} |
|||
ENDCG |
|||
} |
|||
} |
|||
|
|||
CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI" |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 48bb5f55d8670e349b6e614913f9d910 |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "TextMeshPro/Mobile/Bitmap" { |
|||
|
|||
Properties { |
|||
_MainTex ("Font Atlas", 2D) = "white" {} |
|||
_Color ("Text Color", Color) = (1,1,1,1) |
|||
_DiffusePower ("Diffuse Power", Range(1.0,4.0)) = 1.0 |
|||
|
|||
_VertexOffsetX("Vertex OffsetX", float) = 0 |
|||
_VertexOffsetY("Vertex OffsetY", float) = 0 |
|||
_MaskSoftnessX("Mask SoftnessX", float) = 0 |
|||
_MaskSoftnessY("Mask SoftnessY", float) = 0 |
|||
|
|||
_ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767) |
|||
|
|||
_StencilComp("Stencil Comparison", Float) = 8 |
|||
_Stencil("Stencil ID", Float) = 0 |
|||
_StencilOp("Stencil Operation", Float) = 0 |
|||
_StencilWriteMask("Stencil Write Mask", Float) = 255 |
|||
_StencilReadMask("Stencil Read Mask", Float) = 255 |
|||
|
|||
_ColorMask("Color Mask", Float) = 15 |
|||
} |
|||
|
|||
SubShader { |
|||
|
|||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } |
|||
|
|||
Stencil |
|||
{ |
|||
Ref[_Stencil] |
|||
Comp[_StencilComp] |
|||
Pass[_StencilOp] |
|||
ReadMask[_StencilReadMask] |
|||
WriteMask[_StencilWriteMask] |
|||
} |
|||
|
|||
|
|||
Lighting Off |
|||
Cull Off |
|||
ZTest [unity_GUIZTestMode] |
|||
ZWrite Off |
|||
Fog { Mode Off } |
|||
Blend SrcAlpha OneMinusSrcAlpha |
|||
ColorMask[_ColorMask] |
|||
|
|||
Pass { |
|||
CGPROGRAM |
|||
#pragma vertex vert |
|||
#pragma fragment frag |
|||
#pragma fragmentoption ARB_precision_hint_fastest |
|||
|
|||
#pragma multi_compile __ UNITY_UI_CLIP_RECT |
|||
#pragma multi_compile __ UNITY_UI_ALPHACLIP |
|||
|
|||
|
|||
#include "UnityCG.cginc" |
|||
|
|||
struct appdata_t { |
|||
float4 vertex : POSITION; |
|||
fixed4 color : COLOR; |
|||
float2 texcoord0 : TEXCOORD0; |
|||
float2 texcoord1 : TEXCOORD1; |
|||
}; |
|||
|
|||
struct v2f { |
|||
float4 vertex : POSITION; |
|||
fixed4 color : COLOR; |
|||
float2 texcoord0 : TEXCOORD0; |
|||
float4 mask : TEXCOORD2; |
|||
}; |
|||
|
|||
sampler2D _MainTex; |
|||
fixed4 _Color; |
|||
float _DiffusePower; |
|||
|
|||
uniform float _VertexOffsetX; |
|||
uniform float _VertexOffsetY; |
|||
uniform float4 _ClipRect; |
|||
uniform float _MaskSoftnessX; |
|||
uniform float _MaskSoftnessY; |
|||
|
|||
v2f vert (appdata_t v) |
|||
{ |
|||
v2f OUT; |
|||
float4 vert = v.vertex; |
|||
vert.x += _VertexOffsetX; |
|||
vert.y += _VertexOffsetY; |
|||
|
|||
vert.xy += (vert.w * 0.5) / _ScreenParams.xy; |
|||
|
|||
OUT.vertex = UnityPixelSnap(UnityObjectToClipPos(vert)); |
|||
OUT.color = v.color; |
|||
OUT.color *= _Color; |
|||
OUT.color.rgb *= _DiffusePower; |
|||
OUT.texcoord0 = v.texcoord0; |
|||
|
|||
float2 pixelSize = OUT.vertex.w; |
|||
//pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); |
|||
|
|||
// Clamp _ClipRect to 16bit. |
|||
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); |
|||
OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)); |
|||
|
|||
return OUT; |
|||
} |
|||
|
|||
fixed4 frag (v2f IN) : COLOR |
|||
{ |
|||
fixed4 color = fixed4(IN.color.rgb, IN.color.a * tex2D(_MainTex, IN.texcoord0).a); |
|||
|
|||
// Alternative implementation to UnityGet2DClipping with support for softness. |
|||
#if UNITY_UI_CLIP_RECT |
|||
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); |
|||
color *= m.x * m.y; |
|||
#endif |
|||
|
|||
#if UNITY_UI_ALPHACLIP |
|||
clip(color.a - 0.001); |
|||
#endif |
|||
|
|||
return color; |
|||
} |
|||
ENDCG |
|||
} |
|||
} |
|||
|
|||
SubShader { |
|||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } |
|||
Lighting Off Cull Off ZTest Always ZWrite Off Fog { Mode Off } |
|||
Blend SrcAlpha OneMinusSrcAlpha |
|||
BindChannels { |
|||
Bind "Color", color |
|||
Bind "Vertex", vertex |
|||
Bind "TexCoord", texcoord0 |
|||
} |
|||
Pass { |
|||
SetTexture [_MainTex] { |
|||
constantColor [_Color] combine constant * primary, constant * texture |
|||
} |
|||
} |
|||
} |
|||
|
|||
CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI" |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1e3b057af24249748ff873be7fafee47 |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "TextMeshPro/Bitmap" { |
|||
|
|||
Properties { |
|||
_MainTex ("Font Atlas", 2D) = "white" {} |
|||
_FaceTex ("Font Texture", 2D) = "white" {} |
|||
_FaceColor ("Text Color", Color) = (1,1,1,1) |
|||
|
|||
_VertexOffsetX ("Vertex OffsetX", float) = 0 |
|||
_VertexOffsetY ("Vertex OffsetY", float) = 0 |
|||
_MaskSoftnessX ("Mask SoftnessX", float) = 0 |
|||
_MaskSoftnessY ("Mask SoftnessY", float) = 0 |
|||
|
|||
_ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767) |
|||
|
|||
_StencilComp("Stencil Comparison", Float) = 8 |
|||
_Stencil("Stencil ID", Float) = 0 |
|||
_StencilOp("Stencil Operation", Float) = 0 |
|||
_StencilWriteMask("Stencil Write Mask", Float) = 255 |
|||
_StencilReadMask("Stencil Read Mask", Float) = 255 |
|||
|
|||
_ColorMask("Color Mask", Float) = 15 |
|||
} |
|||
|
|||
SubShader{ |
|||
|
|||
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } |
|||
|
|||
Stencil |
|||
{ |
|||
Ref[_Stencil] |
|||
Comp[_StencilComp] |
|||
Pass[_StencilOp] |
|||
ReadMask[_StencilReadMask] |
|||
WriteMask[_StencilWriteMask] |
|||
} |
|||
|
|||
|
|||
Lighting Off |
|||
Cull [_CullMode] |
|||
ZTest [unity_GUIZTestMode] |
|||
ZWrite Off |
|||
Fog { Mode Off } |
|||
Blend SrcAlpha OneMinusSrcAlpha |
|||
ColorMask[_ColorMask] |
|||
|
|||
Pass { |
|||
CGPROGRAM |
|||
#pragma vertex vert |
|||
#pragma fragment frag |
|||
|
|||
#pragma multi_compile __ UNITY_UI_CLIP_RECT |
|||
#pragma multi_compile __ UNITY_UI_ALPHACLIP |
|||
|
|||
|
|||
#include "UnityCG.cginc" |
|||
|
|||
struct appdata_t { |
|||
float4 vertex : POSITION; |
|||
fixed4 color : COLOR; |
|||
float2 texcoord0 : TEXCOORD0; |
|||
float2 texcoord1 : TEXCOORD1; |
|||
}; |
|||
|
|||
struct v2f { |
|||
float4 vertex : SV_POSITION; |
|||
fixed4 color : COLOR; |
|||
float2 texcoord0 : TEXCOORD0; |
|||
float2 texcoord1 : TEXCOORD1; |
|||
float4 mask : TEXCOORD2; |
|||
}; |
|||
|
|||
uniform sampler2D _MainTex; |
|||
uniform sampler2D _FaceTex; |
|||
uniform float4 _FaceTex_ST; |
|||
uniform fixed4 _FaceColor; |
|||
|
|||
uniform float _VertexOffsetX; |
|||
uniform float _VertexOffsetY; |
|||
uniform float4 _ClipRect; |
|||
uniform float _MaskSoftnessX; |
|||
uniform float _MaskSoftnessY; |
|||
|
|||
float2 UnpackUV(float uv) |
|||
{ |
|||
float2 output; |
|||
output.x = floor(uv / 4096); |
|||
output.y = uv - 4096 * output.x; |
|||
|
|||
return output * 0.001953125; |
|||
} |
|||
|
|||
v2f vert (appdata_t v) |
|||
{ |
|||
float4 vert = v.vertex; |
|||
vert.x += _VertexOffsetX; |
|||
vert.y += _VertexOffsetY; |
|||
|
|||
vert.xy += (vert.w * 0.5) / _ScreenParams.xy; |
|||
|
|||
float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert)); |
|||
|
|||
fixed4 faceColor = v.color; |
|||
faceColor *= _FaceColor; |
|||
|
|||
v2f OUT; |
|||
OUT.vertex = vPosition; |
|||
OUT.color = faceColor; |
|||
OUT.texcoord0 = v.texcoord0; |
|||
OUT.texcoord1 = TRANSFORM_TEX(UnpackUV(v.texcoord1), _FaceTex); |
|||
float2 pixelSize = vPosition.w; |
|||
pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); |
|||
|
|||
// Clamp _ClipRect to 16bit. |
|||
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); |
|||
OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)); |
|||
|
|||
return OUT; |
|||
} |
|||
|
|||
fixed4 frag (v2f IN) : SV_Target |
|||
{ |
|||
fixed4 color = tex2D(_MainTex, IN.texcoord0); |
|||
color = fixed4 (tex2D(_FaceTex, IN.texcoord1).rgb * IN.color.rgb, IN.color.a * color.a); |
|||
|
|||
// Alternative implementation to UnityGet2DClipping with support for softness. |
|||
#if UNITY_UI_CLIP_RECT |
|||
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); |
|||
color *= m.x * m.y; |
|||
#endif |
|||
|
|||
#if UNITY_UI_ALPHACLIP |
|||
clip(color.a - 0.001); |
|||
#endif |
|||
|
|||
return color; |
|||
} |
|||
ENDCG |
|||
} |
|||
} |
|||
|
|||
CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI" |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 128e987d567d4e2c824d754223b3f3b0 |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "TextMeshPro/Distance Field Overlay" { |
|||
|
|||
Properties { |
|||
_FaceTex ("Face Texture", 2D) = "white" {} |
|||
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0 |
|||
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0 |
|||
_FaceColor ("Face Color", Color) = (1,1,1,1) |
|||
_FaceDilate ("Face Dilate", Range(-1,1)) = 0 |
|||
|
|||
_OutlineColor ("Outline Color", Color) = (0,0,0,1) |
|||
_OutlineTex ("Outline Texture", 2D) = "white" {} |
|||
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0 |
|||
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0 |
|||
_OutlineWidth ("Outline Thickness", Range(0, 1)) = 0 |
|||
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0 |
|||
|
|||
_Bevel ("Bevel", Range(0,1)) = 0.5 |
|||
_BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0 |
|||
_BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0 |
|||
_BevelClamp ("Bevel Clamp", Range(0,1)) = 0 |
|||
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0 |
|||
|
|||
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416 |
|||
_SpecularColor ("Specular", Color) = (1,1,1,1) |
|||
_SpecularPower ("Specular", Range(0,4)) = 2.0 |
|||
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10 |
|||
_Diffuse ("Diffuse", Range(0,1)) = 0.5 |
|||
_Ambient ("Ambient", Range(1,0)) = 0.5 |
|||
|
|||
_BumpMap ("Normal map", 2D) = "bump" {} |
|||
_BumpOutline ("Bump Outline", Range(0,1)) = 0 |
|||
_BumpFace ("Bump Face", Range(0,1)) = 0 |
|||
|
|||
_ReflectFaceColor ("Reflection Color", Color) = (0,0,0,1) |
|||
_ReflectOutlineColor("Reflection Color", Color) = (0,0,0,1) |
|||
_Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ } |
|||
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0) |
|||
|
|||
|
|||
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5) |
|||
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 |
|||
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 |
|||
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 |
|||
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0 |
|||
|
|||
_GlowColor ("Color", Color) = (0, 1, 0, 0.5) |
|||
_GlowOffset ("Offset", Range(-1,1)) = 0 |
|||
_GlowInner ("Inner", Range(0,1)) = 0.05 |
|||
_GlowOuter ("Outer", Range(0,1)) = 0.05 |
|||
_GlowPower ("Falloff", Range(1, 0)) = 0.75 |
|||
|
|||
_WeightNormal ("Weight Normal", float) = 0 |
|||
_WeightBold ("Weight Bold", float) = 0.5 |
|||
|
|||
_ShaderFlags ("Flags", float) = 0 |
|||
_ScaleRatioA ("Scale RatioA", float) = 1 |
|||
_ScaleRatioB ("Scale RatioB", float) = 1 |
|||
_ScaleRatioC ("Scale RatioC", float) = 1 |
|||
|
|||
_MainTex ("Font Atlas", 2D) = "white" {} |
|||
_TextureWidth ("Texture Width", float) = 512 |
|||
_TextureHeight ("Texture Height", float) = 512 |
|||
_GradientScale ("Gradient Scale", float) = 5.0 |
|||
_ScaleX ("Scale X", float) = 1.0 |
|||
_ScaleY ("Scale Y", float) = 1.0 |
|||
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 |
|||
_Sharpness ("Sharpness", Range(-1,1)) = 0 |
|||
|
|||
_VertexOffsetX ("Vertex OffsetX", float) = 0 |
|||
_VertexOffsetY ("Vertex OffsetY", float) = 0 |
|||
|
|||
_MaskCoord ("Mask Coordinates", vector) = (0, 0, 32767, 32767) |
|||
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) |
|||
_MaskSoftnessX ("Mask SoftnessX", float) = 0 |
|||
_MaskSoftnessY ("Mask SoftnessY", float) = 0 |
|||
|
|||
_StencilComp ("Stencil Comparison", Float) = 8 |
|||
_Stencil ("Stencil ID", Float) = 0 |
|||
_StencilOp ("Stencil Operation", Float) = 0 |
|||
_StencilWriteMask ("Stencil Write Mask", Float) = 255 |
|||
_StencilReadMask ("Stencil Read Mask", Float) = 255 |
|||
|
|||
_ColorMask ("Color Mask", Float) = 15 |
|||
} |
|||
|
|||
SubShader { |
|||
|
|||
Tags |
|||
{ |
|||
"Queue"="Overlay" |
|||
"IgnoreProjector"="True" |
|||
"RenderType"="Transparent" |
|||
} |
|||
|
|||
Stencil |
|||
{ |
|||
Ref [_Stencil] |
|||
Comp [_StencilComp] |
|||
Pass [_StencilOp] |
|||
ReadMask [_StencilReadMask] |
|||
WriteMask [_StencilWriteMask] |
|||
} |
|||
|
|||
Cull [_CullMode] |
|||
ZWrite Off |
|||
Lighting Off |
|||
Fog { Mode Off } |
|||
ZTest Always |
|||
Blend One OneMinusSrcAlpha |
|||
ColorMask [_ColorMask] |
|||
|
|||
Pass { |
|||
CGPROGRAM |
|||
#pragma target 3.0 |
|||
#pragma vertex VertShader |
|||
#pragma fragment PixShader |
|||
#pragma shader_feature __ BEVEL_ON |
|||
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER |
|||
#pragma shader_feature __ GLOW_ON |
|||
|
|||
#pragma multi_compile __ UNITY_UI_CLIP_RECT |
|||
#pragma multi_compile __ UNITY_UI_ALPHACLIP |
|||
|
|||
#include "UnityCG.cginc" |
|||
#include "UnityUI.cginc" |
|||
#include "TMPro_Properties.cginc" |
|||
#include "TMPro.cginc" |
|||
|
|||
struct vertex_t { |
|||
UNITY_VERTEX_INPUT_INSTANCE_ID |
|||
float4 position : POSITION; |
|||
float3 normal : NORMAL; |
|||
fixed4 color : COLOR; |
|||
float2 texcoord0 : TEXCOORD0; |
|||
float2 texcoord1 : TEXCOORD1; |
|||
}; |
|||
|
|||
|
|||
struct pixel_t { |
|||
UNITY_VERTEX_INPUT_INSTANCE_ID |
|||
UNITY_VERTEX_OUTPUT_STEREO |
|||
float4 position : SV_POSITION; |
|||
fixed4 color : COLOR; |
|||
float2 atlas : TEXCOORD0; // Atlas |
|||
float4 param : TEXCOORD1; // alphaClip, scale, bias, weight |
|||
float4 mask : TEXCOORD2; // Position in object space(xy), pixel Size(zw) |
|||
float3 viewDir : TEXCOORD3; |
|||
|
|||
#if (UNDERLAY_ON || UNDERLAY_INNER) |
|||
float4 texcoord2 : TEXCOORD4; // u,v, scale, bias |
|||
fixed4 underlayColor : COLOR1; |
|||
#endif |
|||
float4 textures : TEXCOORD5; |
|||
}; |
|||
|
|||
// Used by Unity internally to handle Texture Tiling and Offset. |
|||
float4 _FaceTex_ST; |
|||
float4 _OutlineTex_ST; |
|||
|
|||
pixel_t VertShader(vertex_t input) |
|||
{ |
|||
pixel_t output; |
|||
|
|||
UNITY_INITIALIZE_OUTPUT(pixel_t, output); |
|||
UNITY_SETUP_INSTANCE_ID(input); |
|||
UNITY_TRANSFER_INSTANCE_ID(input,output); |
|||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); |
|||
|
|||
float bold = step(input.texcoord1.y, 0); |
|||
|
|||
float4 vert = input.position; |
|||
vert.x += _VertexOffsetX; |
|||
vert.y += _VertexOffsetY; |
|||
|
|||
float4 vPosition = UnityObjectToClipPos(vert); |
|||
|
|||
float2 pixelSize = vPosition.w; |
|||
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); |
|||
float scale = rsqrt(dot(pixelSize, pixelSize)); |
|||
scale *= abs(input.texcoord1.y) * _GradientScale * (_Sharpness + 1); |
|||
if (UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); |
|||
|
|||
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; |
|||
weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5; |
|||
|
|||
float bias =(.5 - weight) + (.5 / scale); |
|||
|
|||
float alphaClip = (1.0 - _OutlineWidth*_ScaleRatioA - _OutlineSoftness*_ScaleRatioA); |
|||
|
|||
#if GLOW_ON |
|||
alphaClip = min(alphaClip, 1.0 - _GlowOffset * _ScaleRatioB - _GlowOuter * _ScaleRatioB); |
|||
#endif |
|||
|
|||
alphaClip = alphaClip / 2.0 - ( .5 / scale) - weight; |
|||
|
|||
#if (UNDERLAY_ON || UNDERLAY_INNER) |
|||
float4 underlayColor = _UnderlayColor; |
|||
underlayColor.rgb *= underlayColor.a; |
|||
|
|||
float bScale = scale; |
|||
bScale /= 1 + ((_UnderlaySoftness*_ScaleRatioC) * bScale); |
|||
float bBias = (0.5 - weight) * bScale - 0.5 - ((_UnderlayDilate * _ScaleRatioC) * 0.5 * bScale); |
|||
|
|||
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; |
|||
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; |
|||
float2 bOffset = float2(x, y); |
|||
#endif |
|||
|
|||
// Generate UV for the Masking Texture |
|||
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); |
|||
float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); |
|||
|
|||
// Support for texture tiling and offset |
|||
float2 textureUV = UnpackUV(input.texcoord1.x); |
|||
float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex); |
|||
float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex); |
|||
|
|||
|
|||
output.position = vPosition; |
|||
output.color = input.color; |
|||
output.atlas = input.texcoord0; |
|||
output.param = float4(alphaClip, scale, bias, weight); |
|||
output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)); |
|||
output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz); |
|||
#if (UNDERLAY_ON || UNDERLAY_INNER) |
|||
output.texcoord2 = float4(input.texcoord0 + bOffset, bScale, bBias); |
|||
output.underlayColor = underlayColor; |
|||
#endif |
|||
output.textures = float4(faceUV, outlineUV); |
|||
|
|||
return output; |
|||
} |
|||
|
|||
|
|||
fixed4 PixShader(pixel_t input) : SV_Target |
|||
{ |
|||
UNITY_SETUP_INSTANCE_ID(input); |
|||
|
|||
float c = tex2D(_MainTex, input.atlas).a; |
|||
|
|||
#ifndef UNDERLAY_ON |
|||
clip(c - input.param.x); |
|||
#endif |
|||
|
|||
float scale = input.param.y; |
|||
float bias = input.param.z; |
|||
float weight = input.param.w; |
|||
float sd = (bias - c) * scale; |
|||
|
|||
float outline = (_OutlineWidth * _ScaleRatioA) * scale; |
|||
float softness = (_OutlineSoftness * _ScaleRatioA) * scale; |
|||
|
|||
half4 faceColor = _FaceColor; |
|||
half4 outlineColor = _OutlineColor; |
|||
|
|||
faceColor.rgb *= input.color.rgb; |
|||
|
|||
faceColor *= tex2D(_FaceTex, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y); |
|||
outlineColor *= tex2D(_OutlineTex, input.textures.zw + float2(_OutlineUVSpeedX, _OutlineUVSpeedY) * _Time.y); |
|||
|
|||
faceColor = GetColor(sd, faceColor, outlineColor, outline, softness); |
|||
|
|||
#if BEVEL_ON |
|||
float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0); |
|||
float3 n = GetSurfaceNormal(input.atlas, weight, dxy); |
|||
|
|||
float3 bump = UnpackNormal(tex2D(_BumpMap, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y)).xyz; |
|||
bump *= lerp(_BumpFace, _BumpOutline, saturate(sd + outline * 0.5)); |
|||
n = normalize(n- bump); |
|||
|
|||
float3 light = normalize(float3(sin(_LightAngle), cos(_LightAngle), -1.0)); |
|||
|
|||
float3 col = GetSpecular(n, light); |
|||
faceColor.rgb += col*faceColor.a; |
|||
faceColor.rgb *= 1-(dot(n, light)*_Diffuse); |
|||
faceColor.rgb *= 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; |
|||
#endif |
|||
|
|||
#if UNDERLAY_ON |
|||
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; |
|||
faceColor += input.underlayColor * saturate(d - input.texcoord2.w) * (1 - faceColor.a); |
|||
#endif |
|||
|
|||
#if UNDERLAY_INNER |
|||
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; |
|||
faceColor += input.underlayColor * (1 - saturate(d - input.texcoord2.w)) * saturate(1 - sd) * (1 - faceColor.a); |
|||
#endif |
|||
|
|||
#if GLOW_ON |
|||
float4 glowColor = GetGlowColor(sd, scale); |
|||
faceColor.rgb += glowColor.rgb * glowColor.a; |
|||
#endif |
|||
|
|||
// Alternative implementation to UnityGet2DClipping with support for softness. |
|||
#if UNITY_UI_CLIP_RECT |
|||
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); |
|||
faceColor *= m.x * m.y; |
|||
#endif |
|||
|
|||
#if UNITY_UI_ALPHACLIP |
|||
clip(faceColor.a - 0.001); |
|||
#endif |
|||
|
|||
return faceColor * input.color.a; |
|||
} |
|||
|
|||
ENDCG |
|||
} |
|||
} |
|||
|
|||
Fallback "TextMeshPro/Mobile/Distance Field" |
|||
CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: dd89cf5b9246416f84610a006f916af7 |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |