text stringlengths 7 35.3M | id stringlengths 11 185 | metadata dict | __index_level_0__ int64 0 2.14k |
|---|---|---|---|
fileFormatVersion: 2
guid: 7bd8935dcf7359e4f80631b18901bd01
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Materials/Wall_1.mat.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Materials/Wall_1.mat.meta",
"repo_id": "jynew",
"token_count": 73
} | 762 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Animator Controller
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 7835317768930746408}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &596832278221659356
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Box_3_Animation
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: 5051f870c7809eb4d979075a75185bed,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &7835317768930746408
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 596832278221659356}
m_Position: {x: 332, y: 268, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 596832278221659356}
| jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Mess/New Animator Controller.controller/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Mess/New Animator Controller.controller",
"repo_id": "jynew",
"token_count": 877
} | 763 |
fileFormatVersion: 2
guid: 62e6893c65b64fe46adb293295fbbdba
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Bed_2.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Bed_2.prefab.meta",
"repo_id": "jynew",
"token_count": 64
} | 764 |
fileFormatVersion: 2
guid: f8736a23b2b7fd8478f9df7eaa91d4bd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Chair_1.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Chair_1.prefab.meta",
"repo_id": "jynew",
"token_count": 68
} | 765 |
fileFormatVersion: 2
guid: 85a074518cb43274397dafb84ec78717
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Drwa_1.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Drwa_1.prefab.meta",
"repo_id": "jynew",
"token_count": 62
} | 766 |
fileFormatVersion: 2
guid: 6b5d06a9a81f5e84ab11492bdce4a667
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Sark_3.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Sark_3.prefab.meta",
"repo_id": "jynew",
"token_count": 67
} | 767 |
fileFormatVersion: 2
guid: 6b87253bdaf3d40428b4508cf39d9bb8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Table_1.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Table_1.prefab.meta",
"repo_id": "jynew",
"token_count": 65
} | 768 |
fileFormatVersion: 2
guid: 95119df8699d472439be797592adaa11
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Table_7.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Table_7.prefab.meta",
"repo_id": "jynew",
"token_count": 63
} | 769 |
fileFormatVersion: 2
guid: 4003b76b4e0ea724bb999f8f44a327c2
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Tank_6.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/Common/mode_01/Prefab/Tank_6.prefab.meta",
"repo_id": "jynew",
"token_count": 67
} | 770 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8216441925397821227
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8216441925397821231}
- component: {fileID: 8216441925397821230}
- component: {fileID: 8216441925397821229}
- component: {fileID: 8216441925397821228}
m_Layer: 0
m_Name: LinShi_02
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8216441925397821231
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8216441925397821227}
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: -26.12, y: 0.84, z: -6.03}
m_LocalScale: {x: 1.0397414, y: 1.0887854, z: 1.5570171}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!33 &8216441925397821230
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8216441925397821227}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &8216441925397821229
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8216441925397821227}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 041ca5de5f6d519418e4628f80132650, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!65 &8216441925397821228
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8216441925397821227}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
| jynew/jyx2/Assets/3DScene/Model/LinShi_02.prefab/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Model/LinShi_02.prefab",
"repo_id": "jynew",
"token_count": 1216
} | 771 |
fileFormatVersion: 2
guid: f1b14c63bb0c98542aa47cfb9aa69f7c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Post_Processing/Beautify.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Beautify.meta",
"repo_id": "jynew",
"token_count": 71
} | 772 |
fileFormatVersion: 2
guid: b1d817c04f9994bf5a2b0dd93a2cf38a
timeCreated: 1462519614
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Demos/DemoSources/Terrain/New Terrain.asset.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Demos/DemoSources/Terrain/New Terrain.asset.meta",
"repo_id": "jynew",
"token_count": 75
} | 773 |
fileFormatVersion: 2
guid: 2c9183f84cef0486b87aa923c1a516c6
timeCreated: 1470912328
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Documentation/Kronnect Assets.pdf.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Documentation/Kronnect Assets.pdf.meta",
"repo_id": "jynew",
"token_count": 72
} | 774 |
fileFormatVersion: 2
guid: 2b825551194004bd0b36df9a1364b64e
timeCreated: 1466811179
licenseType: Store
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/README.txt.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/README.txt.meta",
"repo_id": "jynew",
"token_count": 71
} | 775 |
fileFormatVersion: 2
guid: 6f4f77b7f9ffd4486910b55411e3e072
timeCreated: 1488661131
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Resources/Shaders/BeautifyACESFitted.cginc.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Resources/Shaders/BeautifyACESFitted.cginc.meta",
"repo_id": "jynew",
"token_count": 81
} | 776 |
fileFormatVersion: 2
guid: 7f163b29981e24a17b9cc00713070e43
timeCreated: 1465126706
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Resources/Shaders/BeautifyMobile.shader.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Resources/Shaders/BeautifyMobile.shader.meta",
"repo_id": "jynew",
"token_count": 78
} | 777 |
fileFormatVersion: 2
guid: 54415757aaddf4b8a9cd7122fd120cc6
labels:
- Effect
- Shader
- Sharpen
- Cinematic
- Colorblind
- Color
- Bloom
timeCreated: 1462519607
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Scripts/Beautify.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Beautify/Scripts/Beautify.cs.meta",
"repo_id": "jynew",
"token_count": 129
} | 778 |
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
////////////////////////////////////////////
// CameraFilterPack - by VETASOFT 2018 /////
////////////////////////////////////////////
Shader "CameraFilterPack/3D_Anomaly" {
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_TimeX ("Time", Range(0.0, 1.0)) = 1.0
_ScreenResolution ("_ScreenResolution", Vector) = (0.,0.,0.,0.)
}
SubShader
{
Pass
{
Cull Off ZWrite Off ZTest Always
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 3.0
#pragma glsl
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
uniform sampler2D Texture2;
uniform sampler2D _CameraDepthTexture;
uniform float _TimeX;
uniform float _Value2;
uniform float _Visualize;
uniform float Anomaly_Distortion;
uniform float Anomaly_Distortion_Size;
uniform float Anomaly_Intensity;
uniform float Anomaly_Near;
uniform float Anomaly_Far;
uniform float Anomaly_With_Obj;
uniform float _FixDistance;
uniform float4 _ScreenResolution;
uniform float2 _MainTex_TexelSize;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float2 texcoord : TEXCOORD0;
float4 vertex : SV_POSITION;
float4 color : COLOR;
float4 projPos : TEXCOORD1;
float2 texcoord2 : TEXCOORD2;
};
v2f vert(appdata_t IN)
{
v2f OUT;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color;
OUT.projPos = ComputeScreenPos(OUT.vertex);
#if UNITY_UV_STARTS_AT_TOP
if (_MainTex_TexelSize.y < 0) IN.texcoord.y = 1 - IN.texcoord.y;
#endif
OUT.texcoord2 = IN.texcoord;
return OUT;
}
float4 Anomaly(float2 uv, float d)
{
float t = _Time * 20;
uv.x += sin(t + uv.y * Anomaly_Distortion_Size*0.65) / (128*d);
uv.y += cos(t + uv.x * Anomaly_Distortion_Size) / (128*d);
return tex2D(_MainTex, uv);
}
half4 _MainTex_ST;
float4 frag(v2f i) : COLOR
{
float2 uvst = UnityStereoScreenSpaceUVAdjust(i.texcoord, _MainTex_ST);
float2 uv = uvst.xy;
float2 uv2 = uvst.xy;
float4 txt = tex2D(_MainTex, uv);
float4 s= Anomaly(uv2, Anomaly_Distortion*0.25)*0.25;
s+= Anomaly(uv, Anomaly_Distortion*0.5)*0.25;
s+= Anomaly(uv, Anomaly_Distortion*0.75)*0.25;
s+= Anomaly(uv, Anomaly_Distortion)*0.25;
s *= Anomaly_Intensity;
float depth = LinearEyeDepth(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)).r);
depth /= _FixDistance * 10;
depth = saturate(depth);
depth = smoothstep(Anomaly_Near, Anomaly_Far, depth);
if (_Visualize == 1) return depth;
txt= lerp(txt, txt+s * _Value2, depth * Anomaly_With_Obj);
return txt;
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_3D_Anomaly.shader/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_3D_Anomaly.shader",
"repo_id": "jynew",
"token_count": 1058
} | 779 |
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
////////////////////////////////////////////
// CameraFilterPack - by VETASOFT 2018 /////
////////////////////////////////////////////
Shader "CameraFilterPack/3D_Shield" {
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_TimeX ("Time", Range(0.0, 1.0)) = 1.0
_Distortion ("_Distortion", Range(0.0, 1.00)) = 1.0
_ScreenResolution ("_ScreenResolution", Vector) = (0.,0.,0.,0.)
_ColorRGB ("_ColorRGB", Color) = (1,1,1,1)
}
SubShader
{
Pass
{
Cull Off ZWrite Off ZTest Always
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 3.0
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
uniform float _Visualize;
uniform float _TimeX;
uniform float _Distortion;
uniform float4 _ScreenResolution;
uniform float4 _ColorRGB;
uniform float _Near;
uniform float _Far;
uniform float _FarCamera;
uniform sampler2D _CameraDepthTexture;
uniform float _FixDistance;
uniform float _LightIntensity;
uniform float _FadeShield;
uniform float2 _MainTex_TexelSize;
uniform float _Value;
uniform float _Value2;
uniform float _Value3;
uniform float _Value4;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float2 texcoord : TEXCOORD0;
float4 vertex : SV_POSITION;
float4 color : COLOR;
float4 projPos : TEXCOORD1;
};
v2f vert(appdata_t IN)
{
v2f OUT;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color;
OUT.projPos = ComputeScreenPos(OUT.vertex);
return OUT;
}
float col(float2 coord)
{
float time = _TimeX*1.3;
float delta_theta = 0.89759790102565521;
float col = 0.0;
float theta = 0.0;
for (int i = 0; i < 8; i++)
{
float2 adjc = coord;
theta = delta_theta*float(i);
adjc.x += cos(theta)*time*_Value + time * _Value2;
adjc.y -= sin(theta)*time*_Value - time * _Value3;
col = col + cos((adjc.x*cos(theta) - adjc.y*sin(theta))*6.0)*_Value4;
}
return cos(col);
}
float4 Fx(float2 uv)
{
float2 p = uv, c1 = p, c2 = p;
float cc1 = col(c1);
c2.x += 8.53;
float dx = 0.50*(cc1 - col(c2)) / 60;
c2.x = p.x;
c2.y += 8.53;
float dy = 0.50*(cc1 - col(c2)) / 60;
c1.x += dx*2.;
c1.y = (c1.y + dy*2.);
float alpha = 1. + dot(dx,dy) * 700;
float ddx = dx - 0.012;
float ddy = dy - 0.012;
if (ddx > 0. && ddy > 0.) alpha = pow(alpha, ddx*ddy * 200000);
float4 col = tex2D(_MainTex,c1)*(alpha);
return col;
}
half4 _MainTex_ST;
float4 frag(v2f i) : COLOR
{
float2 uvst = UnityStereoScreenSpaceUVAdjust(i.texcoord, _MainTex_ST);
float2 uv = uvst.xy;
float depth = LinearEyeDepth (tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)).r);
depth/=_FixDistance*10;
float ss=smoothstep(_Near, saturate(_Near+_Far), depth);
depth = ss;
if (_Visualize == 1) return depth;
float4 txt = tex2D(_MainTex, uv);
float4 txt2 = Fx(uv)*_LightIntensity;
txt2 = lerp(txt, txt2, _FadeShield);
//_FadeShield
txt = lerp(txt,txt2,depth);
return txt;
}
ENDCG
}
}
} | jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_3D_Shield.shader/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_3D_Shield.shader",
"repo_id": "jynew",
"token_count": 1268
} | 780 |
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
////////////////////////////////////////////
// CameraFilterPack - by VETASOFT 2018 /////
////////////////////////////////////////////
Shader "CameraFilterPack/Distortion_ShockWave" {
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_TimeX ("Time", Range(0.0, 1.0)) = 1.0
_ScreenResolution ("_ScreenResolution", Vector) = (0.,0.,0.,0.)
}
SubShader
{
Pass
{
Cull Off ZWrite Off ZTest Always
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 3.0
#pragma glsl
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
uniform float _TimeX;
uniform float _Value;
uniform float _Value2;
uniform float _Value3;
uniform float4 _ScreenResolution;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float2 texcoord : TEXCOORD0;
float4 vertex : SV_POSITION;
float4 color : COLOR;
};
v2f vert(appdata_t IN)
{
v2f OUT;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color;
return OUT;
}
half4 _MainTex_ST;
float4 frag(v2f i) : COLOR
{
float2 uvst = UnityStereoScreenSpaceUVAdjust(i.texcoord, _MainTex_ST);
float time=_TimeX*_Value3;
float offset = (time- floor(time))/time;
float CurrentTime = (time)*(offset);
float3 WaveParams = float3(10.0, 0.8, 0.1);
float2 WaveCentre = float2(_Value, _Value2);
float2 texCoord = uvst.xy ;
float Dist = distance(texCoord, WaveCentre);
float ScaleDiff = 1.0;
float Change=0;
if ((Dist <= ((CurrentTime) + (WaveParams.z))) &&
(Dist >= ((CurrentTime) - (WaveParams.z))))
{
float Diff = (Dist - CurrentTime);
ScaleDiff = (1.0 - pow(abs(Diff * WaveParams.x), WaveParams.y));
float DiffTime = (Diff * ScaleDiff);
float2 DiffTexCoord = normalize(texCoord - WaveCentre);
Change=1;
texCoord += ((DiffTexCoord * DiffTime) / (CurrentTime * Dist * 40.0));
}
float4 Color = tex2D(_MainTex, texCoord);
Color += ((Color * ScaleDiff) / (CurrentTime * Dist * 40.0))*Change;
return Color;
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_Distortion_ShockWave.shader/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_Distortion_ShockWave.shader",
"repo_id": "jynew",
"token_count": 823
} | 781 |
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
////////////////////////////////////////////
// CameraFilterPack - by VETASOFT 2018 /////
////////////////////////////////////////////
Shader "CameraFilterPack/Edge_Sigmoid" {
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_TimeX ("Time", Range(0.0, 1.0)) = 1.0
_Distortion ("_Distortion", Range(0.0, 1.0)) = 0.3
_ScreenResolution ("_ScreenResolution", Vector) = (0.,0.,0.,0.)
_Gain ("_Gain", Range(1.0, 10.0)) = 3.0
}
SubShader
{
Pass
{
Cull Off ZWrite Off ZTest Always
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 3.0
#pragma glsl
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
uniform float _TimeX;
uniform float _Distortion;
uniform float4 _ScreenResolution;
uniform float _Gain;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float2 texcoord : TEXCOORD0;
float4 vertex : SV_POSITION;
float4 color : COLOR;
};
v2f vert(appdata_t IN)
{
v2f OUT;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color;
return OUT;
}
#define tex2D(sampler,uvs) tex2Dlod( sampler , float4( ( uvs ) , 0.0f , 0.0f) )
half4 _MainTex_ST;
float4 frag(v2f i) : COLOR
{
float2 uvst = UnityStereoScreenSpaceUVAdjust(i.texcoord, _MainTex_ST);
float2 uv = uvst.xy;
float2 p = 1.0 / _ScreenResolution.xy;
float4 colorSum = float4(0,0,0,0);
for(int a = -1.0 ; a <= 1.0 ; a ++) {
for(int b = -1.0 ; b <= 1.0 ; b ++) {
if(b == 0.0 && a == 0.0) colorSum += tex2D(_MainTex, uv + p * float2(b,a)) * 8.0;
else colorSum += tex2D(_MainTex, uv + p * float2(b,a)) * -1.0;
}
}
float3 c = colorSum.rgb;
float avg = (c.r+c.g+c.b)/ (10- _Gain);
float v = (1.0 - (1.0 / (1.0 + exp( -9.0 * (avg-0.18) )))) * 2.0;
return float4(v,v,v,1.0);
}
ENDCG
}
}
} | jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_Edge_Sigmoid.shader/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_Edge_Sigmoid.shader",
"repo_id": "jynew",
"token_count": 843
} | 782 |
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
////////////////////////////////////////////
// CameraFilterPack - by VETASOFT 2018 /////
////////////////////////////////////////////
Shader "CameraFilterPack/Pixelisation_OilPaintHQ" {
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_TimeX ("Time", Range(0.0, 1.0)) = 1.0
_Distortion ("_Distortion", Range(0.0, 1.0)) = 0.3
_ScreenResolution ("_ScreenResolution", Vector) = (0.,0.,0.,0.)
_Value ("_Value", Range(0.0, 5.0)) = 1.0
}
SubShader
{
Pass
{
Cull Off ZWrite Off ZTest Always
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 3.0
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
uniform float _TimeX;
uniform float _Distortion;
uniform float4 _ScreenResolution;
uniform float _Value;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float2 texcoord : TEXCOORD0;
float4 vertex : SV_POSITION;
float4 color : COLOR;
};
v2f vert(appdata_t IN)
{
v2f OUT;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color;
return OUT;
}
half4 _MainTex_ST;
float4 frag(v2f i) : COLOR
{
float2 uvst = UnityStereoScreenSpaceUVAdjust(i.texcoord, _MainTex_ST);
float2 src_size = float2 (_Value/ _ScreenResolution.x, _Value / _ScreenResolution.y);
float2 uv = uvst.xy;
float n = 25.;
float3 m0 = 0.0; float3 m2 = 0.0;
float3 s0 = 0.0; float3 s2 = 0.0;
float3 c;
c = tex2D(_MainTex, uv + float2(-4.,-4.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(0,0) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-3.,-3.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(1,0) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-2.,-2.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(2,0) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-1.,-4.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(3,0) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(0.,0-4.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(4.,0) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-4.,-3.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(0.,1.) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-3.,-3.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(1.,1.) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-2.,-3.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(2.,1.) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-1.,-3.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(3.,1.) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(0.,-3.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(4.,1) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-4.,-2.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(0,2) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-3.,-2.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(1,2) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-2.,-3.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(2,2) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-1.,-2.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(3,2) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(0.,-2.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(4,2) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-4.,-1.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(0,3) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-3.,-1.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(1,3) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-2.,-1.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(2,3) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-1.,-1.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(3,3) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(0.,-1.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(4,3) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-4.,0.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(0,4) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-3.,0.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(1,4) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-2.,0.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(2,4) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(-1.,0.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(3,4) * src_size).rgb; m2 += c; s2 += c * c;
c = tex2D(_MainTex, uv + float2(0.,0.) * src_size).rgb; m0 += c; s0 += c * c;
c = tex2D(_MainTex, uv + float2(4,4) * src_size).rgb; m2 += c; s2 += c * c;
float4 ccolor = 0.;
float min_sigma2 = 1e+2;
m0 /= n;
s0 = abs(s0 / n - m0 * m0);
float sigma2 = s0.r + s0.g + s0.b;
if (sigma2 < min_sigma2) {
min_sigma2 = sigma2;
ccolor = float4(m0, 1.0);
}
m2 /= n;
s2 = abs(s2 / n - m2 * m2);
sigma2 = s2.r + s2.g + s2.b;
if (sigma2 < min_sigma2) {
min_sigma2 = sigma2;
ccolor = float4(m2, 1.0);
}
return ccolor;
}
ENDCG
}
}
} | jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_Pixelisation_OilPaintHQ.shader/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Resources/CameraFilterPack_Pixelisation_OilPaintHQ.shader",
"repo_id": "jynew",
"token_count": 2885
} | 783 |
fileFormatVersion: 2
guid: 433565f361c269d4f8a44e03e9f6a383
timeCreated: 1467727719
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Scripts/CameraFilterPack_3D_Shield.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Scripts/CameraFilterPack_3D_Shield.cs.meta",
"repo_id": "jynew",
"token_count": 102
} | 784 |
fileFormatVersion: 2
guid: 50d75f1fc5302e940a4ede097f359d8a
timeCreated: 1466779591
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Scripts/CameraFilterPack_Atmosphere_Rain_Pro_3D.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Scripts/CameraFilterPack_Atmosphere_Rain_Pro_3D.cs.meta",
"repo_id": "jynew",
"token_count": 101
} | 785 |
fileFormatVersion: 2
guid: a75ab5c96999e71499ae139ea5b00657
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
| jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Scripts/CameraFilterPack_Distortion_Heat.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Scripts/CameraFilterPack_Distortion_Heat.cs.meta",
"repo_id": "jynew",
"token_count": 68
} | 786 |
fileFormatVersion: 2
guid: f781a87b9b71ff2499a64018f6a1c875
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
| jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Scripts/CameraFilterPack_Drawing_Toon.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/Camera Filter Pack/Scripts/CameraFilterPack_Drawing_Toon.cs.meta",
"repo_id": "jynew",
"token_count": 71
} | 787 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 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: 8e6292b2c06870d4495f009f912b9600, type: 3}
m_Name: Chengzhen
m_EditorClassIdentifier:
settings:
- {fileID: 114899902007708758}
- {fileID: 114361612118441822}
--- !u!114 &114361612118441822
MonoBehaviour:
m_ObjectHideFlags: 3
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: c1cb7e9e120078f43bce4f0b1be547a7, type: 3}
m_Name: AmbientOcclusion
m_EditorClassIdentifier:
active: 0
enabled:
overrideState: 1
value: 1
mode:
overrideState: 0
value: 1
intensity:
overrideState: 1
value: 0
color:
overrideState: 0
value: {r: 0, g: 0, b: 0, a: 1}
ambientOnly:
overrideState: 0
value: 1
noiseFilterTolerance:
overrideState: 0
value: 0
blurTolerance:
overrideState: 0
value: -4.6
upsampleTolerance:
overrideState: 0
value: -12
thicknessModifier:
overrideState: 0
value: 1
directLightingStrength:
overrideState: 0
value: 0
radius:
overrideState: 0
value: 0.25
quality:
overrideState: 0
value: 2
--- !u!114 &114899902007708758
MonoBehaviour:
m_ObjectHideFlags: 3
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: 48a79b01ea5641d4aa6daa2e23605641, type: 3}
m_Name: Bloom
m_EditorClassIdentifier:
active: 0
enabled:
overrideState: 1
value: 1
intensity:
overrideState: 1
value: 4
threshold:
overrideState: 0
value: 0.4
softKnee:
overrideState: 0
value: 0
clamp:
overrideState: 0
value: 0
diffusion:
overrideState: 0
value: 10
anamorphicRatio:
overrideState: 0
value: -1
color:
overrideState: 0
value: {r: 1, g: 1, b: 1, a: 1}
fastMode:
overrideState: 0
value: 0
dirtTexture:
overrideState: 0
value: {fileID: 0}
defaultState: 1
dirtIntensity:
overrideState: 0
value: 0
| jynew/jyx2/Assets/3DScene/Post_Processing/ScenePostProcess/Chengzhen.asset/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Post_Processing/ScenePostProcess/Chengzhen.asset",
"repo_id": "jynew",
"token_count": 1068
} | 788 |
fileFormatVersion: 2
guid: 331da34aba910614395cc34e2be5aa5c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Prefabs/BigTable2.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Prefabs/BigTable2.prefab.meta",
"repo_id": "jynew",
"token_count": 63
} | 789 |
Shader "Custom/SceneSufWith5tetures" {
Properties{
_Glossiness("Smoothness", Range(0,1)) = 0.5
_Metallic("Metallic", Range(0,1)) = 0.0
_ControlTex("ControlTex", 2D) = "white"{}
_RChannelTex("RChannelTex", 2D) = "white"{}
_GChannelTex("GChannelTex", 2D) = "white"{}
_BChannelTex("BChannelTex", 2D) = "white"{}
_AChannelTex("AChannelTex", 2D) = "white"{}
_Color("Main Color",color) = (1,1,1,1)
_Outline("Thick of Outline",range(0,0.5)) = 0.03//挤出描边的粗细
_Factor("Factor",range(0,1)) = 0.5//挤出多远
_OutColor("OutColor",color) = (0,0,0,0)
_ToonEffect("Toon Effect",range(0,1)) = 0.5
_Steps("Steps of toon",range(0,9)) = 3
_RimPower("RimPower",range(0,1)) = 1
_ToonRimStep("ToonRimStep",range(0,5)) = 1
}
SubShader{
Tags{ "Queue" = "Geometry" "RenderType" = "Opaque"}
pass {//处理光照前的pass渲染
Tags{ "LightMode" = "Always" }
Cull Front
ZWrite On
CGPROGRAM
#pragma multi_compile_fog
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float _Outline;
float _Factor;
fixed4 _OutColor;
struct v2f {
float4 pos:SV_POSITION;
UNITY_FOG_COORDS(0)
};
v2f vert(appdata_full v) {
v2f o;
float3 dir = normalize(v.vertex.xyz);
float3 dir2 = v.normal;
float D = dot(dir,dir2);
dir = dir * sign(D);
dir = dir * _Factor + dir2 * (1 - _Factor);
v.vertex.xyz += dir * _Outline;
o.pos = UnityObjectToClipPos(v.vertex);
UNITY_TRANSFER_FOG(o, o.pos);
return o;
}
float4 frag(v2f i) :COLOR
{
float4 c = _OutColor;
UNITY_APPLY_FOG(i.fogCoord, c);
return c;
}
ENDCG
}
CGPROGRAM
#include "UnityPBSLighting.cginc"
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Cartoon addshadow //vertex:vert
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
struct Input
{
//float2 uv_MainTex;
float2 uv_ControlTex;
//float2 uv_RChannelTex;
//float2 uv_GChannelTex;
//float2 uv_BChannelTex;
//float2 uv_AChannelTex;
float3 normal:TEXCOORD1;
};
fixed4 _Color;
float _Steps;
float _ToonEffect;
sampler2D _ControlTex;
sampler2D _RChannelTex;
sampler2D _GChannelTex;
sampler2D _BChannelTex;
sampler2D _AChannelTex;
//float4 _ControlTex_ST;
float4 _RChannelTex_ST;
float4 _GChannelTex_ST;
float4 _BChannelTex_ST;
float4 _AChannelTex_ST;
float _RimPower;
float _ToonRimStep;
// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
// #pragma instancing_options assumeuniformscaling
UNITY_INSTANCING_BUFFER_START(Props)
// put more per-instance properties here
UNITY_INSTANCING_BUFFER_END(Props)
inline float4 LightingCartoon(SurfaceOutputStandard s, fixed3 lightDir, fixed3 viewDir, fixed atten)
{
//暂时光的方向反了,使用了-normalize(lightDir)
float difLight = max(0, dot(normalize(s.Normal), normalize(lightDir)));
difLight = (difLight + 1) / 2;//做亮化处理
difLight = smoothstep(0, 1, difLight);//使颜色平滑的在[0,1]范围之内
float toon = floor(difLight * _Steps) / _Steps;//把颜色做离散化处理,把diffuse颜色限制在_Steps种(_Steps阶颜色),简化颜色,这样的处理使色阶间能平滑的显示
difLight = lerp(difLight, toon, _ToonEffect);//根据外部我们可控的卡通化程度值_ToonEffect,调节卡通与现实的比重
float4 col;
col.rgb = s.Albedo * _LightColor0.rgb * difLight * atten;
col.a = s.Alpha;
return col;
}
void surf(Input IN, inout SurfaceOutputStandard o)
{
// Albedo comes from a texture tinted by color
float4 _control_val = tex2D(_ControlTex, IN.uv_ControlTex);
//float4 _control_val = tex2D(_ControlTex, TRANSFORM_TEX(IN.uv0, _ControlTex));
float4 _R_var = tex2D(_RChannelTex, TRANSFORM_TEX(IN.uv_ControlTex, _RChannelTex));
float4 _G_var = tex2D(_GChannelTex, TRANSFORM_TEX(IN.uv_ControlTex, _GChannelTex));
float4 _B_var = tex2D(_BChannelTex, TRANSFORM_TEX(IN.uv_ControlTex, _BChannelTex));
float4 _A_var = tex2D(_AChannelTex, TRANSFORM_TEX(IN.uv_ControlTex, _AChannelTex));
float3 diffuseColor = ((_R_var.rgb*_control_val.r) + (_G_var.rgb*_control_val.g) + (_B_var.rgb*_control_val.b) + (_A_var.rgb*_control_val.a));
fixed4 c = float4(diffuseColor,1.0) * _Color;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
| jynew/jyx2/Assets/3DScene/Shader/SceneSufWith5tetures.shader/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Shader/SceneSufWith5tetures.shader",
"repo_id": "jynew",
"token_count": 2351
} | 790 |
fileFormatVersion: 2
guid: b59628e42752a47e78c091a5b1ecc8cc
timeCreated: 1425943321
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/SkyBox/Day Sun Mid EpicHigh/Day Sun Mid EpicHigh/LightmapSnapshot.asset.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/SkyBox/Day Sun Mid EpicHigh/Day Sun Mid EpicHigh/LightmapSnapshot.asset.meta",
"repo_id": "jynew",
"token_count": 74
} | 791 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Day Sun Peak Summersky
m_Shader: {fileID: 104, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BackTex:
m_Texture: {fileID: 2800000, guid: 3097e17e6ebbf465db13669a3dc2f897, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DownTex:
m_Texture: {fileID: 2800000, guid: fb7215b5778634ddc8a684da372985bb, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FrontTex:
m_Texture: {fileID: 2800000, guid: 8aa1d0089e7344984a044ad614b5eb2c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LeftTex:
m_Texture: {fileID: 2800000, guid: f83add4dadcf847cdbb6403b76ccf0fe, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _RightTex:
m_Texture: {fileID: 2800000, guid: d49d181427dc944aba6f5dec71b37a23, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _UpTex:
m_Texture: {fileID: 2800000, guid: 214d6273083da4e2ab66a16c9b644edb, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _Exposure: 0.91
- _Rotation: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Tint: {r: 0.509434, g: 0.509434, b: 0.509434, a: 0.5}
| jynew/jyx2/Assets/3DScene/SkyBox/Day Sun Peak Summersky/Day Sun Peak Summersky.mat/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/SkyBox/Day Sun Peak Summersky/Day Sun Peak Summersky.mat",
"repo_id": "jynew",
"token_count": 962
} | 792 |
fileFormatVersion: 2
guid: c335679efa83b4469892ab8088af0246
NativeFormatImporter:
userData:
| jynew/jyx2/Assets/3DScene/SkyBox/Fantasy High/FantasyClouds2_High.mat.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/SkyBox/Fantasy High/FantasyClouds2_High.mat.meta",
"repo_id": "jynew",
"token_count": 39
} | 793 |
fileFormatVersion: 2
guid: 9c476468205a5fe488dec78ccfdad824
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/SkyBox/Sky_01/Sky_01.mat.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/SkyBox/Sky_01/Sky_01.mat.meta",
"repo_id": "jynew",
"token_count": 71
} | 794 |
fileFormatVersion: 2
guid: c8a24b0d03dc1d14a85d6de0006e91dd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Stylized Ground Textures/Assets/Textures/SGT_Ice_1.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Stylized Ground Textures/Assets/Textures/SGT_Ice_1.meta",
"repo_id": "jynew",
"token_count": 72
} | 795 |
fileFormatVersion: 2
guid: 1622755458d38a0448b51420fa62556a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Stylized Ground Textures/Assets/Textures/SGT_Snow_1.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Stylized Ground Textures/Assets/Textures/SGT_Snow_1.meta",
"repo_id": "jynew",
"token_count": 66
} | 796 |
fileFormatVersion: 2
guid: 766ea0cab8175c047a56be6ac325aaf0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/Stylized Ground Textures/Demo/Ground.mat.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Stylized Ground Textures/Demo/Ground.mat.meta",
"repo_id": "jynew",
"token_count": 74
} | 797 |
fileFormatVersion: 2
guid: 8dbd1015cc47abb429b9774bee2f3b14
timeCreated: 1523534161
licenseType: Store
ModelImporter:
serializedVersion: 19
fileIDToRecycleName:
100000: //RootNode
100002: SWS_ParticleOctagon
100004: SWS_ParticleQuad
100006: SWS_ParticleSphere
100008: SWS_ParticleSplashCone
100010: SWS_ParticleSplashDunk
100012: SWS_ParticleSplashCone_High
100014: SWS_ParticleSplashCone_Low
400000: //RootNode
400002: SWS_ParticleOctagon
400004: SWS_ParticleQuad
400006: SWS_ParticleSphere
400008: SWS_ParticleSplashCone
400010: SWS_ParticleSplashDunk
400012: SWS_ParticleSplashCone_High
400014: SWS_ParticleSplashCone_Low
2300000: SWS_ParticleOctagon
2300002: SWS_ParticleQuad
2300004: SWS_ParticleSphere
2300006: SWS_ParticleSplashCone
2300008: SWS_ParticleSplashDunk
2300010: SWS_ParticleSplashCone_High
2300012: SWS_ParticleSplashCone_Low
3300000: SWS_ParticleOctagon
3300002: SWS_ParticleQuad
3300004: SWS_ParticleSphere
3300006: SWS_ParticleSplashCone
3300008: SWS_ParticleSplashDunk
3300010: SWS_ParticleSplashCone_High
3300012: SWS_ParticleSplashCone_Low
4300000: SWS_ParticleSplashCone
4300002: SWS_ParticleSplashDunk
4300004: SWS_ParticleSphere
4300006: SWS_ParticleQuad
4300008: SWS_ParticleOctagon
4300010: SWS_ParticleSplashCone_High
4300012: SWS_ParticleSplashCone_Low
9500000: //RootNode
materials:
importMaterials: 0
materialName: 0
materialSearch: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importBlendShapes: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
importAnimation: 1
copyAvatar: 0
humanDescription:
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
hasTranslationDoF: 0
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 2
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/StylizedWater/Effects/Models/SWS_ParticleMeshes.fbx.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/StylizedWater/Effects/Models/SWS_ParticleMeshes.fbx.meta",
"repo_id": "jynew",
"token_count": 1263
} | 798 |
fileFormatVersion: 2
guid: 825d578ba24f0f948b3d9cd2f0167efa
folderAsset: yes
timeCreated: 1473343906
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/StylizedWater/Scripts.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/StylizedWater/Scripts.meta",
"repo_id": "jynew",
"token_count": 78
} | 799 |
fileFormatVersion: 2
guid: 489ee10a2d5b5bc4e91f5d9e08c5dd87
timeCreated: 1519488540
licenseType: Store
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/StylizedWater/Scripts/Textures/Heightmap/Readme.txt.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/StylizedWater/Scripts/Textures/Heightmap/Readme.txt.meta",
"repo_id": "jynew",
"token_count": 77
} | 800 |
fileFormatVersion: 2
guid: 7c6ed8f96e12b5f49a8b098f5a02ef79
timeCreated: 1519561286
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/StylizedWater/Scripts/Textures/SWS_Resources.asset.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/StylizedWater/Scripts/Textures/SWS_Resources.asset.meta",
"repo_id": "jynew",
"token_count": 77
} | 801 |
fileFormatVersion: 2
guid: 335c2fd4b5d96674d8eb76ef2e225b70
timeCreated: 1520592108
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/StylizedWater/_Demo/DemoAssets/Materials/SWS_DemoRocks.mat.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/StylizedWater/_Demo/DemoAssets/Materials/SWS_DemoRocks.mat.meta",
"repo_id": "jynew",
"token_count": 73
} | 802 |
fileFormatVersion: 2
guid: fadc4bb64c715fc4da2033cd26074681
timeCreated: 1520592206
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/StylizedWater/_Demo/DemoAssets/Prefabs/SWS_DemoRock_E.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/StylizedWater/_Demo/DemoAssets/Prefabs/SWS_DemoRock_E.prefab.meta",
"repo_id": "jynew",
"token_count": 71
} | 803 |
fileFormatVersion: 2
guid: b56c186fcd781b54eafcd22192812439
timeCreated: 1473344108
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/StylizedWater/_Demo/IslandDemo/SWS_IslandDemo_Material.mat.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/StylizedWater/_Demo/IslandDemo/SWS_IslandDemo_Material.mat.meta",
"repo_id": "jynew",
"token_count": 69
} | 804 |
fileFormatVersion: 2
guid: afcfc45640c223a4e97eebc2bccbaeda
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName: base_assets
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/TileWorldCreator.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/TileWorldCreator.meta",
"repo_id": "jynew",
"token_count": 70
} | 805 |
fileFormatVersion: 2
guid: d3302c4363bd388419b9c7c00dd8e6f8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/TileWorldCreator/46_Jinsheshandong.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/TileWorldCreator/46_Jinsheshandong.prefab.meta",
"repo_id": "jynew",
"token_count": 68
} | 806 |
fileFormatVersion: 2
guid: a45bff51fc6ef8946bfaf2aceda459e1
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/TileWorldCreator/TWC_World.prefab.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/TileWorldCreator/TWC_World.prefab.meta",
"repo_id": "jynew",
"token_count": 64
} | 807 |
fileFormatVersion: 2
guid: 134296e0ae5487f4f8b6bc42caf984f0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/TileWorldCreator/_Art/_Presets/CliffIsland/Prefab/Color_02.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/TileWorldCreator/_Art/_Presets/CliffIsland/Prefab/Color_02.meta",
"repo_id": "jynew",
"token_count": 72
} | 808 |
fileFormatVersion: 2
guid: 5fb7c560bafcd264b8fc12c3564d5301
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/TileWorldCreator/_Art/_Presets/CliffIsland/_materials/xxx5.mat.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/TileWorldCreator/_Art/_Presets/CliffIsland/_materials/xxx5.mat.meta",
"repo_id": "jynew",
"token_count": 58
} | 809 |
fileFormatVersion: 2
guid: 2bd5bb261ba069544b92375ab5a313e2
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3DScene/TileWorldCreator/_Art/_Presets/CliffIsland/_materials/xxz4.mat.meta/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/TileWorldCreator/_Art/_Presets/CliffIsland/_materials/xxz4.mat.meta",
"repo_id": "jynew",
"token_count": 58
} | 810 |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lightbeam_FineRays 1
m_Shader: {fileID: 4800000, guid: 79106dab3a35a0a419b04f934b8806a2, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _DetailTex:
m_Texture: {fileID: 2800000, guid: 6c196bbd8ff74c243a08b8fc829d2e7d, type: 3}
m_Scale: {x: 3, y: 0.0001}
m_Offset: {x: 0, y: 0}
- _DustTex:
m_Texture: {fileID: 2800000, guid: e06b85a502453e14bb6f5309a19b97bb, type: 3}
m_Scale: {x: 2, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 14c8129763bbee44db152889f20d7186, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex2:
m_Texture: {fileID: 2800000, guid: 8ff2a79fd69e5ff46acd2a6c44740cf9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ColorMultiplier: 1
- _DetailContrast: 1
- _DustContrast: 1
- _FadeDistance: 2
- _SoftEdge: 1
- _Tweak: 5
- _Width: 2.35
m_Colors:
- _Color: {r: 0.9811321, g: 0.94996405, b: 0.72659314, a: 0.49803922}
- _DetailAnim: {r: 0, g: 1, b: 0, a: 0}
- _DustAnim: {r: 0, g: 0, b: 0, a: 0}
| jynew/jyx2/Assets/3DScene/Volumetric Light/Lightbeam_FineRays 1.mat/0 | {
"file_path": "jynew/jyx2/Assets/3DScene/Volumetric Light/Lightbeam_FineRays 1.mat",
"repo_id": "jynew",
"token_count": 814
} | 811 |
using UnityEngine;
using UnityEditor;
using UnityEditor.ProjectWindowCallback;
namespace AmplifyShaderEditor
{
//Callback on asset creation to open window after finishing renaming the asset
public class DoCreateFunction : EndNameEditAction
{
public override void Action( int instanceId, string pathName, string resourceFile )
{
UnityEngine.Object obj = EditorUtility.InstanceIDToObject( instanceId );
AssetDatabase.CreateAsset( obj, AssetDatabase.GenerateUniqueAssetPath( pathName ) );
AmplifyShaderEditorWindow.LoadShaderFunctionToASE( (AmplifyShaderFunction)obj, false );
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/DoCreateFunction.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/DoCreateFunction.cs",
"repo_id": "jynew",
"token_count": 171
} | 812 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using UnityEngine;
namespace AmplifyShaderEditor
{
public enum AutoPanLocation
{
TOP = 0,
BOTTOM,
LEFT,
RIGHT
}
public class AutoPanData
{
private Rect m_area;
private float m_size;
private Vector2 m_velocity;
private GUIStyle m_style;
private Color m_color = new Color( 1f, 0f, 0f, 0.5f );
private AutoPanLocation m_location;
private float m_adjustWidth = 0;
private float m_adjustInitialX = 0;
public AutoPanData( AutoPanLocation location, float size, Vector2 vel )
{
m_area = new Rect();
m_size = size;
m_velocity = vel;
m_location = location;
}
public bool CheckArea( Vector2 mousePosition, Rect window, bool draw )
{
float totalSize = m_size + m_adjustWidth;
switch ( m_location )
{
case AutoPanLocation.TOP:
{
m_area.x = m_adjustInitialX;
m_area.y = 0;
m_area.width = window.width;
m_area.height = totalSize;
}
break;
case AutoPanLocation.BOTTOM:
{
m_area.x = m_adjustInitialX;
m_area.y = window.height - totalSize;
m_area.width = window.width;
m_area.height = totalSize;
}
break;
case AutoPanLocation.LEFT:
{
m_area.x = m_adjustInitialX;
m_area.y = 0;
m_area.width = totalSize;
m_area.height = window.height;
}
break;
case AutoPanLocation.RIGHT:
{
m_area.x = m_adjustInitialX + window.width - totalSize;
m_area.y = 0;
m_area.width = totalSize;
m_area.height = window.height;
}
break;
}
if ( draw )
{
if ( m_style == null )
{
m_style = UIUtils.Box;
}
Color bufferedColor = GUI.color;
GUI.color = m_color;
GUI.Label( m_area, string.Empty, m_style );
GUI.color = bufferedColor;
}
return m_area.Contains( mousePosition );
}
public float AdjustWidth { set { m_adjustWidth = value; } }
public float AdjustInitialX { set { m_adjustInitialX = value; } }
public Vector2 Velocity { get { return m_velocity; } }
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Menu/AutoPanData.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Menu/AutoPanData.cs",
"repo_id": "jynew",
"token_count": 927
} | 813 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using System;
using System.Collections.Generic;
using UnityEngine;
namespace AmplifyShaderEditor
{
[Serializable]
public class DuplicatePreventionBuffer
{
private const string VectorNameStr = "Vector ";
private const string TextureSampleNameStr = "Texture Sample ";
private const string MatrixNameStr = "Matrix ";
private const string IntNameStr = "Int ";
private const string FloatNameStr = "Float ";
private const string ColorNameStr = "Color ";
[SerializeField]
private int[] m_availableUVChannelsArray = { -1, -1, -1, -1 };
private string[] m_availableUVChannelsNamesArray = { "null",
"null",
"null",
"null" };
private Dictionary<string, int> m_availablePropertyNames = new Dictionary<string, int>();
private Dictionary<string, int> m_availableUniformNames = new Dictionary<string, int>();
private Dictionary<string, int> m_availableLocalVariableNames = new Dictionary<string, int>();
public void ReleaseAllUVChannels()
{
for ( int i = 0; i < m_availableUVChannelsArray.Length; i++ )
{
m_availableUVChannelsArray[ i ] = -1;
}
}
public bool RegisterUVChannel( int nodeId, int channelId, string name )
{
if ( channelId < 0 ||
channelId > ( m_availableUVChannelsArray.Length - 1 ) ||
m_availableUVChannelsArray[ channelId ] >= 0 )
{
return false;
}
m_availableUVChannelsArray[ channelId ] = nodeId;
m_availableUVChannelsNamesArray[ channelId ] = name;
return true;
}
public bool ReleaseUVChannel( int nodeId, int channelId )
{
if ( channelId < 0 ||
channelId > ( m_availableUVChannelsArray.Length - 1 ) )
{
return false;
}
if ( m_availableUVChannelsArray[ channelId ] == nodeId )
{
m_availableUVChannelsArray[ channelId ] = -1;
return true;
}
return false;
}
public int RegisterFirstAvailableChannel( int nodeId , string name)
{
for ( int i = 0; i < m_availableUVChannelsArray.Length; i++ )
{
if ( m_availableUVChannelsArray[ i ] == -1 )
{
m_availableUVChannelsArray[ i ] = nodeId;
m_availableUVChannelsNamesArray[ i ] = name;
return i;
}
}
return -1;
}
public bool IsChannelAvailable( int channelId )
{
if ( channelId < 0 ||
channelId > ( m_availableUVChannelsArray.Length - 1 ) )
{
return false;
}
return ( m_availableUVChannelsArray[ channelId ] < 0 );
}
public int GetFirstOccupiedChannel()
{
for ( int i = 0; i < 4; i++ )
{
if ( m_availableUVChannelsArray[ i ] > -1 )
return i;
}
return -1;
}
public string GetChannelName( int channelId )
{
if ( channelId < 0 ||
channelId > ( m_availableUVChannelsArray.Length - 1 ) )
{
return string.Empty;
}
return m_availableUVChannelsNamesArray[ channelId ] ;
}
public void SetChannelName( int channelId , string name )
{
if ( channelId < 0 ||
channelId > ( m_availableUVChannelsArray.Length - 1 ) )
{
return;
}
m_availableUVChannelsNamesArray[ channelId ] = name;
}
public bool RegisterLocalVariableName( int nodeId, string name )
{
if ( name.Length == 0 )
return false;
if ( m_availableLocalVariableNames.ContainsKey( name ) )
{
if ( m_availableLocalVariableNames[ name ] > -1 )
{
return false;
}
else
{
m_availableLocalVariableNames[ name ] = nodeId;
return true;
}
}
m_availableLocalVariableNames.Add( name, nodeId );
return true;
}
public int CheckUniformNameOwner( string name )
{
if ( name.Length == 0 )
return -1;
if ( m_availableUniformNames.ContainsKey( name ) )
{
return m_availableUniformNames[ name ];
}
return -1;
}
public bool RegisterUniformName( int nodeId, string name )
{
if ( name.Length == 0 )
return false;
if ( m_availableUniformNames.ContainsKey( name ) )
{
if ( m_availableUniformNames[ name ] > -1 )
{
return false;
}
else
{
m_availableUniformNames[ name ] = nodeId;
return true;
}
}
m_availableUniformNames.Add( name, nodeId );
return true;
}
public void DumpUniformNames()
{
string val = "CONTENTS\n";
foreach ( KeyValuePair<string, int> kvp in m_availableUniformNames )
{
val += ( "key " + kvp.Key + " : value " + kvp.Value + "\n" );
}
}
public void DumpLocalVariableNames()
{
string val = "CONTENTS\n";
foreach ( KeyValuePair<string, int> kvp in m_availableLocalVariableNames )
{
val += ( "key " + kvp.Key + " : value " + kvp.Value + "\n" );
}
}
public bool ReleaseUniformName( int nodeId, string name )
{
if ( !string.IsNullOrEmpty(name) && name.Length == 0 )
return false;
if ( m_availableUniformNames.ContainsKey( name ) )
{
if ( m_availableUniformNames[ name ] == nodeId )
{
m_availableUniformNames.Remove( name );
return true;
}
}
return false;
}
public bool ReleaseLocalVariableName( int nodeId, string name )
{
if ( name.Length == 0 )
return false;
if ( m_availableLocalVariableNames.ContainsKey( name ) )
{
if ( m_availableLocalVariableNames[ name ] == nodeId )
{
m_availableLocalVariableNames.Remove( name );
return true;
}
}
return false;
}
public void ReleaseAllUniformNames()
{
m_availableUniformNames.Clear();
}
public void ReleaseAllLocalVariableNames()
{
m_availableLocalVariableNames.Clear();
}
public void GetFirstAvailableName( int nodeId, WirePortDataType type , out string outProperty , out string outInspector, bool useCustomPrefix = false, string customPrefix = null)
{
string name = string.Empty;
if ( useCustomPrefix && customPrefix != null )
{
name = customPrefix;
}
else
{
switch ( type )
{
case WirePortDataType.OBJECT:
case WirePortDataType.FLOAT:
{
name = FloatNameStr;
}
break;
case WirePortDataType.INT:
{
name = IntNameStr;
}
break;
case WirePortDataType.FLOAT2:
case WirePortDataType.FLOAT3:
case WirePortDataType.FLOAT4:
{
name = VectorNameStr;
}
break;
case WirePortDataType.FLOAT3x3:
case WirePortDataType.FLOAT4x4:
{
name = MatrixNameStr;
}
break;
case WirePortDataType.COLOR:
{
name = ColorNameStr;
}
break;
}
}
int count = 0;
bool foundName = false;
while ( !foundName )
{
string inspectorName = name + count;
string propertyName = UIUtils.GeneratePropertyName( inspectorName , PropertyType.Property );
if ( IsUniformNameAvailable( propertyName ) )
{
outInspector = inspectorName;
outProperty = propertyName;
RegisterUniformName( nodeId, propertyName );
return;
}
count += 1;
}
outProperty = string.Empty;
outInspector = string.Empty;
UIUtils.ShowMessage( "Could not find a valid name " + MessageSeverity.Warning );
}
public bool IsUniformNameAvailable( string name )
{
if ( m_availableUniformNames.ContainsKey( name ) && m_availableUniformNames[ name ] > -1 )
return false;
return true;
}
public bool IsLocalvariableNameAvailable( string name )
{
if ( m_availableLocalVariableNames.ContainsKey( name ) && m_availableLocalVariableNames[ name ] > -1 )
return false;
return true;
}
public bool GetPropertyName( int nodeId, string name )
{
if ( m_availablePropertyNames.ContainsKey( name ) )
{
if ( m_availablePropertyNames[ name ] > -1 )
{
return false;
}
else
{
m_availablePropertyNames[ name ] = nodeId;
return true;
}
}
m_availablePropertyNames.Add( name, nodeId );
return true;
}
public bool ReleasePropertyName( int nodeId, string name )
{
if ( m_availablePropertyNames.ContainsKey( name ) )
{
if ( m_availablePropertyNames[ name ] == nodeId )
{
m_availablePropertyNames[ name ] = -1;
return true;
}
}
return false;
}
public void ReleaseAllPropertyNames()
{
m_availablePropertyNames.Clear();
}
public bool IsPropertyNameAvailable( string name )
{
if ( m_availablePropertyNames.ContainsKey( name ) && m_availablePropertyNames[ name ] > -1 )
return false;
return true;
}
public void ReleaseAllData()
{
ReleaseAllUVChannels();
ReleaseAllUniformNames();
ReleaseAllPropertyNames();
ReleaseAllLocalVariableNames();
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Menu/DuplicatePreventionBuffer.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Menu/DuplicatePreventionBuffer.cs",
"repo_id": "jynew",
"token_count": 3527
} | 814 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using UnityEngine;
using UnityEditor;
namespace AmplifyShaderEditor
{
public sealed class ToolsMenuButtonSep : ToolsMenuButtonParent
{
private Color m_splitterColor = EditorGUIUtility.isProSkin ? new Color( 0.157f, 0.157f, 0.157f ) : new Color( 0.5f, 0.5f, 0.5f );
[SerializeField]
private GUIStyle m_sepStyle;
public ToolsMenuButtonSep( AmplifyShaderEditorWindow parentWindow = null, string text = null, string tooltip = null, float buttonSpacing = -1 ) : base( parentWindow, text, tooltip, buttonSpacing ) { }
public override void Draw()
{
base.Draw();
if ( m_sepStyle == null )
{
m_sepStyle = new GUIStyle();
m_sepStyle.normal.background = Texture2D.whiteTexture;
m_sepStyle.hover.background = Texture2D.whiteTexture;
m_sepStyle.active.background = Texture2D.whiteTexture;
m_sepStyle.onNormal.background = Texture2D.whiteTexture;
m_sepStyle.onHover.background = Texture2D.whiteTexture;
m_sepStyle.onActive.background = Texture2D.whiteTexture;
m_sepStyle.stretchHeight = true;
}
Color originalColor = GUI.color;
GUI.color = m_splitterColor;
GUILayout.Box( string.Empty, m_sepStyle, GUILayout.MaxWidth( 2 ), GUILayout.ExpandHeight( true ) );
GUI.color = originalColor;
}
public override void Destroy()
{
m_sepStyle = null;
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Menu/Tools/ToolsMenuButtonSep.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Menu/Tools/ToolsMenuButtonSep.cs",
"repo_id": "jynew",
"token_count": 538
} | 815 |
fileFormatVersion: 2
guid: 309e413cfa89510429c67fa82c557da7
timeCreated: 1481126954
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Native/FallbackTexture.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Native/FallbackTexture.cs.meta",
"repo_id": "jynew",
"token_count": 99
} | 816 |
fileFormatVersion: 2
guid: 4b99bcf4cd965c648bbbc1de0d1b152a
timeCreated: 1481126955
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ColorNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ColorNode.cs.meta",
"repo_id": "jynew",
"token_count": 103
} | 817 |
fileFormatVersion: 2
guid: 0820850e74009954188ff84e2f5cc4f2
timeCreated: 1495817589
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Lighting/IndirectSpecularLight.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Lighting/IndirectSpecularLight.cs.meta",
"repo_id": "jynew",
"token_count": 100
} | 818 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using System;
using UnityEditor;
using UnityEngine;
namespace AmplifyShaderEditor
{
[Serializable]
[NodeAttributes( "Sin Time", "Time", "Unity sin time" )]
public sealed class SinTimeNode : ConstVecShaderVariable
{
//double m_time;
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
ChangeOutputName( 1, "t/8" );
ChangeOutputName( 2, "t/4" );
ChangeOutputName( 3, "t/2" );
ChangeOutputName( 4, "t" );
m_value = "_SinTime";
m_previewShaderGUID = "e4ba809e0badeb94994170b2cbbbba10";
}
public override void RefreshExternalReferences()
{
base.RefreshExternalReferences();
if( !m_outputPorts[ 0 ].IsConnected )
{
m_outputPorts[ 0 ].Visible = false;
m_sizeIsDirty = true;
}
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Time/SinTimeNode.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Time/SinTimeNode.cs",
"repo_id": "jynew",
"token_count": 348
} | 819 |
fileFormatVersion: 2
guid: 274dde08d42e4b041b9be7a22a8c09d6
timeCreated: 1525857790
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Transform/TransformPositionNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Transform/TransformPositionNode.cs.meta",
"repo_id": "jynew",
"token_count": 104
} | 820 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using System;
namespace AmplifyShaderEditor
{
[Serializable]
[NodeAttributes( "Vertex ID", "Vertex Data", "Indicates current vertex number" )]
public class VertexIdVariableNode : ParentNode
{
private const string VertexIdVarName = "ase_vertexId";
private const string VertexIdRegistry = "uint "+ VertexIdVarName + " : SV_VertexID;";
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
AddOutputPort( WirePortDataType.INT, "Out" );
m_previewShaderGUID = "5934bf2c10b127a459177a3b622cea65";
}
public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar )
{
if ( dataCollector.PortCategory == MasterNodePortCategory.Tessellation )
{
UIUtils.ShowMessage( m_nodeAttribs.Name + " does not work on Tessellation port" );
return "0";
}
if ( dataCollector.IsTemplate )
{
return dataCollector.TemplateDataCollectorInstance.GetVertexId();
}
else
{
if( dataCollector.IsFragmentCategory )
{
GenerateValueInVertex( ref dataCollector, WirePortDataType.UINT, Constants.VertexShaderInputStr + "."+ VertexIdVarName, VertexIdVarName, true );
return Constants.InputVarStr + "."+ VertexIdVarName;
}
else
{
return Constants.VertexShaderInputStr + "."+ VertexIdVarName;
}
}
}
public override void PropagateNodeData( NodeData nodeData, ref MasterNodeDataCollector dataCollector )
{
if( !dataCollector.IsTemplate )
dataCollector.AddCustomAppData( VertexIdRegistry );
base.PropagateNodeData( nodeData, ref dataCollector );
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/VertexIdVariableNode.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/VertexIdVariableNode.cs",
"repo_id": "jynew",
"token_count": 642
} | 821 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using System;
namespace AmplifyShaderEditor
{
[Serializable]
[NodeAttributes( "Custom Add Node", "Debug", "Custom Node Debug ( Only for debug purposes)", null, UnityEngine.KeyCode.None, false )]
public sealed class CustomAddNode : CustomNode
{
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
AddOutputsFromString( "customOut0", "#IP2*(#IP0 + #IP1 / #IP2)" );
AddOutputsFromString( "customOut1", "#IP3 + #IP0*#IP2 + #IP1 / #IP2" );
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/CustomAddNode.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/CustomAddNode.cs",
"repo_id": "jynew",
"token_count": 214
} | 822 |
fileFormatVersion: 2
guid: 1cc4e3c718669d54c97614ac6abcfaff
timeCreated: 1513695160
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/HelperFuncs/DecodeDepthNormalNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/HelperFuncs/DecodeDepthNormalNode.cs.meta",
"repo_id": "jynew",
"token_count": 100
} | 823 |
fileFormatVersion: 2
guid: cabbbe25e4b26b54c84e27007c08a7dd
timeCreated: 1513695146
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/HelperFuncs/EncodeDepthNormalNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/HelperFuncs/EncodeDepthNormalNode.cs.meta",
"repo_id": "jynew",
"token_count": 101
} | 824 |
fileFormatVersion: 2
guid: c01e190d996825f42bdc81e1fab5e897
timeCreated: 1481126959
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/HelperFuncs/UnityObjToClipPosHlpNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/HelperFuncs/UnityObjToClipPosHlpNode.cs.meta",
"repo_id": "jynew",
"token_count": 102
} | 825 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
// Based on the work by https://github.com/keijiro/NoiseShader
using System;
using UnityEditor;
using UnityEngine;
namespace AmplifyShaderEditor
{
public enum NoiseGeneratorType
{
Simplex2D,
Simplex3D
};
[Serializable]
[NodeAttributes( "Noise Generator", "Miscellaneous", "Collection of procedural noise generators" )]
public sealed class NoiseGeneratorNode : ParentNode
{
private const string TypeLabelStr = "Type";
// Simplex 2D
private const string Simplex2DFloat3Mod289Func = "float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }";
private const string Simplex2DFloat2Mod289Func = "float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }";
private const string Simplex2DPermuteFunc = "float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }";
private const string SimplexNoise2DHeader = "float snoise( float2 v )";
private const string SimplexNoise2DFunc = "snoise( {0} )";
private readonly string[] SimplexNoise2DBody = {"float snoise( float2 v )\n",
"{\n",
"\tconst float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );\n",
"\tfloat2 i = floor( v + dot( v, C.yy ) );\n",
"\tfloat2 x0 = v - i + dot( i, C.xx );\n",
"\tfloat2 i1;\n",
"\ti1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );\n",
"\tfloat4 x12 = x0.xyxy + C.xxzz;\n",
"\tx12.xy -= i1;\n",
"\ti = mod2D289( i );\n",
"\tfloat3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );\n",
"\tfloat3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );\n",
"\tm = m * m;\n",
"\tm = m * m;\n",
"\tfloat3 x = 2.0 * frac( p * C.www ) - 1.0;\n",
"\tfloat3 h = abs( x ) - 0.5;\n",
"\tfloat3 ox = floor( x + 0.5 );\n",
"\tfloat3 a0 = x - ox;\n",
"\tm *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );\n",
"\tfloat3 g;\n",
"\tg.x = a0.x * x0.x + h.x * x0.y;\n",
"\tg.yz = a0.yz * x12.xz + h.yz * x12.yw;\n",
"\treturn 130.0 * dot( m, g );\n",
"}\n"};
// Simplex 3D
private const string Simplex3DFloat3Mod289 = "float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; }";
private const string Simplex3DFloat4Mod289 = "float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; }";
private const string Simplex3DFloat4Permute = "float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); }";
private const string TaylorInvSqrtFunc = "float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }";
private const string SimplexNoise3DHeader = "float snoise( float3 v )";
private const string SimplexNoise3DFunc = "snoise( {0} )";
private readonly string[] SimplexNoise3DBody = {"float snoise( float3 v )\n",
"{\n",
"\tconst float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );\n",
"\tfloat3 i = floor( v + dot( v, C.yyy ) );\n",
"\tfloat3 x0 = v - i + dot( i, C.xxx );\n",
"\tfloat3 g = step( x0.yzx, x0.xyz );\n",
"\tfloat3 l = 1.0 - g;\n",
"\tfloat3 i1 = min( g.xyz, l.zxy );\n",
"\tfloat3 i2 = max( g.xyz, l.zxy );\n",
"\tfloat3 x1 = x0 - i1 + C.xxx;\n",
"\tfloat3 x2 = x0 - i2 + C.yyy;\n",
"\tfloat3 x3 = x0 - 0.5;\n",
"\ti = mod3D289( i);\n",
"\tfloat4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );\n",
"\tfloat4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7)\n",
"\tfloat4 x_ = floor( j / 7.0 );\n",
"\tfloat4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)\n",
"\tfloat4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;\n",
"\tfloat4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;\n",
"\tfloat4 h = 1.0 - abs( x ) - abs( y );\n",
"\tfloat4 b0 = float4( x.xy, y.xy );\n",
"\tfloat4 b1 = float4( x.zw, y.zw );\n",
"\tfloat4 s0 = floor( b0 ) * 2.0 + 1.0;\n",
"\tfloat4 s1 = floor( b1 ) * 2.0 + 1.0;\n",
"\tfloat4 sh = -step( h, 0.0 );\n",
"\tfloat4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n",
"\tfloat4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n",
"\tfloat3 g0 = float3( a0.xy, h.x );\n",
"\tfloat3 g1 = float3( a0.zw, h.y );\n",
"\tfloat3 g2 = float3( a1.xy, h.z );\n",
"\tfloat3 g3 = float3( a1.zw, h.w );\n",
"\tfloat4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) );\n",
"\tg0 *= norm.x;\n",
"\tg1 *= norm.y;\n",
"\tg2 *= norm.z;\n",
"\tg3 *= norm.w;\n",
"\tfloat4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );\n",
"\tm = m* m;\n",
"\tm = m* m;\n",
"\tfloat4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) );\n",
"\treturn 42.0 * dot( m, px);\n",
"}\n"};
[SerializeField]
private NoiseGeneratorType m_type = NoiseGeneratorType.Simplex2D;
private UpperLeftWidgetHelper m_upperLeftWidget = new UpperLeftWidgetHelper();
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
AddInputPort( WirePortDataType.FLOAT2, false, "Size" );
AddOutputPort( WirePortDataType.FLOAT, Constants.EmptyPortValue );
m_useInternalPortData = true;
m_autoWrapProperties = true;
m_hasLeftDropdown = true;
SetAdditonalTitleText( string.Format( Constants.SubTitleTypeFormatStr, m_type ) );
m_previewShaderGUID = "cd2d37ef5da190b42a91a5a690ba2a7d";
}
public override void AfterCommonInit()
{
base.AfterCommonInit();
if( PaddingTitleLeft == 0 )
{
PaddingTitleLeft = Constants.PropertyPickerWidth + Constants.IconsLeftRightMargin;
if( PaddingTitleRight == 0 )
PaddingTitleRight = Constants.PropertyPickerWidth + Constants.IconsLeftRightMargin;
}
}
public override void Destroy()
{
base.Destroy();
m_upperLeftWidget = null;
}
public override void Draw( DrawInfo drawInfo )
{
base.Draw( drawInfo );
m_upperLeftWidget.DrawWidget<NoiseGeneratorType>( ref m_type, this, OnWidgetUpdate );
}
private readonly Action<ParentNode> OnWidgetUpdate = ( x ) =>
{
( x as NoiseGeneratorNode ).ConfigurePorts();
};
public override void DrawProperties()
{
base.DrawProperties();
EditorGUI.BeginChangeCheck();
m_type = (NoiseGeneratorType)EditorGUILayoutEnumPopup( TypeLabelStr, m_type );
if( EditorGUI.EndChangeCheck() )
{
ConfigurePorts();
}
//EditorGUILayout.HelpBox( "Node still under construction. Use with caution", MessageType.Info );
}
private void ConfigurePorts()
{
SetAdditonalTitleText( string.Format( Constants.SubTitleTypeFormatStr, m_type ) );
switch( m_type )
{
case NoiseGeneratorType.Simplex2D:
{
m_inputPorts[ 0 ].ChangeType( WirePortDataType.FLOAT2, false );
m_previewMaterialPassId = 0;
}
break;
case NoiseGeneratorType.Simplex3D:
{
m_inputPorts[ 0 ].ChangeType( WirePortDataType.FLOAT3, false );
m_previewMaterialPassId = 1;
}
break;
}
}
public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar )
{
if( m_outputPorts[ 0 ].IsLocalValue( dataCollector.PortCategory ) )
{
return m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory );
}
switch( m_type )
{
case NoiseGeneratorType.Simplex2D:
{
string float3Mod289Func = ( dataCollector.IsTemplate ) ? Simplex2DFloat3Mod289Func : "\t\t" + Simplex2DFloat3Mod289Func;
dataCollector.AddFunction( Simplex2DFloat3Mod289Func, float3Mod289Func );
string float2Mod289Func = ( dataCollector.IsTemplate ) ? Simplex2DFloat2Mod289Func : "\t\t" + Simplex2DFloat2Mod289Func;
dataCollector.AddFunction( Simplex2DFloat2Mod289Func, float2Mod289Func );
string permuteFunc = ( dataCollector.IsTemplate ) ? Simplex2DPermuteFunc : "\t\t" + Simplex2DPermuteFunc;
dataCollector.AddFunction( Simplex2DPermuteFunc, permuteFunc );
dataCollector.AddFunction( SimplexNoise2DHeader, SimplexNoise2DBody, false );
string size = m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector );
RegisterLocalVariable( 0, string.Format( SimplexNoise2DFunc, size ), ref dataCollector, ( "simplePerlin2D" + OutputId ) );
}
break;
case NoiseGeneratorType.Simplex3D:
{
string float3Mod289Func = ( dataCollector.IsTemplate ) ? Simplex3DFloat3Mod289 : "\t\t" + Simplex3DFloat3Mod289;
dataCollector.AddFunction( Simplex3DFloat3Mod289, float3Mod289Func );
string float4Mod289Func = ( dataCollector.IsTemplate ) ? Simplex3DFloat4Mod289 : "\t\t" + Simplex3DFloat4Mod289;
dataCollector.AddFunction( Simplex3DFloat4Mod289, float4Mod289Func );
string permuteFunc = ( dataCollector.IsTemplate ) ? Simplex3DFloat4Permute : "\t\t" + Simplex3DFloat4Permute;
dataCollector.AddFunction( Simplex3DFloat4Permute, permuteFunc );
string taylorInvSqrtFunc = ( dataCollector.IsTemplate ) ? TaylorInvSqrtFunc : "\t\t" + TaylorInvSqrtFunc;
dataCollector.AddFunction( TaylorInvSqrtFunc, taylorInvSqrtFunc );
dataCollector.AddFunction( SimplexNoise3DHeader, SimplexNoise3DBody, false );
string size = m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector );
RegisterLocalVariable( 0, string.Format( SimplexNoise3DFunc, size ), ref dataCollector, ( "simplePerlin3D" + OutputId ) );
}
break;
}
return m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory );
}
public override void ReadFromString( ref string[] nodeParams )
{
base.ReadFromString( ref nodeParams );
m_type = (NoiseGeneratorType)Enum.Parse( typeof( NoiseGeneratorType ), GetCurrentParam( ref nodeParams ) );
ConfigurePorts();
}
public override void WriteToString( ref string nodeInfo, ref string connectionsInfo )
{
base.WriteToString( ref nodeInfo, ref connectionsInfo );
IOUtils.AddFieldValueToString( ref nodeInfo, m_type );
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/ImageEffects/NoiseGeneratorNode.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/ImageEffects/NoiseGeneratorNode.cs",
"repo_id": "jynew",
"token_count": 5238
} | 826 |
fileFormatVersion: 2
guid: 04eb50f45d1416e4bb61902a49f06d58
timeCreated: 1500648134
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/KeywordSwitchNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/KeywordSwitchNode.cs.meta",
"repo_id": "jynew",
"token_count": 100
} | 827 |
fileFormatVersion: 2
guid: 1a3d561a45c21114c99f52c5432b25e9
timeCreated: 1481126953
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/TFHCIf.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/TFHCIf.cs.meta",
"repo_id": "jynew",
"token_count": 103
} | 828 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using UnityEngine;
namespace AmplifyShaderEditor
{
[System.Serializable]
public class CodeGenerationData
{
[SerializeField]
public bool IsActive;
[SerializeField]
public string Name;
[SerializeField]
public string Value;
public CodeGenerationData( string name, string value )
{
IsActive = false;
Name = name;
Value = value;
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Master/CodeGenerationData.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Master/CodeGenerationData.cs",
"repo_id": "jynew",
"token_count": 169
} | 829 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using UnityEngine;
using UnityEditor;
using System;
namespace AmplifyShaderEditor
{
[Serializable]
[NodeAttributes( "Function Subtitle", "Functions", "Adds a subtitle to its shader function", NodeAvailabilityFlags = (int)NodeAvailability.ShaderFunction )]
public sealed class FunctionSubtitle : ParentNode
{
//protected override void CommonInit( int uniqueId )
//{
// base.CommonInit( uniqueId );
// AddInputPort( WirePortDataType.FLOAT, false, Constants.EmptyPortValue );
// AddOutputPort( WirePortDataType.FLOAT, Constants.EmptyPortValue );
// m_autoWrapProperties = true;
// m_textLabelWidth = 100;
// //SetTitleText( m_inputName );
// //SetAdditonalTitleText( "( " + m_inputValueTypes[ m_selectedInputTypeInt ] + " )" );
// m_previewShaderGUID = "04bc8e7b317dccb4d8da601680dd8140";
//}
[SerializeField]
private string m_subttile = "Subtitle";
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
AddInputPort( WirePortDataType.FLOAT, false, Constants.EmptyPortValue );
AddOutputPort( WirePortDataType.FLOAT, Constants.EmptyPortValue );
m_autoWrapProperties = true;
m_textLabelWidth = 100;
SetTitleText( m_subttile );
m_previewShaderGUID = "74e4d859fbdb2c0468de3612145f4929";
}
public override void OnInputPortConnected( int portId, int otherNodeId, int otherPortId, bool activateNode = true )
{
base.OnInputPortConnected( portId, otherNodeId, otherPortId, activateNode );
m_inputPorts[ 0 ].MatchPortToConnection();
m_outputPorts[ 0 ].ChangeType( m_inputPorts[ 0 ].DataType, false );
}
public override void OnConnectedOutputNodeChanges( int outputPortId, int otherNodeId, int otherPortId, string name, WirePortDataType type )
{
base.OnConnectedOutputNodeChanges( outputPortId, otherNodeId, otherPortId, name, type );
m_inputPorts[ 0 ].MatchPortToConnection();
m_outputPorts[ 0 ].ChangeType( m_inputPorts[ 0 ].DataType, false );
}
public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar )
{
base.GenerateShaderForOutput( outputId, ref dataCollector, ignoreLocalvar );
return m_inputPorts[ 0 ].GenerateShaderForOutput( ref dataCollector, m_inputPorts[ 0 ].DataType, ignoreLocalvar );
}
//public override void PropagateNodeData( NodeData nodeData, ref MasterNodeDataCollector dataCollector )
//{
// base.PropagateNodeData( nodeData, ref dataCollector );
// //if( m_containerGraph.CurrentShaderFunction != null )
// //m_containerGraph.CurrentShaderFunction.FunctionSubtitle = m_subttile;
//}
public override void OnNodeLogicUpdate( DrawInfo drawInfo )
{
base.OnNodeLogicUpdate( drawInfo );
//public override void PropagateNodeData( NodeData nodeData, ref MasterNodeDataCollector dataCollector )
//{
// base.PropagateNodeData( nodeData, ref dataCollector );
//Debug.Log( IsConnected + " " + m_containerGraph.CurrentFunctionOutput );
if( m_containerGraph.CurrentFunctionOutput != null && IsConnected )
m_containerGraph.CurrentFunctionOutput.SubTitle = m_subttile;
// m_containerGraph.CurrentShaderFunction.FunctionSubtitle = m_subttile;
}
public override void DrawProperties()
{
base.DrawProperties();
EditorGUILayout.BeginVertical();
EditorGUI.BeginChangeCheck();
m_subttile = EditorGUILayoutTextField( "Name", m_subttile );
if( EditorGUI.EndChangeCheck() )
{
SetTitleText( m_subttile );
//UIUtils.UpdateFunctionInputData( UniqueId, m_inputName );
}
EditorGUI.BeginChangeCheck();
//m_selectedInputTypeInt = EditorGUILayoutPopup( InputTypeStr, m_selectedInputTypeInt, m_inputValueTypes );
//if( EditorGUI.EndChangeCheck() )
//{
// UpdatePorts();
// SetAdditonalTitleText( "( " + m_inputValueTypes[ m_selectedInputTypeInt ] + " )" );
//}
//m_autoCast = EditorGUILayoutToggle( "Auto Cast", m_autoCast );
//EditorGUILayout.Separator();
//if( !m_inputPorts[ 0 ].IsConnected && m_inputPorts[ 0 ].ValidInternalData )
//{
// m_inputPorts[ 0 ].ShowInternalData( this, true, "Default Value" );
//}
EditorGUILayout.EndVertical();
}
public override void WriteToString( ref string nodeInfo, ref string connectionsInfo )
{
base.WriteToString( ref nodeInfo, ref connectionsInfo );
IOUtils.AddFieldValueToString( ref nodeInfo, m_subttile );
}
public override void ReadFromString( ref string[] nodeParams )
{
base.ReadFromString( ref nodeParams );
m_subttile = GetCurrentParam( ref nodeParams );
SetTitleText( m_subttile );
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Master/FunctionSubtitle.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Master/FunctionSubtitle.cs",
"repo_id": "jynew",
"token_count": 1668
} | 830 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using System;
using System.Collections.Generic;
using UnityEngine;
namespace AmplifyShaderEditor
{
public enum DisableBatchingTagValues
{
True,
False,
LODFading
}
[Serializable]
public class RenderingOptionsOpHelper
{
private const string RenderingOptionsStr = " Rendering Options";
private readonly static GUIContent EmissionGIFlags = new GUIContent( "Emission GI Flag", "Modifies Emission GI flags" );
private readonly static GUIContent LODCrossfadeContent = new GUIContent( " LOD Group Cross Fade", "Applies a dither crossfade to be used with LOD groups for smoother transitions. Uses one interpolator\nDefault: OFF" );
private readonly static GUIContent DisableBatchingContent = new GUIContent( "Disable Batching", "\nDisables objects to be batched and used with DrawCallBatching Default: False" );
private readonly static GUIContent IgnoreProjectorContent = new GUIContent( " Ignore Projector", "\nIf True then an object that uses this shader will not be affected by Projectors Default: False" );
private readonly static GUIContent ForceNoShadowCastingContent = new GUIContent( " Force No Shadow Casting", "\nIf True then an object that is rendered using this subshader will never cast shadows Default: False" );
private readonly static GUIContent ForceEnableInstancingContent = new GUIContent( " Force Enable Instancing", "\nIf True forces instancing on shader independent of having instanced properties" );
#if UNITY_5_6_OR_NEWER
private readonly static GUIContent ForceDisableInstancingContent = new GUIContent( " Force Disable Instancing", "\nIf True forces disable instancing on shader independent of having instanced properties" );
#endif
private readonly static GUIContent SpecularHightlightsContent = new GUIContent( " Fwd Specular Highlights Toggle", "\nIf True creates a material toggle to set Unity's internal specular highlight rendering keyword" );
private readonly static GUIContent ReflectionsContent = new GUIContent( " Fwd Reflections Toggle", "\nIf True creates a material toggle to set Unity's internal reflections rendering keyword" );
[SerializeField]
private bool m_forceEnableInstancing = false;
[SerializeField]
private bool m_forceDisableInstancing = false;
[SerializeField]
private bool m_specularHighlightToggle = false;
[SerializeField]
private bool m_reflectionsToggle = false;
[SerializeField]
private bool m_lodCrossfade = false;
[SerializeField]
private DisableBatchingTagValues m_disableBatching = DisableBatchingTagValues.False;
[SerializeField]
private bool m_ignoreProjector = false;
[SerializeField]
private bool m_forceNoShadowCasting = false;
[SerializeField]
private List<CodeGenerationData> m_codeGenerationDataList;
public RenderingOptionsOpHelper()
{
m_codeGenerationDataList = new List<CodeGenerationData>();
m_codeGenerationDataList.Add( new CodeGenerationData( " Exclude Deferred", "exclude_path:deferred" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Exclude Forward", "exclude_path:forward" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Exclude Legacy Deferred", "exclude_path:prepass" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Shadows", "noshadow" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Ambient Light", "noambient" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Per Vertex Light", "novertexlights" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Lightmaps", "nolightmap " ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Dynamic Global GI", "nodynlightmap" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Directional lightmaps", "nodirlightmap" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Built-in Fog", "nofog" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Meta Pass", "nometa" ) );
m_codeGenerationDataList.Add( new CodeGenerationData( " Add Pass", "noforwardadd" ) );
}
public bool IsOptionActive( string option )
{
return !m_codeGenerationDataList.Find( x => x.Name.Equals( option ) ).IsActive;
}
public void Draw( ParentNode owner )
{
bool value = owner.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedRenderingOptions;
NodeUtils.DrawPropertyGroup( ref value, RenderingOptionsStr, () =>
{
int codeGenCount = m_codeGenerationDataList.Count;
// Starting from index 4 because other options are already contemplated with m_renderPath and add/receive shadows
for( int i = 4; i < codeGenCount; i++ )
{
m_codeGenerationDataList[ i ].IsActive = !owner.EditorGUILayoutToggleLeft( m_codeGenerationDataList[ i ].Name, !m_codeGenerationDataList[ i ].IsActive );
}
m_lodCrossfade = owner.EditorGUILayoutToggleLeft( LODCrossfadeContent, m_lodCrossfade );
m_ignoreProjector = owner.EditorGUILayoutToggleLeft( IgnoreProjectorContent, m_ignoreProjector );
m_forceNoShadowCasting = owner.EditorGUILayoutToggleLeft( ForceNoShadowCastingContent, m_forceNoShadowCasting );
if( owner.ContainerGraph.IsInstancedShader )
{
GUI.enabled = false;
owner.EditorGUILayoutToggleLeft( ForceEnableInstancingContent, true );
GUI.enabled = true;
}
else
{
m_forceEnableInstancing = owner.EditorGUILayoutToggleLeft( ForceEnableInstancingContent, m_forceEnableInstancing );
}
#if UNITY_5_6_OR_NEWER
m_forceDisableInstancing = owner.EditorGUILayoutToggleLeft( ForceDisableInstancingContent, m_forceDisableInstancing );
#endif
m_specularHighlightToggle = owner.EditorGUILayoutToggleLeft( SpecularHightlightsContent, m_specularHighlightToggle );
m_reflectionsToggle = owner.EditorGUILayoutToggleLeft( ReflectionsContent, m_reflectionsToggle );
m_disableBatching = (DisableBatchingTagValues)owner.EditorGUILayoutEnumPopup( DisableBatchingContent, m_disableBatching );
Material mat = owner.ContainerGraph.CurrentMaterial;
if( mat != null )
{
mat.globalIlluminationFlags = (MaterialGlobalIlluminationFlags)owner.EditorGUILayoutEnumPopup( EmissionGIFlags, mat.globalIlluminationFlags );
}
} );
owner.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedRenderingOptions = value;
}
public void Build( ref string OptionalParameters )
{
int codeGenCount = m_codeGenerationDataList.Count;
for( int i = 0; i < codeGenCount; i++ )
{
if( m_codeGenerationDataList[ i ].IsActive )
{
OptionalParameters += m_codeGenerationDataList[ i ].Value + Constants.OptionalParametersSep;
}
}
#if UNITY_2017_1_OR_NEWER
if( m_lodCrossfade )
{
OptionalParameters += Constants.LodCrossFadeOption2017 + Constants.OptionalParametersSep;
}
#endif
}
public void ReadFromString( ref uint index, ref string[] nodeParams )
{
for( int i = 0; i < m_codeGenerationDataList.Count; i++ )
{
m_codeGenerationDataList[ i ].IsActive = Convert.ToBoolean( nodeParams[ index++ ] );
}
if( UIUtils.CurrentShaderVersion() > 10005 )
{
m_lodCrossfade = Convert.ToBoolean( nodeParams[ index++ ] );
}
if( UIUtils.CurrentShaderVersion() > 10007 )
{
m_disableBatching = (DisableBatchingTagValues)Enum.Parse( typeof( DisableBatchingTagValues ), nodeParams[ index++ ] );
m_ignoreProjector = Convert.ToBoolean( nodeParams[ index++ ] );
m_forceNoShadowCasting = Convert.ToBoolean( nodeParams[ index++ ] );
}
if( UIUtils.CurrentShaderVersion() > 11002 )
{
m_forceEnableInstancing = Convert.ToBoolean( nodeParams[ index++ ] );
}
if( UIUtils.CurrentShaderVersion() > 15205 )
{
m_forceDisableInstancing = Convert.ToBoolean( nodeParams[ index++ ] );
}
if( UIUtils.CurrentShaderVersion() > 14403 )
{
m_specularHighlightToggle = Convert.ToBoolean( nodeParams[ index++ ] );
m_reflectionsToggle = Convert.ToBoolean( nodeParams[ index++ ] );
}
}
public void WriteToString( ref string nodeInfo )
{
for( int i = 0; i < m_codeGenerationDataList.Count; i++ )
{
IOUtils.AddFieldValueToString( ref nodeInfo, m_codeGenerationDataList[ i ].IsActive );
}
IOUtils.AddFieldValueToString( ref nodeInfo, m_lodCrossfade );
IOUtils.AddFieldValueToString( ref nodeInfo, m_disableBatching );
IOUtils.AddFieldValueToString( ref nodeInfo, m_ignoreProjector );
IOUtils.AddFieldValueToString( ref nodeInfo, m_forceNoShadowCasting );
IOUtils.AddFieldValueToString( ref nodeInfo, m_forceEnableInstancing );
IOUtils.AddFieldValueToString( ref nodeInfo, m_forceDisableInstancing );
IOUtils.AddFieldValueToString( ref nodeInfo, m_specularHighlightToggle );
IOUtils.AddFieldValueToString( ref nodeInfo, m_reflectionsToggle );
}
public void Destroy()
{
m_codeGenerationDataList.Clear();
m_codeGenerationDataList = null;
}
public bool ForceEnableInstancing { get { return m_forceEnableInstancing; } }
public bool ForceDisableInstancing { get { return m_forceDisableInstancing; } }
public bool LodCrossfade { get { return m_lodCrossfade; } }
public bool IgnoreProjectorValue { get { return m_ignoreProjector; } set { m_ignoreProjector = value; } }
public bool SpecularHighlightToggle { get { return m_specularHighlightToggle; } set { m_specularHighlightToggle = value; } }
public bool ReflectionsToggle { get { return m_reflectionsToggle; } set { m_reflectionsToggle = value; } }
public string DisableBatchingTag { get { return ( m_disableBatching != DisableBatchingTagValues.False ) ? string.Format( Constants.TagFormat, "DisableBatching", m_disableBatching ) : string.Empty; } }
public string IgnoreProjectorTag { get { return ( m_ignoreProjector ) ? string.Format( Constants.TagFormat, "IgnoreProjector", "True" ) : string.Empty; } }
public string ForceNoShadowCastingTag { get { return ( m_forceNoShadowCasting ) ? string.Format( Constants.TagFormat, "ForceNoShadowCasting", "True" ) : string.Empty; } }
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Master/RenderingOptionsOpHelper.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Master/RenderingOptionsOpHelper.cs",
"repo_id": "jynew",
"token_count": 3374
} | 831 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
namespace AmplifyShaderEditor
{
[System.Serializable]
[NodeAttributes( "Object To World", "Object Transform", "Transforms input to World Space" )]
public sealed class ObjectToWorldTransfNode : ParentTransfNode
{
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
m_matrixName = "unity_ObjectToWorld";
m_matrixHDName = "GetObjectToWorldMatrix()";
m_previewShaderGUID = "a4044ee165813654486d0cecd0de478c";
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs",
"repo_id": "jynew",
"token_count": 204
} | 832 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using System;
using System.Collections.Generic;
namespace AmplifyShaderEditor
{
public class NodeRestrictionsData
{
private bool m_allPorts;
private Dictionary<int, bool> m_portRestrictions;
public NodeRestrictionsData()
{
m_portRestrictions = new Dictionary<int, bool>();
}
public NodeRestrictionsData( int port )
{
m_portRestrictions = new Dictionary<int, bool>();
m_portRestrictions.Add( port, true );
}
public void SetAllPortRestiction( bool value )
{
m_allPorts = value;
}
public void AddRestriction( int port )
{
if ( !m_portRestrictions.ContainsKey( port ) )
m_portRestrictions.Add( port, true );
else
m_portRestrictions[ port ] = true;
}
public void RemoveRestriction( int port )
{
if ( m_portRestrictions.ContainsKey( port ) )
m_portRestrictions[ port ] = true;
}
public bool IsPortRestricted( int port )
{
if ( m_portRestrictions.ContainsKey( port ) )
return m_portRestrictions[ port ];
return false;
}
public void Destroy()
{
m_portRestrictions.Clear();
m_portRestrictions = null;
}
public bool AllPortsRestricted
{
get
{
return m_allPorts;
}
}
}
public class NodeRestrictions
{
private Dictionary<System.Type, NodeRestrictionsData> m_restrictions;
public NodeRestrictions()
{
m_restrictions = new Dictionary<System.Type, NodeRestrictionsData>();
}
public void AddTypeRestriction( System.Type type )
{
if ( !m_restrictions.ContainsKey( type ) )
m_restrictions.Add( type, new NodeRestrictionsData() );
m_restrictions[ type ].SetAllPortRestiction( true );
}
public void AddPortRestriction( System.Type type, int port )
{
if ( !m_restrictions.ContainsKey( type ) )
m_restrictions.Add( type, new NodeRestrictionsData( port ) );
else
{
m_restrictions[ type ].AddRestriction( port );
}
}
public bool GetRestiction( System.Type type, int port )
{
if ( m_restrictions.Count == 0 || type == null )
return false;
if ( m_restrictions.ContainsKey( type ) )
{
if ( m_restrictions[ type ].AllPortsRestricted )
return true;
return m_restrictions[ type ].IsPortRestricted( port );
}
return false;
}
public void Destroy()
{
foreach ( KeyValuePair<System.Type, NodeRestrictionsData> pair in m_restrictions )
{
pair.Value.Destroy();
}
m_restrictions.Clear();
m_restrictions = null;
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/NodeRestrictions.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/NodeRestrictions.cs",
"repo_id": "jynew",
"token_count": 1017
} | 833 |
fileFormatVersion: 2
guid: 2e14c4a7c0be9f146ac912130c280b15
timeCreated: 1481126954
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Operators/DdxOpNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Operators/DdxOpNode.cs.meta",
"repo_id": "jynew",
"token_count": 103
} | 834 |
fileFormatVersion: 2
guid: f186e1b03a8ee2b4b9e45918576e8cf6
timeCreated: 1484731588
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Operators/SimplifiedFModOpNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Operators/SimplifiedFModOpNode.cs.meta",
"repo_id": "jynew",
"token_count": 103
} | 835 |
fileFormatVersion: 2
guid: 535b4367719ca2146bb7ddac217dad94
timeCreated: 1481126955
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Operators/TanOpNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Operators/TanOpNode.cs.meta",
"repo_id": "jynew",
"token_count": 98
} | 836 |
fileFormatVersion: 2
guid: 2f92560b009046f4a86504e682834405
timeCreated: 1481126954
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/SignalGeneratorNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/SignalGeneratorNode.cs.meta",
"repo_id": "jynew",
"token_count": 99
} | 837 |
fileFormatVersion: 2
guid: ddb697d654917eb4aada5b2caeef2db8
folderAsset: yes
timeCreated: 1481126946
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/SurfaceShaderInputs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/SurfaceShaderInputs.meta",
"repo_id": "jynew",
"token_count": 77
} | 838 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using System;
using UnityEngine;
using UnityEditor;
namespace AmplifyShaderEditor
{
[Serializable]
[NodeAttributes( "Blend Normals", "Textures", "Blend Normals" )]
public class BlendNormalsNode : ParentNode
{
public readonly static string[] ModeListStr = { "Tangent Normals", "Reoriented Tangent Normals", "Reoriented World Normals" };
public readonly static int[] ModeListInt = { 0, 1, 2 };
[SerializeField]
public int m_selectedMode = 0;
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
AddInputPort( WirePortDataType.FLOAT3, false, "Normal A" );
AddInputPort( WirePortDataType.FLOAT3, false, "Normal B" );
AddInputPort( WirePortDataType.FLOAT3, false, "Vertex Normal" );
m_inputPorts[ 2 ].Visible = false;
AddOutputPort( WirePortDataType.FLOAT3, "XYZ" );
m_useInternalPortData = true;
m_previewShaderGUID = "bcdf750ff5f70444f98b8a3efa50dc6f";
}
public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar )
{
if( !( dataCollector.IsTemplate && dataCollector.IsSRP ) )
dataCollector.AddToIncludes( UniqueId, Constants.UnityStandardUtilsLibFuncs );
string _inputA = m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector );
string _inputB = m_inputPorts[ 1 ].GeneratePortInstructions( ref dataCollector );
string result = "BlendNormals( " + _inputA + " , " + _inputB + " )";
if( dataCollector.IsTemplate && dataCollector.IsSRP )
{
switch( m_selectedMode )
{
default:
case 0:
result = "BlendNormal( " + _inputA + " , " + _inputB + " )";
break;
case 1:
result = "BlendNormalRNM( " + _inputA + " , " + _inputB + " )";
break;
case 2:
string inputC = m_inputPorts[ 2 ].GeneratePortInstructions( ref dataCollector );
result = "BlendNormalWorldspaceRNM( " + _inputA + " , " + _inputB + ", " + inputC + " )";
break;
}
}
return CreateOutputLocalVariable( 0, result, ref dataCollector );
}
public override void DrawProperties()
{
base.DrawProperties();
if( ContainerGraph.IsSRP )
{
NodeUtils.DrawPropertyGroup( ref m_propertiesFoldout, Constants.ParameterLabelStr, () =>
{
EditorGUI.BeginChangeCheck();
m_selectedMode = EditorGUILayoutIntPopup( "Mode", m_selectedMode, ModeListStr, ModeListInt );
if( EditorGUI.EndChangeCheck() )
{
if( m_selectedMode == 2 )
{
m_inputPorts[ 2 ].Visible = true;
}
else
{
m_inputPorts[ 2 ].Visible = false;
}
m_sizeIsDirty = true;
}
} );
}
}
public override void ReadFromString( ref string[] nodeParams )
{
base.ReadFromString( ref nodeParams );
if( UIUtils.CurrentShaderVersion() > 14503 )
m_selectedMode = Convert.ToInt32( GetCurrentParam( ref nodeParams ) );
}
public override void WriteToString( ref string nodeInfo, ref string connectionsInfo )
{
base.WriteToString( ref nodeInfo, ref connectionsInfo );
IOUtils.AddFieldValueToString( ref nodeInfo, m_selectedMode );
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Textures/BlendNormalsNode.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Textures/BlendNormalsNode.cs",
"repo_id": "jynew",
"token_count": 1264
} | 839 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using UnityEngine;
using UnityEditor;
using System;
namespace AmplifyShaderEditor
{
public enum TexturePropertyValues
{
white,
black,
gray,
bump
}
public enum TextureType
{
Texture1D,
Texture2D,
Texture3D,
Cube,
Texture2DArray,
ProceduralTexture
}
public enum AutoCastType
{
Auto = 0,
LockedToTexture1D,
LockedToTexture2D,
LockedToTexture3D,
LockedToCube,
LockedToTexture2DArray
}
[Serializable]
[NodeAttributes( "Texture Object", "Textures", "Represents a Texture Asset. Can be used in samplers <b>Tex</b> inputs or shader function inputs to reuse the same texture multiple times.", SortOrderPriority = 1 )]
public class TexturePropertyNode : PropertyNode
{
private const string ObjectSelectorCmdStr = "ObjectSelectorClosed";
protected readonly string[] AvailablePropertyTypeLabels = { PropertyType.Property.ToString(), PropertyType.Global.ToString() };
protected readonly int[] AvailablePropertyTypeValues = { (int)PropertyType.Property, (int)PropertyType.Global };
protected const int OriginalFontSizeUpper = 9;
protected const int OriginalFontSizeLower = 9;
protected const string DefaultTextureStr = "Default Texture";
protected const string AutoCastModeStr = "Auto-Cast Mode";
protected const string AutoUnpackNormalsStr = "Normal";
[SerializeField]
protected Texture m_defaultValue;
[SerializeField]
protected Texture m_materialValue;
[SerializeField]
protected TexturePropertyValues m_defaultTextureValue;
[SerializeField]
protected bool m_isNormalMap;
[SerializeField]
protected System.Type m_textureType = typeof( Texture2D );
//[SerializeField]
//protected bool m_isTextureFetched;
//[SerializeField]
//protected string m_textureFetchedValue;
[SerializeField]
protected TextureType m_currentType = TextureType.Texture2D;
[SerializeField]
protected AutoCastType m_autocastMode = AutoCastType.Auto;
protected int PreviewSizeX = 128;
protected int PreviewSizeY = 128;
protected bool m_linearTexture;
protected TexturePropertyNode m_textureProperty = null;
protected bool m_drawPicker;
protected bool m_drawAutocast = true;
protected int m_cachedSamplerId = -1;
protected int m_cachedSamplerIdArray = -1;
protected int m_cachedSamplerIdCube = -1;
protected int m_cachedSamplerId3D = -1;
protected int m_defaultId = -1;
protected int m_typeId = -1;
private TextureType m_previousType = TextureType.Texture2D;
private string m_labelText = "None (Texture2D)";
protected bool m_isEditingPicker;
public TexturePropertyNode() : base() { }
public TexturePropertyNode( int uniqueId, float x, float y, float width, float height ) : base( uniqueId, x, y, width, height ) { }
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
GlobalTypeWarningText = string.Format( GlobalTypeWarningText, "Texture" );
m_defaultTextureValue = TexturePropertyValues.white;
m_insideSize.Set( PreviewSizeX, PreviewSizeY + 5 );
AddOutputPort( WirePortDataType.SAMPLER2D, "Tex" );
m_outputPorts[ 0 ].CreatePortRestrictions( WirePortDataType.SAMPLER1D, WirePortDataType.SAMPLER2D, WirePortDataType.SAMPLER3D, WirePortDataType.SAMPLERCUBE, WirePortDataType.OBJECT );
m_currentParameterType = PropertyType.Property;
m_customPrefix = "Texture ";
m_drawPrecisionUI = false;
m_showVariableMode = true;
m_freeType = false;
m_drawPicker = true;
m_hasLeftDropdown = true;
m_textLabelWidth = 115;
m_longNameSize = 225;
m_availableAttribs.Add( new PropertyAttributes( "No Scale Offset", "[NoScaleOffset]" ) );
m_availableAttribs.Add( new PropertyAttributes( "Normal", "[Normal]" ) );
m_showPreview = true;
m_drawPreviewExpander = false;
m_drawPreview = false;
m_drawPreviewMaskButtons = false;
m_previewShaderGUID = "e53988745ec6e034694ee2640cd3d372";
}
public override void AfterCommonInit()
{
base.AfterCommonInit();
m_hasLeftDropdown = true;
}
protected void SetPreviewTexture( Texture newValue )
{
if( newValue is Cubemap )
{
PreviewMaterial.SetInt( m_typeId, 3 );
if( m_cachedSamplerIdCube == -1 )
m_cachedSamplerIdCube = Shader.PropertyToID( "_Cube" );
PreviewMaterial.SetTexture( m_cachedSamplerIdCube, newValue as Cubemap );
}
else if( newValue is Texture2DArray )
{
PreviewMaterial.SetInt( m_typeId, 4 );
if( m_cachedSamplerIdArray == -1 )
m_cachedSamplerIdArray = Shader.PropertyToID( "_Array" );
PreviewMaterial.SetTexture( m_cachedSamplerIdArray, newValue as Texture2DArray );
}
else if( newValue is Texture3D )
{
PreviewMaterial.SetInt( m_typeId, 2 );
if( m_cachedSamplerId3D == -1 )
m_cachedSamplerId3D = Shader.PropertyToID( "_Sampler3D" );
PreviewMaterial.SetTexture( m_cachedSamplerId3D, newValue as Texture3D );
}
else
{
PreviewMaterial.SetInt( m_typeId, 1 );
if( m_cachedSamplerId == -1 )
m_cachedSamplerId = Shader.PropertyToID( "_Sampler" );
PreviewMaterial.SetTexture( m_cachedSamplerId, newValue );
}
}
public override void SetPreviewInputs()
{
base.SetPreviewInputs();
if( Value == null )
{
if( m_defaultId == -1 )
m_defaultId = Shader.PropertyToID( "_Default" );
PreviewMaterial.SetInt( m_defaultId, ( (int)m_defaultTextureValue ) + 1 );
}
else
{
if( m_defaultId == -1 )
m_defaultId = Shader.PropertyToID( "_Default" );
PreviewMaterial.SetInt( m_defaultId, 0 );
if( m_typeId == -1 )
m_typeId = Shader.PropertyToID( "_Type" );
SetPreviewTexture( Value );
//if( Value is Cubemap )
//{
// PreviewMaterial.SetInt( m_typeId, 3 );
// if( m_cachedSamplerIdCube == -1 )
// m_cachedSamplerIdCube = Shader.PropertyToID( "_Cube" );
// PreviewMaterial.SetTexture( m_cachedSamplerIdCube, Value as Cubemap );
//}
//else if( Value is Texture2DArray )
//{
// PreviewMaterial.SetInt( m_typeId, 4 );
// if( m_cachedSamplerIdArray == -1 )
// m_cachedSamplerIdArray = Shader.PropertyToID( "_Array" );
// PreviewMaterial.SetTexture( m_cachedSamplerIdArray, Value as Texture2DArray );
//}
//else if( Value is Texture3D )
//{
// PreviewMaterial.SetInt( m_typeId, 2 );
// if( m_cachedSamplerId3D == -1 )
// m_cachedSamplerId3D = Shader.PropertyToID( "_Sampler3D" );
// PreviewMaterial.SetTexture( m_cachedSamplerId3D, Value as Texture3D );
//}
//else
//{
// PreviewMaterial.SetInt( m_typeId, 1 );
// if( m_cachedSamplerId == -1 )
// m_cachedSamplerId = Shader.PropertyToID( "_Sampler" );
// PreviewMaterial.SetTexture( m_cachedSamplerId, Value );
//}
}
}
protected override void OnUniqueIDAssigned()
{
base.OnUniqueIDAssigned();
m_textureProperty = this;
UIUtils.RegisterPropertyNode( this );
UIUtils.RegisterTexturePropertyNode( this );
}
protected void ConfigTextureData( TextureType type )
{
switch( m_autocastMode )
{
case AutoCastType.Auto:
{
m_currentType = type;
}
break;
case AutoCastType.LockedToTexture1D:
{
m_currentType = TextureType.Texture1D;
}
break;
case AutoCastType.LockedToTexture2DArray:
{
m_currentType = TextureType.Texture2DArray;
}
break;
case AutoCastType.LockedToTexture2D:
{
m_currentType = TextureType.Texture2D;
}
break;
case AutoCastType.LockedToTexture3D:
{
m_currentType = TextureType.Texture3D;
}
break;
case AutoCastType.LockedToCube:
{
m_currentType = TextureType.Cube;
}
break;
}
ConfigTextureType();
}
protected void ConfigTextureType()
{
switch( m_currentType )
{
case TextureType.Texture1D:
{
m_textureType = typeof( Texture );
}
break;
case TextureType.Texture2DArray:
{
m_textureType = typeof( Texture2DArray );
}
break;
case TextureType.Texture2D:
{
m_textureType = typeof( Texture2D );
}
break;
case TextureType.Texture3D:
{
m_textureType = typeof( Texture3D );
}
break;
case TextureType.Cube:
{
m_textureType = typeof( Cubemap );
}
break;
#if !UNITY_2018_1_OR_NEWER
// Disabling Substance Deprecated warning
#pragma warning disable 0618
case TextureType.ProceduralTexture:
{
m_textureType = typeof( ProceduralTexture );
}
break;
#pragma warning restore 0618
#endif
}
}
protected void DrawTexturePropertyType()
{
PropertyType parameterType = (PropertyType)EditorGUILayoutIntPopup( ParameterTypeStr, (int)m_currentParameterType, AvailablePropertyTypeLabels, AvailablePropertyTypeValues );
if( parameterType != m_currentParameterType )
{
ChangeParameterType( parameterType );
}
}
// Texture1D
public string GetTexture1DPropertyValue()
{
return PropertyName + "(\"" + m_propertyInspectorName + "\", 2D) = \"" + m_defaultTextureValue + "\" {}";
}
public string GetTexture1DUniformValue()
{
return "uniform sampler1D " + PropertyName + ";";
}
// Texture2D
public string GetTexture2DPropertyValue()
{
return PropertyName + "(\"" + m_propertyInspectorName + "\", 2D) = \"" + m_defaultTextureValue + "\" {}";
}
public string GetTexture2DUniformValue()
{
return "uniform sampler2D " + PropertyName + ";";
}
//Texture3D
public string GetTexture3DPropertyValue()
{
return PropertyName + "(\"" + m_propertyInspectorName + "\", 3D) = \"" + m_defaultTextureValue + "\" {}";
}
public string GetTexture3DUniformValue()
{
return "uniform sampler3D " + PropertyName + ";";
}
// Cube
public string GetCubePropertyValue()
{
return PropertyName + "(\"" + m_propertyInspectorName + "\", CUBE) = \"" + m_defaultTextureValue + "\" {}";
}
public string GetCubeUniformValue()
{
return "uniform samplerCUBE " + PropertyName + ";";
}
// Texture2DArray
public string GetTexture2DArrayPropertyValue()
{
return PropertyName + "(\"" + m_propertyInspectorName + "\", 2DArray) = \"" + m_defaultTextureValue + "\" {}";
}
public string GetTexture2DArrayUniformValue()
{
return "uniform TEXTURE2D_ARRAY( " + PropertyName + " );" + "\nuniform SAMPLER( sampler" + PropertyName + " );";
}
public override void DrawMainPropertyBlock()
{
DrawTexturePropertyType();
base.DrawMainPropertyBlock();
}
public override void DrawSubProperties()
{
ShowDefaults();
EditorGUI.BeginChangeCheck();
Type currType = ( m_autocastMode == AutoCastType.Auto ) ? typeof( Texture ) : m_textureType;
m_defaultValue = EditorGUILayoutObjectField( Constants.DefaultValueLabel, m_defaultValue, currType, false ) as Texture;
if( EditorGUI.EndChangeCheck() )
{
CheckTextureImporter( true );
SetAdditonalTitleText( string.Format( Constants.PropertyValueLabel, GetPropertyValStr() ) );
}
}
public override void DrawMaterialProperties()
{
ShowDefaults();
EditorGUI.BeginChangeCheck();
Type currType = ( m_autocastMode == AutoCastType.Auto ) ? typeof( Texture ) : m_textureType;
m_materialValue = EditorGUILayoutObjectField( Constants.MaterialValueLabel, m_materialValue, currType, false ) as Texture;
if( EditorGUI.EndChangeCheck() )
{
CheckTextureImporter( true );
SetAdditonalTitleText( string.Format( Constants.PropertyValueLabel, GetPropertyValStr() ) );
}
}
new void ShowDefaults()
{
m_defaultTextureValue = (TexturePropertyValues)EditorGUILayoutEnumPopup( DefaultTextureStr, m_defaultTextureValue );
if( !m_drawAutocast )
return;
AutoCastType newAutoCast = (AutoCastType)EditorGUILayoutEnumPopup( AutoCastModeStr, m_autocastMode );
if( newAutoCast != m_autocastMode )
{
m_autocastMode = newAutoCast;
if( m_autocastMode != AutoCastType.Auto )
{
ConfigTextureData( m_currentType );
ConfigureInputPorts();
ConfigureOutputPorts();
}
}
}
private void ConfigurePortsFromReference()
{
m_sizeIsDirty = true;
}
public virtual void ConfigureOutputPorts()
{
switch( m_currentType )
{
case TextureType.Texture1D:
m_outputPorts[ 0 ].ChangeType( WirePortDataType.SAMPLER1D, false );
break;
case TextureType.ProceduralTexture:
case TextureType.Texture2D:
m_outputPorts[ 0 ].ChangeType( WirePortDataType.SAMPLER2D, false );
break;
case TextureType.Texture3D:
m_outputPorts[ 0 ].ChangeType( WirePortDataType.SAMPLER3D, false );
break;
case TextureType.Cube:
m_outputPorts[ 0 ].ChangeType( WirePortDataType.SAMPLERCUBE, false );
break;
case TextureType.Texture2DArray:
m_outputPorts[ 0 ].ChangeType( WirePortDataType.SAMPLER2D, false );
break;
}
m_sizeIsDirty = true;
}
public virtual void ConfigureInputPorts()
{
}
public virtual void AdditionalCheck()
{
}
public virtual void CheckTextureImporter( bool additionalCheck, bool writeDefault = true )
{
m_requireMaterialUpdate = true;
Texture texture = m_materialMode ? m_materialValue : m_defaultValue;
TextureImporter importer = AssetImporter.GetAtPath( AssetDatabase.GetAssetPath( texture ) ) as TextureImporter;
if( importer != null )
{
#if UNITY_5_5_OR_NEWER
m_isNormalMap = importer.textureType == TextureImporterType.NormalMap;
#else
m_isNormalMap = importer.normalmap;
#endif
if( writeDefault && !UIUtils.IsLoading )
{
if( m_defaultTextureValue == TexturePropertyValues.bump && !m_isNormalMap )
m_defaultTextureValue = TexturePropertyValues.white;
else if( m_isNormalMap )
m_defaultTextureValue = TexturePropertyValues.bump;
}
if( additionalCheck )
AdditionalCheck();
m_linearTexture = !importer.sRGBTexture;
}
if( ( texture as Texture2DArray ) != null )
{
ConfigTextureData( TextureType.Texture2DArray );
}
else if( ( texture as Texture2D ) != null )
{
ConfigTextureData( TextureType.Texture2D );
}
else if( ( texture as Texture3D ) != null )
{
ConfigTextureData( TextureType.Texture3D );
}
else if( ( texture as Cubemap ) != null )
{
ConfigTextureData( TextureType.Cube );
}
#if !UNITY_2018_1_OR_NEWER
// Disabling Substance Deprecated warning
#pragma warning disable 0618
else if( ( texture as ProceduralTexture ) != null )
{
ConfigTextureData( TextureType.ProceduralTexture );
}
#pragma warning restore 0618
#endif
ConfigureInputPorts();
ConfigureOutputPorts();
}
public override void OnObjectDropped( UnityEngine.Object obj )
{
base.OnObjectDropped( obj );
ConfigFromObject( obj );
}
public override void SetupFromCastObject( UnityEngine.Object obj )
{
base.SetupFromCastObject( obj );
ConfigFromObject( obj );
}
protected void ConfigFromObject( UnityEngine.Object obj, bool writeDefault = true, bool additionalCheck = true )
{
Texture texture = obj as Texture;
if( texture )
{
m_materialValue = texture;
m_defaultValue = texture;
CheckTextureImporter( additionalCheck, writeDefault );
}
}
public override void DrawGUIControls( DrawInfo drawInfo )
{
base.DrawGUIControls( drawInfo );
if( !( drawInfo.CurrentEventType == EventType.MouseDown || drawInfo.CurrentEventType == EventType.MouseUp || drawInfo.CurrentEventType == EventType.ExecuteCommand || drawInfo.CurrentEventType == EventType.DragPerform ) )
return;
bool insideBox = m_previewRect.Contains( drawInfo.MousePosition );
bool closePicker = false;
if( insideBox )
{
m_isEditingPicker = true;
}
else if( m_isEditingPicker && !insideBox && drawInfo.CurrentEventType != EventType.ExecuteCommand )
{
closePicker = true;
}
if( m_isEditingPicker && drawInfo.CurrentEventType == EventType.ExecuteCommand &&
Event.current.commandName.Equals( ObjectSelectorCmdStr ) )
{
closePicker = true;
}
if( closePicker )
{
GUI.FocusControl( null );
m_isEditingPicker = false;
}
}
public override void OnNodeLayout( DrawInfo drawInfo )
{
base.OnNodeLayout( drawInfo );
ConfigTextureType();
}
public override void Draw( DrawInfo drawInfo )
{
base.Draw( drawInfo );
if( m_dropdownEditing )
{
PropertyType parameterType = (PropertyType)EditorGUIIntPopup( m_dropdownRect,(int)m_currentParameterType, AvailablePropertyTypeLabels, AvailablePropertyTypeValues , UIUtils.PropertyPopUp );
if( parameterType != m_currentParameterType )
{
ChangeParameterType( parameterType );
m_dropdownEditing = false;
}
}
if( m_isEditingPicker && m_drawPicker && m_currentParameterType != PropertyType.Global)
{
Rect hitRect = m_previewRect;
hitRect.height = 14 * drawInfo.InvertedZoom;
hitRect.y = m_previewRect.yMax - hitRect.height;
hitRect.width = 4 * 14 * drawInfo.InvertedZoom;
bool restoreMouse = false;
if( Event.current.type == EventType.MouseDown && hitRect.Contains( drawInfo.MousePosition ) )
{
restoreMouse = true;
Event.current.type = EventType.Ignore;
}
EditorGUI.BeginChangeCheck();
m_colorBuffer = GUI.color;
GUI.color = Color.clear;
Type currType = ( m_autocastMode == AutoCastType.Auto ) ? typeof( Texture ) : m_textureType;
if( m_materialMode )
{
m_materialValue = EditorGUIObjectField( m_previewRect, m_materialValue, currType, false ) as Texture;
}
else
{
m_defaultValue = EditorGUIObjectField( m_previewRect, m_defaultValue, currType, false ) as Texture;
}
GUI.color = m_colorBuffer;
if( EditorGUI.EndChangeCheck() )
{
CheckTextureImporter( true );
SetTitleText( m_propertyInspectorName );
SetAdditonalTitleText( string.Format( Constants.PropertyValueLabel, GetPropertyValStr() ) );
ConfigureInputPorts();
ConfigureOutputPorts();
BeginDelayedDirtyProperty();
}
//else if( drawInfo.CurrentEventType == EventType.ExecuteCommand )
//{
// GUI.FocusControl( null );
// m_isEditingPicker = false;
//}
if( restoreMouse )
{
Event.current.type = EventType.MouseDown;
}
if( ( drawInfo.CurrentEventType == EventType.MouseDown || drawInfo.CurrentEventType == EventType.MouseUp ) )
DrawPreviewMaskButtonsLayout( drawInfo, m_previewRect );
}
if( !m_drawPicker )
return;
if( drawInfo.CurrentEventType == EventType.Repaint )
{
DrawTexturePicker( drawInfo );
}
}
protected void DrawTexturePicker( DrawInfo drawInfo )
{
Rect newRect = m_previewRect;
Texture currentValue = m_materialMode ? m_materialValue : m_defaultValue;
//???
//m_showPreview = true;
bool showButtons = m_currentParameterType != PropertyType.Global;
if( currentValue == null )
GUI.Label( newRect, string.Empty, UIUtils.ObjectFieldThumb );
else
DrawPreview( drawInfo, m_previewRect );
if( ContainerGraph.LodLevel <= ParentGraph.NodeLOD.LOD2 )
{
Rect butRect = m_previewRect;
butRect.y -= 1;
butRect.x += 1;
Rect smallButton = newRect;
smallButton.height = 14 * drawInfo.InvertedZoom;
smallButton.y = newRect.yMax - smallButton.height - 2;
smallButton.width = 40 * drawInfo.InvertedZoom;
smallButton.x = newRect.xMax - smallButton.width - 2;
if( currentValue == null )
{
if( m_previousType != m_currentType )
{
m_previousType = m_currentType;
m_labelText = "None (" + m_currentType.ToString() + ")";
}
GUI.Label( newRect, m_labelText, UIUtils.ObjectFieldThumbOverlay );
}
else if( showButtons )
{
DrawPreviewMaskButtonsRepaint( drawInfo, butRect );
}
if( showButtons )
GUI.Label( smallButton, "Select", UIUtils.GetCustomStyle( CustomStyle.SamplerButton ) );
}
GUI.Label( newRect, string.Empty, UIUtils.GetCustomStyle( CustomStyle.SamplerFrame ) );
}
public string BaseGenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalVar )
{
base.GenerateShaderForOutput( outputId, ref dataCollector, ignoreLocalVar );
return PropertyName;
}
public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalVar )
{
return BaseGenerateShaderForOutput( outputId, ref dataCollector, ignoreLocalVar );
}
public override void UpdateMaterial( Material mat )
{
base.UpdateMaterial( mat );
if( UIUtils.IsProperty( m_currentParameterType ) && !InsideShaderFunction )
{
OnPropertyNameChanged();
if( mat.HasProperty( PropertyName ) )
{
mat.SetTexture( PropertyName, m_materialValue );
}
}
}
public override void SetMaterialMode( Material mat, bool fetchMaterialValues )
{
base.SetMaterialMode( mat, fetchMaterialValues );
if( fetchMaterialValues && m_materialMode && UIUtils.IsProperty( m_currentParameterType ) )
{
if( mat.HasProperty( PropertyName ) )
{
m_materialValue = mat.GetTexture( PropertyName );
CheckTextureImporter( false, false );
}
}
}
public override void ForceUpdateFromMaterial( Material material )
{
if( UIUtils.IsProperty( m_currentParameterType ) && material.HasProperty( PropertyName ) )
{
m_materialValue = material.GetTexture( PropertyName );
CheckTextureImporter( false, false );
}
}
public override bool UpdateShaderDefaults( ref Shader shader, ref TextureDefaultsDataColector defaultCol/* ref string metaStr */)
{
if( m_defaultValue != null )
{
defaultCol.AddValue( PropertyName, m_defaultValue );
}
return true;
}
public override void ReadFromString( ref string[] nodeParams )
{
base.ReadFromString( ref nodeParams );
ReadAdditionalData( ref nodeParams );
}
public virtual void ReadAdditionalData( ref string[] nodeParams )
{
string defaultTextureGUID = GetCurrentParam( ref nodeParams );
//m_defaultValue = AssetDatabase.LoadAssetAtPath<Texture>( textureName );
if( UIUtils.CurrentShaderVersion() > 14101 )
{
m_defaultValue = AssetDatabase.LoadAssetAtPath<Texture>( AssetDatabase.GUIDToAssetPath( defaultTextureGUID ) );
string materialTextureGUID = GetCurrentParam( ref nodeParams );
m_materialValue = AssetDatabase.LoadAssetAtPath<Texture>( AssetDatabase.GUIDToAssetPath( materialTextureGUID ) );
}
else
{
m_defaultValue = AssetDatabase.LoadAssetAtPath<Texture>( defaultTextureGUID );
}
m_isNormalMap = Convert.ToBoolean( GetCurrentParam( ref nodeParams ) );
m_defaultTextureValue = (TexturePropertyValues)Enum.Parse( typeof( TexturePropertyValues ), GetCurrentParam( ref nodeParams ) );
m_autocastMode = (AutoCastType)Enum.Parse( typeof( AutoCastType ), GetCurrentParam( ref nodeParams ) );
if( UIUtils.CurrentShaderVersion() > 15306 )
{
m_currentType = (TextureType)Enum.Parse( typeof( TextureType ), GetCurrentParam( ref nodeParams ) );
}
else
{
m_currentType = TextureType.Texture2D;
}
ConfigTextureData( m_currentType );
//ConfigFromObject( m_defaultValue );
if( m_materialValue == null )
{
ConfigFromObject( m_defaultValue );
}
else
{
CheckTextureImporter( true, true );
}
ConfigureInputPorts();
ConfigureOutputPorts();
}
public override void ReadAdditionalClipboardData( ref string[] nodeParams )
{
base.ReadAdditionalClipboardData( ref nodeParams );
string textureName = GetCurrentParam( ref nodeParams );
m_materialValue = AssetDatabase.LoadAssetAtPath<Texture>( textureName );
}
public override void WriteToString( ref string nodeInfo, ref string connectionsInfo )
{
base.WriteToString( ref nodeInfo, ref connectionsInfo );
WriteAdditionalToString( ref nodeInfo, ref connectionsInfo );
}
public virtual void WriteAdditionalToString( ref string nodeInfo, ref string connectionsInfo )
{
//IOUtils.AddFieldValueToString( ref nodeInfo, ( m_defaultValue != null ) ? AssetDatabase.GetAssetPath( m_defaultValue ) : Constants.NoStringValue );
IOUtils.AddFieldValueToString( ref nodeInfo, ( m_defaultValue != null ) ? AssetDatabase.AssetPathToGUID( AssetDatabase.GetAssetPath( m_defaultValue ) ) : Constants.NoStringValue );
IOUtils.AddFieldValueToString( ref nodeInfo, ( m_materialValue != null ) ? AssetDatabase.AssetPathToGUID( AssetDatabase.GetAssetPath( m_materialValue ) ) : Constants.NoStringValue );
IOUtils.AddFieldValueToString( ref nodeInfo, m_isNormalMap.ToString() );
IOUtils.AddFieldValueToString( ref nodeInfo, m_defaultTextureValue );
IOUtils.AddFieldValueToString( ref nodeInfo, m_autocastMode );
IOUtils.AddFieldValueToString( ref nodeInfo, m_currentType );
}
public override void WriteAdditionalClipboardData( ref string nodeInfo )
{
base.WriteAdditionalClipboardData( ref nodeInfo );
IOUtils.AddFieldValueToString( ref nodeInfo, ( m_materialValue != null ) ? AssetDatabase.GetAssetPath( m_materialValue ) : Constants.NoStringValue );
}
public override void Destroy()
{
base.Destroy();
m_defaultValue = null;
m_materialValue = null;
m_textureProperty = null;
UIUtils.UnregisterPropertyNode( this );
UIUtils.UnregisterTexturePropertyNode( this );
}
public override string GetPropertyValStr()
{
return m_materialMode ? ( m_materialValue != null ? m_materialValue.name : IOUtils.NO_TEXTURES ) : ( m_defaultValue != null ? m_defaultValue.name : IOUtils.NO_TEXTURES );
}
public override string GetPropertyValue()
{
switch( m_currentType )
{
case TextureType.Texture1D:
{
return PropertyAttributes + GetTexture1DPropertyValue();
}
case TextureType.ProceduralTexture:
case TextureType.Texture2D:
{
return PropertyAttributes + GetTexture2DPropertyValue();
}
case TextureType.Texture3D:
{
return PropertyAttributes + GetTexture3DPropertyValue();
}
case TextureType.Cube:
{
return PropertyAttributes + GetCubePropertyValue();
}
case TextureType.Texture2DArray:
{
return PropertyAttributes + GetTexture2DArrayPropertyValue();
}
}
return string.Empty;
}
public override string GetUniformValue()
{
switch( m_currentType )
{
case TextureType.Texture1D:
{
return GetTexture1DUniformValue();
}
case TextureType.ProceduralTexture:
case TextureType.Texture2D:
{
return GetTexture2DUniformValue();
}
case TextureType.Texture3D:
{
return GetTexture3DUniformValue();
}
case TextureType.Cube:
{
return GetCubeUniformValue();
}
case TextureType.Texture2DArray:
{
return GetTexture2DArrayUniformValue();
}
}
return string.Empty;
}
public override bool GetUniformData( out string dataType, out string dataName )
{
if( m_currentType == TextureType.Texture2DArray )
{
MasterNode masterNode = UIUtils.CurrentWindow.OutsideGraph.CurrentMasterNode;
if( masterNode.CurrentDataCollector.IsTemplate && masterNode.CurrentDataCollector.IsSRP )
{
dataType = "TEXTURE2D_ARRAY( " + PropertyName + "";
dataName = ");\nuniform SAMPLER( sampler" + PropertyName + " )";
return true;
}
dataType = "UNITY_DECLARE_TEX2DARRAY(";
dataName = m_propertyName + " )";
return true;
}
dataType = UIUtils.TextureTypeToCgType( m_currentType );
dataName = m_propertyName;
return true;
}
public virtual string CurrentPropertyReference
{
get
{
string propertyName = string.Empty;
propertyName = PropertyName;
return propertyName;
}
}
public Texture Value
{
get { return m_materialMode ? m_materialValue : m_defaultValue; }
set
{
if( m_materialMode )
m_materialValue = value;
else
m_defaultValue = value;
}
}
public Texture MaterialValue
{
get { return m_materialValue; }
set { m_materialValue = value; }
}
public Texture DefaultValue
{
get { return m_defaultValue; }
set { m_defaultValue = value; }
}
public void SetInspectorName( string newName )
{
m_propertyInspectorName = newName;
}
public void SetPropertyName( string newName )
{
m_propertyName = newName;
}
public bool IsValid { get { return m_materialMode ? ( m_materialValue != null ) : ( m_defaultValue != null ); } }
public virtual bool IsNormalMap { get { return m_isNormalMap; } }
public bool IsLinearTexture { get { return m_linearTexture; } }
public override void OnPropertyNameChanged()
{
base.OnPropertyNameChanged();
UIUtils.UpdateTexturePropertyDataNode( UniqueId, PropertyInspectorName );
}
public override void SetGlobalValue() { Shader.SetGlobalTexture( m_propertyName, m_defaultValue ); }
public override void FetchGlobalValue() { m_materialValue = Shader.GetGlobalTexture( m_propertyName ); }
public override string DataToArray { get { return PropertyInspectorName; } }
public TextureType CurrentType { get { return m_currentType; } }
public bool DrawAutocast
{
get { return m_drawAutocast; }
set { m_drawAutocast = value; }
}
public TexturePropertyValues DefaultTextureValue
{
get { return m_defaultTextureValue; }
set { m_defaultTextureValue = value; }
}
public AutoCastType AutocastMode
{
get { return m_autocastMode; }
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Textures/TexturePropertyNode.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Textures/TexturePropertyNode.cs",
"repo_id": "jynew",
"token_count": 11158
} | 840 |
fileFormatVersion: 2
guid: ca76669baa9fa204b8ce5200eb07c1db
timeCreated: 1481126959
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Vertex/ColorVertexDataNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Vertex/ColorVertexDataNode.cs.meta",
"repo_id": "jynew",
"token_count": 101
} | 841 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
namespace AmplifyShaderEditor
{
[System.Serializable]
[NodeAttributes( "Edge Length Tessellation With Cull", "Miscellaneous", "Tessellation level computed based on triangle edge length on the screen with patch frustum culling" )]
public sealed class EdgeLengthCullTessNode : TessellationParentNode
{
private const string FunctionBody = "UnityEdgeLengthBasedTessCull( v0.vertex, v1.vertex, v2.vertex, {0},{1})";
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
AddInputPort( WirePortDataType.FLOAT, false, "Edge Length" );
AddInputPort( WirePortDataType.FLOAT, false, "Max Disp." );
AddOutputPort( WirePortDataType.FLOAT4, Constants.EmptyPortValue );
}
protected override string BuildTessellationFunction( ref MasterNodeDataCollector dataCollector )
{
return string.Format( FunctionBody,
m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector ),
m_inputPorts[ 1 ].GeneratePortInstructions( ref dataCollector ) );
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Vertex/Tessellation/EdgeLengthCullTessNode.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Vertex/Tessellation/EdgeLengthCullTessNode.cs",
"repo_id": "jynew",
"token_count": 376
} | 842 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
//
// Custom Node Vertex Tangent World
// Donated by Community Member Kebrus
using UnityEngine;
using System;
namespace AmplifyShaderEditor
{
[Serializable]
[NodeAttributes( "World Tangent", "Surface Data", "Per pixel world tangent vector", null, KeyCode.None, true, false, null, null, "kebrus" )]
public sealed class VertexTangentNode : ParentNode
{
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
AddOutputVectorPorts( WirePortDataType.FLOAT3, "XYZ" );
m_drawPreviewAsSphere = true;
m_previewShaderGUID = "61f0b80493c9b404d8c7bf56d59c3f81";
}
public override void PropagateNodeData( NodeData nodeData, ref MasterNodeDataCollector dataCollector )
{
base.PropagateNodeData( nodeData , ref dataCollector );
dataCollector.DirtyNormal = true;
}
public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar )
{
if ( dataCollector.IsTemplate )
{
return GetOutputVectorItem( 0, outputId, dataCollector.TemplateDataCollectorInstance.GetWorldTangent( m_currentPrecisionType ) );
}
if( dataCollector.PortCategory == MasterNodePortCategory.Fragment || dataCollector.PortCategory == MasterNodePortCategory.Debug )
{
dataCollector.ForceNormal = true;
dataCollector.AddToInput( UniqueId, SurfaceInputs.WORLD_NORMAL, m_currentPrecisionType );
dataCollector.AddToInput( UniqueId, SurfaceInputs.INTERNALDATA, addSemiColon: false );
}
string worldTangent = GeneratorUtils.GenerateWorldTangent( ref dataCollector, UniqueId );
return GetOutputVectorItem( 0, outputId, worldTangent );
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Vertex/VertexTangentNode.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Nodes/Vertex/VertexTangentNode.cs",
"repo_id": "jynew",
"token_count": 597
} | 843 |
fileFormatVersion: 2
guid: 2b53cc116abb0df45b028f41b8f0305e
timeCreated: 1506595629
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateFragmentDataNode.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateFragmentDataNode.cs.meta",
"repo_id": "jynew",
"token_count": 100
} | 844 |
fileFormatVersion: 2
guid: f4ff24a5a4c92f745a159f247574c07a
timeCreated: 1517854017
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateSubShader.cs.meta/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateSubShader.cs.meta",
"repo_id": "jynew",
"token_count": 102
} | 845 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using UnityEngine;
using UnityEditor;
using System;
using System.Reflection;
using AmplifyShaderEditor;
public static class MaterialPropertyHandlerEx
{
private static System.Type type = null;
public static System.Type Type { get { return ( type == null ) ? type = System.Type.GetType( "UnityEditor.MaterialPropertyHandler, UnityEditor" ) : type; } }
public static object GetHandler( Shader shader, string name )
{
return MaterialPropertyHandlerEx.Type.InvokeMember( "GetHandler", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, null, new object[] { shader, name } );
}
public static void OnGUI( object obj, ref Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor )
{
Type.InvokeMember( "OnGUI", BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod, null, obj, new object[] { position, prop, label, editor } );
}
public static float GetPropertyHeight( object obj, MaterialProperty prop, string label, MaterialEditor editor )
{
return (float)Type.InvokeMember( "GetPropertyHeight", BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod, null, obj, new object[] { prop, label, editor } );
}
public static object PropertyDrawer( object obj )
{
return Type.InvokeMember( "propertyDrawer", BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty, null, obj, new object[] {} );
}
}
internal class ASEMaterialInspector : ShaderGUI
{
private const string CopyButtonStr = "Copy Values";
private const string PasteButtonStr = "Paste Values";
private const string PreviewModelPref = "ASEMI_PREVIEWMODEL";
private static MaterialEditor m_instance = null;
private static bool m_refreshOnUndo = false;
private bool m_initialized = false;
private double m_lastRenderedTime;
private PreviewRenderUtility m_previewRenderUtility;
private Mesh m_targetMesh;
private Vector2 m_previewDir = new Vector2( 120f, -20f );
private int m_selectedMesh = 0;
// Reflection Fields
private Type m_modelInspectorType = null;
private MethodInfo m_renderMeshMethod = null;
private Type m_previewGUIType = null;
private MethodInfo m_dragMethod = null;
private FieldInfo m_selectedField = null;
private FieldInfo m_infoField = null;
#if UNITY_2018_2_OR_NEWER
public override void OnClosed( Material material )
{
base.OnClosed( material );
CleanUp();
}
#endif
void CleanUp()
{
if( m_previewRenderUtility != null )
{
m_previewRenderUtility.Cleanup();
m_previewRenderUtility = null;
}
}
void UndoRedoPerformed()
{
m_refreshOnUndo = true;
}
~ASEMaterialInspector()
{
Undo.undoRedoPerformed -= UndoRedoPerformed;
CleanUp();
}
public override void OnGUI( MaterialEditor materialEditor, MaterialProperty[] properties )
{
IOUtils.Init();
Material mat = materialEditor.target as Material;
if( mat == null )
return;
m_instance = materialEditor;
if( !m_initialized )
{
Init();
m_initialized = true;
Undo.undoRedoPerformed += UndoRedoPerformed;
}
if( Event.current.type == EventType.Repaint &&
mat.HasProperty( IOUtils.DefaultASEDirtyCheckId ) &&
mat.GetInt( IOUtils.DefaultASEDirtyCheckId ) == 1 )
{
mat.SetInt( IOUtils.DefaultASEDirtyCheckId, 0 );
UIUtils.ForceUpdateFromMaterial();
//Event.current.Use();
}
if( materialEditor.isVisible )
{
GUILayout.BeginVertical();
{
GUILayout.Space( 3 );
if( GUILayout.Button( "Open in Shader Editor" ) )
{
AmplifyShaderEditorWindow.LoadMaterialToASE( mat );
}
GUILayout.BeginHorizontal();
{
if( GUILayout.Button( CopyButtonStr ) )
{
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
Shader shader = mat.shader;
int propertyCount = UnityEditor.ShaderUtil.GetPropertyCount( shader );
string allProperties = string.Empty;
for( int i = 0; i < propertyCount; i++ )
{
UnityEditor.ShaderUtil.ShaderPropertyType type = UnityEditor.ShaderUtil.GetPropertyType( shader, i );
string name = UnityEditor.ShaderUtil.GetPropertyName( shader, i );
string valueStr = string.Empty;
switch( type )
{
case UnityEditor.ShaderUtil.ShaderPropertyType.Color:
{
Color value = mat.GetColor( name );
valueStr = value.r.ToString() + IOUtils.VECTOR_SEPARATOR +
value.g.ToString() + IOUtils.VECTOR_SEPARATOR +
value.b.ToString() + IOUtils.VECTOR_SEPARATOR +
value.a.ToString();
}
break;
case UnityEditor.ShaderUtil.ShaderPropertyType.Vector:
{
Vector4 value = mat.GetVector( name );
valueStr = value.x.ToString() + IOUtils.VECTOR_SEPARATOR +
value.y.ToString() + IOUtils.VECTOR_SEPARATOR +
value.z.ToString() + IOUtils.VECTOR_SEPARATOR +
value.w.ToString();
}
break;
case UnityEditor.ShaderUtil.ShaderPropertyType.Float:
{
float value = mat.GetFloat( name );
valueStr = value.ToString();
}
break;
case UnityEditor.ShaderUtil.ShaderPropertyType.Range:
{
float value = mat.GetFloat( name );
valueStr = value.ToString();
}
break;
case UnityEditor.ShaderUtil.ShaderPropertyType.TexEnv:
{
Texture value = mat.GetTexture( name );
valueStr = AssetDatabase.GetAssetPath( value );
Vector2 offset = mat.GetTextureOffset( name );
Vector2 scale = mat.GetTextureScale( name );
valueStr += IOUtils.VECTOR_SEPARATOR + scale.x.ToString() +
IOUtils.VECTOR_SEPARATOR + scale.y.ToString() +
IOUtils.VECTOR_SEPARATOR + offset.x.ToString() +
IOUtils.VECTOR_SEPARATOR + offset.y.ToString();
}
break;
}
allProperties += name + IOUtils.FIELD_SEPARATOR + type + IOUtils.FIELD_SEPARATOR + valueStr;
if( i < ( propertyCount - 1 ) )
{
allProperties += IOUtils.LINE_TERMINATOR;
}
}
EditorPrefs.SetString( IOUtils.MAT_CLIPBOARD_ID, allProperties );
System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture;
}
if( GUILayout.Button( PasteButtonStr ) )
{
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
string propertiesStr = EditorPrefs.GetString( IOUtils.MAT_CLIPBOARD_ID, string.Empty );
if( !string.IsNullOrEmpty( propertiesStr ) )
{
string[] propertyArr = propertiesStr.Split( IOUtils.LINE_TERMINATOR );
bool validData = true;
try
{
for( int i = 0; i < propertyArr.Length; i++ )
{
string[] valuesArr = propertyArr[ i ].Split( IOUtils.FIELD_SEPARATOR );
if( valuesArr.Length != 3 )
{
Debug.LogWarning( "Material clipboard data is corrupted" );
validData = false;
break;
}
else if( mat.HasProperty( valuesArr[ 0 ] ) )
{
UnityEditor.ShaderUtil.ShaderPropertyType type = (UnityEditor.ShaderUtil.ShaderPropertyType)Enum.Parse( typeof( UnityEditor.ShaderUtil.ShaderPropertyType ), valuesArr[ 1 ] );
switch( type )
{
case UnityEditor.ShaderUtil.ShaderPropertyType.Color:
{
string[] colorVals = valuesArr[ 2 ].Split( IOUtils.VECTOR_SEPARATOR );
if( colorVals.Length != 4 )
{
Debug.LogWarning( "Material clipboard data is corrupted" );
validData = false;
break;
}
else
{
mat.SetColor( valuesArr[ 0 ], new Color( Convert.ToSingle( colorVals[ 0 ] ),
Convert.ToSingle( colorVals[ 1 ] ),
Convert.ToSingle( colorVals[ 2 ] ),
Convert.ToSingle( colorVals[ 3 ] ) ) );
}
}
break;
case UnityEditor.ShaderUtil.ShaderPropertyType.Vector:
{
string[] vectorVals = valuesArr[ 2 ].Split( IOUtils.VECTOR_SEPARATOR );
if( vectorVals.Length != 4 )
{
Debug.LogWarning( "Material clipboard data is corrupted" );
validData = false;
break;
}
else
{
mat.SetVector( valuesArr[ 0 ], new Vector4( Convert.ToSingle( vectorVals[ 0 ] ),
Convert.ToSingle( vectorVals[ 1 ] ),
Convert.ToSingle( vectorVals[ 2 ] ),
Convert.ToSingle( vectorVals[ 3 ] ) ) );
}
}
break;
case UnityEditor.ShaderUtil.ShaderPropertyType.Float:
{
mat.SetFloat( valuesArr[ 0 ], Convert.ToSingle( valuesArr[ 2 ] ) );
}
break;
case UnityEditor.ShaderUtil.ShaderPropertyType.Range:
{
mat.SetFloat( valuesArr[ 0 ], Convert.ToSingle( valuesArr[ 2 ] ) );
}
break;
case UnityEditor.ShaderUtil.ShaderPropertyType.TexEnv:
{
string[] texVals = valuesArr[ 2 ].Split( IOUtils.VECTOR_SEPARATOR );
if( texVals.Length != 5 )
{
Debug.LogWarning( "Material clipboard data is corrupted" );
validData = false;
break;
}
else
{
mat.SetTexture( valuesArr[ 0 ], AssetDatabase.LoadAssetAtPath<Texture>( texVals[ 0 ] ) );
mat.SetTextureScale( valuesArr[ 0 ], new Vector2( Convert.ToSingle( texVals[ 1 ] ), Convert.ToSingle( texVals[ 2 ] ) ) );
mat.SetTextureOffset( valuesArr[ 0 ], new Vector2( Convert.ToSingle( texVals[ 3 ] ), Convert.ToSingle( texVals[ 4 ] ) ) );
}
}
break;
}
}
}
}
catch( Exception e )
{
Debug.LogException( e );
validData = false;
}
if( validData )
{
materialEditor.PropertiesChanged();
UIUtils.CopyValuesFromMaterial( mat );
}
else
{
EditorPrefs.SetString( IOUtils.MAT_CLIPBOARD_ID, string.Empty );
}
}
System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture;
}
}
GUILayout.EndHorizontal();
GUILayout.Space( 5 );
}
GUILayout.EndVertical();
}
EditorGUI.BeginChangeCheck();
//base.OnGUI( materialEditor, properties );
// Draw custom properties instead of calling BASE to use single line texture properties
materialEditor.SetDefaultGUIWidths();
if( m_infoField == null )
{
m_infoField = typeof( MaterialEditor ).GetField( "m_InfoMessage", BindingFlags.Instance | BindingFlags.NonPublic );
}
string info = m_infoField.GetValue( materialEditor ) as string;
if( !string.IsNullOrEmpty( info ) )
{
EditorGUILayout.HelpBox( info, MessageType.Info );
}
else
{
GUIUtility.GetControlID( "EditorTextField".GetHashCode(), FocusType.Passive, new Rect( 0f, 0f, 0f, 0f ) );
}
for( int i = 0; i < properties.Length; i++ )
{
if( ( properties[ i ].flags & ( MaterialProperty.PropFlags.HideInInspector | MaterialProperty.PropFlags.PerRendererData ) ) == MaterialProperty.PropFlags.None )
{
if( ( properties[ i ].flags & MaterialProperty.PropFlags.NoScaleOffset ) == MaterialProperty.PropFlags.NoScaleOffset )
{
object obj = MaterialPropertyHandlerEx.GetHandler( mat.shader, properties[ i ].name );
if( obj != null )
{
float height = MaterialPropertyHandlerEx.GetPropertyHeight( obj, properties[ i ], properties[ i ].displayName, materialEditor );
//Rect rect = (Rect)materialEditor.GetType().InvokeMember( "GetPropertyRect", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod, null, materialEditor, new object[] { properties[ i ], properties[ i ].displayName, true } );
Rect rect = EditorGUILayout.GetControlRect( true, height, EditorStyles.layerMaskField );
MaterialPropertyHandlerEx.OnGUI( obj, ref rect, properties[ i ], new GUIContent( properties[ i ].displayName ), materialEditor );
if( MaterialPropertyHandlerEx.PropertyDrawer( obj ) != null )
continue;
rect = EditorGUILayout.GetControlRect( true, height, EditorStyles.layerMaskField );
materialEditor.TexturePropertyMiniThumbnail( rect, properties[ i ], properties[ i ].displayName, string.Empty );
}
else
{
materialEditor.TexturePropertySingleLine( new GUIContent( properties[ i ].displayName ), properties[ i ] );
}
}
else
{
float propertyHeight = materialEditor.GetPropertyHeight( properties[ i ], properties[ i ].displayName );
Rect controlRect = EditorGUILayout.GetControlRect( true, propertyHeight, EditorStyles.layerMaskField, new GUILayoutOption[ 0 ] );
materialEditor.ShaderProperty( controlRect, properties[ i ], properties[ i ].displayName );
}
}
}
EditorGUILayout.Space();
materialEditor.RenderQueueField();
#if UNITY_5_6_OR_NEWER
materialEditor.EnableInstancingField();
#endif
#if UNITY_5_6_2 || UNITY_5_6_3 || UNITY_5_6_4 || UNITY_2017_1_OR_NEWER
materialEditor.DoubleSidedGIField();
#endif
materialEditor.LightmapEmissionProperty();
if( m_refreshOnUndo || EditorGUI.EndChangeCheck() )
{
m_refreshOnUndo = false;
string isEmissive = mat.GetTag( "IsEmissive", false, "false" );
if( isEmissive.Equals( "true" ) )
{
mat.globalIlluminationFlags &= (MaterialGlobalIlluminationFlags)3;
}
else
{
mat.globalIlluminationFlags |= MaterialGlobalIlluminationFlags.EmissiveIsBlack;
}
UIUtils.CopyValuesFromMaterial( mat );
}
if( materialEditor.RequiresConstantRepaint() && m_lastRenderedTime + 0.032999999821186066 < EditorApplication.timeSinceStartup )
{
this.m_lastRenderedTime = EditorApplication.timeSinceStartup;
materialEditor.Repaint();
}
}
private void Init()
{
string guid = EditorPrefs.GetString( PreviewModelPref, "" );
if( !string.IsNullOrEmpty( guid ) )
{
m_targetMesh = AssetDatabase.LoadAssetAtPath<Mesh>( AssetDatabase.GUIDToAssetPath( guid ) );
}
}
public override void OnMaterialPreviewSettingsGUI( MaterialEditor materialEditor )
{
base.OnMaterialPreviewSettingsGUI( materialEditor );
if( UnityEditor.ShaderUtil.hardwareSupportsRectRenderTexture )
{
EditorGUI.BeginChangeCheck();
m_targetMesh = (Mesh)EditorGUILayout.ObjectField( m_targetMesh, typeof( Mesh ), false, GUILayout.MaxWidth( 120 ) );
if( EditorGUI.EndChangeCheck() )
{
if( m_targetMesh != null )
{
EditorPrefs.SetString( PreviewModelPref, AssetDatabase.AssetPathToGUID( AssetDatabase.GetAssetPath( m_targetMesh ) ) );
}
else
{
EditorPrefs.SetString( PreviewModelPref, "" );
}
}
if( m_selectedField == null )
{
m_selectedField = typeof( MaterialEditor ).GetField( "m_SelectedMesh", BindingFlags.Instance | BindingFlags.NonPublic );
}
m_selectedMesh = (int)m_selectedField.GetValue( materialEditor );
if( m_selectedMesh != 0 )
{
if( m_targetMesh != null )
{
m_targetMesh = null;
EditorPrefs.SetString( PreviewModelPref, "" );
}
}
}
}
public override void OnMaterialInteractivePreviewGUI( MaterialEditor materialEditor, Rect r, GUIStyle background )
{
if( Event.current.type == EventType.DragExited )
{
if( DragAndDrop.objectReferences.Length > 0 )
{
GameObject dropped = DragAndDrop.objectReferences[ 0 ] as GameObject;
if( dropped != null )
{
m_targetMesh = AssetDatabase.LoadAssetAtPath<Mesh>( AssetDatabase.GetAssetPath( dropped ) );
EditorPrefs.SetString( PreviewModelPref, AssetDatabase.AssetPathToGUID( AssetDatabase.GetAssetPath( m_targetMesh ) ) );
}
}
}
if( m_targetMesh == null )
{
base.OnMaterialInteractivePreviewGUI( materialEditor, r, background );
return;
}
Material mat = materialEditor.target as Material;
if( m_previewRenderUtility == null )
{
m_previewRenderUtility = new PreviewRenderUtility();
#if UNITY_2017_1_OR_NEWER
m_previewRenderUtility.cameraFieldOfView = 30f;
#else
m_previewRenderUtility.m_CameraFieldOfView = 30f;
#endif
}
if( m_previewGUIType == null )
{
m_previewGUIType = Type.GetType( "PreviewGUI, UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" );
m_dragMethod = m_previewGUIType.GetMethod( "Drag2D", BindingFlags.Static | BindingFlags.Public );
}
if( m_modelInspectorType == null )
{
m_modelInspectorType = Type.GetType( "UnityEditor.ModelInspector, UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" );
m_renderMeshMethod = m_modelInspectorType.GetMethod( "RenderMeshPreview", BindingFlags.Static | BindingFlags.NonPublic );
}
m_previewDir = (Vector2)m_dragMethod.Invoke( m_previewGUIType, new object[] { m_previewDir, r } );
if( Event.current.type == EventType.Repaint )
{
m_previewRenderUtility.BeginPreview( r, background );
m_renderMeshMethod.Invoke( m_modelInspectorType, new object[] { m_targetMesh, m_previewRenderUtility, mat, null, m_previewDir, -1 } );
m_previewRenderUtility.EndAndDrawPreview( r );
}
}
public static MaterialEditor Instance { get { return m_instance; } set { m_instance = value; } }
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Utils/CustomMaterialInspector.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Utils/CustomMaterialInspector.cs",
"repo_id": "jynew",
"token_count": 7319
} | 846 |
using UnityEditor;
using UnityEngine;
namespace AmplifyShaderEditor
{
[InitializeOnLoad]
public class InvalidDataChecker
{
private static string[] m_invalidData = { "674ea7bed6b1cd94b8057074298096db", //"/Samples",
"2738539936eacef409be91f148b2a4a0", //"/Resources",
"c880e50f07f2be9499d414ac6f9f3a7a", //"/Templates",
"563f992b9989cf547ac59bf748442c17"};//"/Textures"};
//private static string m_ASEFolderPath;
private static string m_invalidDataCollected = string.Empty;
static InvalidDataChecker()
{
bool foundInvalidData = false;
//m_ASEFolderPath = AssetDatabase.GUIDToAssetPath( IOUtils.ASEFolderGUID );
int count = 0;
for ( int i = 0; i < m_invalidData.Length; i++ )
{
//m_invalidData[ i ] = m_ASEFolderPath + m_invalidData[ i ];
m_invalidData[ i ] = AssetDatabase.GUIDToAssetPath( m_invalidData[ i ] );
if ( AssetDatabase.IsValidFolder( m_invalidData[ i ] ) )
{
foundInvalidData = true;
m_invalidDataCollected += m_invalidData[ i ]+"\n";
count += 1;
}
}
if ( count < 5 )
{
for ( ; count < 5; count++ )
{
m_invalidDataCollected += "\n";
}
}
if ( foundInvalidData )
{
InvalidDataPopUp window = ( InvalidDataPopUp ) EditorWindow.GetWindow( typeof( InvalidDataPopUp ), true, "Found Invalid Data" );
window.minSize = new Vector2( 502, 265 );
window.maxSize = new Vector2( 502, 265 );
window.Show();
}
}
public static void CleanInvalidData()
{
for ( int i = 0; i < m_invalidData.Length; i++ )
{
if ( FileUtil.DeleteFileOrDirectory( m_invalidData[ i ] ) )
{
Debug.Log( "Removed invalid " + m_invalidData[ i ] );
if ( FileUtil.DeleteFileOrDirectory( m_invalidData[ i ] + ".meta" ) )
{
Debug.Log( "Removed invalid " + m_invalidData[ i ] + ".meta" );
}
}
}
AssetDatabase.Refresh();
}
public static string InvalidDataCollected { get { return m_invalidDataCollected; } }
}
public class InvalidDataPopUp : EditorWindow
{
private readonly GUIContent m_buttonContent = new GUIContent( "Remove Invalid Data" );
private Vector2 m_scrollPosition = Vector2.zero;
public void OnGUI()
{
GUILayout.BeginVertical();
{
GUIStyle labelStyle = new GUIStyle( EditorStyles.label );
labelStyle.alignment = TextAnchor.MiddleCenter;
labelStyle.wordWrap = true;
GUILayout.Label( "\nAmplify Shader Editor " + VersionInfo.StaticToString(), labelStyle, GUILayout.ExpandWidth( true ) );
GUILayout.Space( 5 );
GUILayout.Label( "Invalid/Legacy Data was found on your previous ASE folder which needs to be removed in order for it to work correctly." , labelStyle, GUILayout.ExpandWidth( true ) );
GUILayout.Space( 5 );
GUILayout.Label( "Below are the detected files/folders which require to be removed.", labelStyle, GUILayout.ExpandWidth( true ) );
GUILayout.Space( 5 );
m_scrollPosition = GUILayout.BeginScrollView( m_scrollPosition ,GUILayout.Height(85));
GUILayout.TextArea( InvalidDataChecker.InvalidDataCollected );
GUILayout.EndScrollView();
GUILayout.Label( "VERY IMPORTANT: If you have assets of yours inside these folders you need to move them to another location before hitting the button below or they will be PERMANENTLY DELETED", labelStyle, GUILayout.ExpandWidth( true ) );
GUILayout.Space( 5 );
GUILayout.BeginHorizontal();
{
GUILayout.Space( 151 );
if ( GUILayout.Button( m_buttonContent, GUILayout.Width( 200 ) ) )
{
InvalidDataChecker.CleanInvalidData();
Close();
}
}
GUILayout.EndHorizontal();
}
GUILayout.EndVertical();
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Utils/InvalidDataChecker.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Utils/InvalidDataChecker.cs",
"repo_id": "jynew",
"token_count": 1517
} | 847 |
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public static class WindowHelper
{
private class R_EditorWindow
{
private EditorWindow m_instance;
private System.Type m_type;
public R_EditorWindow( EditorWindow instance )
{
m_instance = instance;
m_type = instance.GetType();
}
public object Parent
{
get
{
var field = m_type.GetField( "m_Parent", BindingFlags.Instance | BindingFlags.NonPublic );
return field.GetValue( m_instance );
}
}
}
private class R_DockArea
{
private object m_instance;
private System.Type m_type;
public R_DockArea( object instance )
{
m_instance = instance;
m_type = instance.GetType();
}
public object Window
{
get
{
var property = m_type.GetProperty( "window", BindingFlags.Instance | BindingFlags.Public );
return property.GetValue( m_instance, null );
}
}
public object OriginalDragSource
{
set
{
var field = m_type.GetField( "s_OriginalDragSource", BindingFlags.Static | BindingFlags.NonPublic );
field.SetValue( null, value );
}
}
public void AddTab( EditorWindow pane )
{
#if UNITY_2018_3_OR_NEWER
var method = m_type.GetMethod( "AddTab", BindingFlags.Instance | BindingFlags.Public, null, new System.Type[] { typeof( EditorWindow ), typeof( bool ) }, null );
method.Invoke( m_instance, new object[] { pane, true } );
#else
var method = m_type.GetMethod( "AddTab", BindingFlags.Instance | BindingFlags.Public, null, new System.Type[] { typeof( EditorWindow ) }, null );
method.Invoke( m_instance, new object[] { pane } );
#endif
}
}
private class R_ContainerWindow
{
private object m_instance;
private System.Type m_type;
public R_ContainerWindow( object instance )
{
m_instance = instance;
m_type = instance.GetType();
}
public object RootSplitView
{
get
{
var property = m_type.GetProperty( "rootSplitView", BindingFlags.Instance | BindingFlags.Public );
return property.GetValue( m_instance, null );
}
}
}
private class R_SplitView
{
private object m_instance;
private System.Type m_type;
public R_SplitView( object instance )
{
m_instance = instance;
m_type = instance.GetType();
}
public object DragOver( EditorWindow child, Vector2 screenPoint )
{
var method = m_type.GetMethod( "DragOver", BindingFlags.Instance | BindingFlags.Public );
return method.Invoke( m_instance, new object[] { child, screenPoint } );
}
public void PerformDrop( EditorWindow child, object dropInfo, Vector2 screenPoint )
{
var method = m_type.GetMethod( "PerformDrop", BindingFlags.Instance | BindingFlags.Public );
method.Invoke( m_instance, new object[] { child, dropInfo, screenPoint } );
}
}
public enum DockPosition
{
Left,
Top,
Right,
Bottom
}
/// <summary>
/// Docks the second window to the first window at the given position
/// </summary>
public static void Dock( this EditorWindow wnd, EditorWindow other, DockPosition position )
{
var mousePosition = GetFakeMousePosition( wnd, position );
var parent = new R_EditorWindow( wnd );
var child = new R_EditorWindow( other );
var dockArea = new R_DockArea( parent.Parent );
var containerWindow = new R_ContainerWindow( dockArea.Window );
var splitView = new R_SplitView( containerWindow.RootSplitView );
var dropInfo = splitView.DragOver( other, mousePosition );
dockArea.OriginalDragSource = child.Parent;
splitView.PerformDrop( other, dropInfo, mousePosition );
}
/// <summary>
/// Adds the the second window as a tab at the end of the first window tab list
/// </summary>
/// <param name="existingWindow"></param>
/// <param name="newWindow"></param>
public static void AddTab( this EditorWindow existingWindow, EditorWindow newWindow )
{
var parent = new R_EditorWindow( existingWindow );
var child = new R_EditorWindow( newWindow );
var dockArea = new R_DockArea( parent.Parent );
dockArea.OriginalDragSource = child.Parent;
dockArea.AddTab( newWindow );
}
private static Vector2 GetFakeMousePosition( EditorWindow wnd, DockPosition position )
{
Vector2 mousePosition = Vector2.zero;
// The 20 is required to make the docking work.
// Smaller values might not work when faking the mouse position.
switch ( position )
{
case DockPosition.Left:
mousePosition = new Vector2( 20, wnd.position.size.y / 2 );
break;
case DockPosition.Top:
mousePosition = new Vector2( wnd.position.size.x / 2, 20 );
break;
case DockPosition.Right:
mousePosition = new Vector2( wnd.position.size.x - 20, wnd.position.size.y / 2 );
break;
case DockPosition.Bottom:
mousePosition = new Vector2( wnd.position.size.x / 2, wnd.position.size.y - 20 );
break;
}
return GUIUtility.GUIToScreenPoint( mousePosition );
}
}
#endif
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Utils/WindowHelper.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Utils/WindowHelper.cs",
"repo_id": "jynew",
"token_count": 1676
} | 848 |
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
namespace AmplifyShaderEditor
{
public enum WirePortDataType
{
OBJECT = 1 << 1,
FLOAT = 1 << 2,
FLOAT2 = 1 << 3,
FLOAT3 = 1 << 4,
FLOAT4 = 1 << 5,
FLOAT3x3 = 1 << 6,
FLOAT4x4 = 1 << 7,
COLOR = 1 << 8,
INT = 1 << 9,
SAMPLER1D = 1 << 10,
SAMPLER2D = 1 << 11,
SAMPLER3D = 1 << 12,
SAMPLERCUBE = 1 << 13,
UINT = 1 << 14
}
public enum VariableQualifiers
{
In = 0,
Out,
InOut
}
public struct WirePortDataTypeComparer : IEqualityComparer<WirePortDataType>
{
public bool Equals( WirePortDataType x, WirePortDataType y )
{
return x == y;
}
public int GetHashCode( WirePortDataType obj )
{
// you need to do some thinking here,
return (int)obj;
}
}
[System.Serializable]
public class WirePort
{
private const double PortClickTime = 0.2;
private double m_lastTimeClicked = -1;
private Vector2 m_labelSize;
private Vector2 m_unscaledLabelSize;
protected bool m_dirtyLabelSize = true;
private bool m_isEditable = false;
private bool m_editingName = false;
protected int m_portRestrictions = 0;
private bool m_repeatButtonState = false;
[SerializeField]
private Rect m_position;
[SerializeField]
private Rect m_labelPosition;
[SerializeField]
protected int m_nodeId = -1;
[SerializeField]
protected int m_portId = -1;
[SerializeField]
protected int m_orderId = -1;
[SerializeField]
protected WirePortDataType m_dataType = WirePortDataType.FLOAT;
[SerializeField]
protected string m_name;
[SerializeField]
protected List<WireReference> m_externalReferences;
[SerializeField]
protected bool m_locked = false;
[SerializeField]
protected bool m_visible = true;
[SerializeField]
protected bool m_isDummy = false;
[SerializeField]
protected bool m_hasCustomColor = false;
[SerializeField]
protected Color m_customColor = Color.white;
[SerializeField]
protected Rect m_activePortArea;
public WirePort( int nodeId, int portId, WirePortDataType dataType, string name, int orderId = -1 )
{
m_nodeId = nodeId;
m_portId = portId;
m_orderId = orderId;
m_dataType = dataType;
m_name = name;
m_externalReferences = new List<WireReference>();
}
public virtual void Destroy()
{
m_externalReferences.Clear();
m_externalReferences = null;
}
public void AddPortForbiddenTypes( params WirePortDataType[] forbiddenTypes )
{
if( forbiddenTypes != null )
{
if( m_portRestrictions == 0 )
{
//if no previous restrictions are detected then we set up the bit array so we can set is bit correctly
m_portRestrictions = int.MaxValue;
}
for( int i = 0; i < forbiddenTypes.Length; i++ )
{
m_portRestrictions = m_portRestrictions & ( int.MaxValue - (int)forbiddenTypes[ i ] );
}
}
}
public void AddPortRestrictions( params WirePortDataType[] validTypes )
{
if( validTypes != null )
{
for( int i = 0; i < validTypes.Length; i++ )
{
m_portRestrictions = m_portRestrictions | (int)validTypes[ i ];
}
}
}
public void CreatePortRestrictions( params WirePortDataType[] validTypes )
{
m_portRestrictions = 0;
if( validTypes != null )
{
for( int i = 0; i < validTypes.Length; i++ )
{
m_portRestrictions = m_portRestrictions | (int)validTypes[ i ];
}
}
}
public virtual bool CheckValidType( WirePortDataType dataType )
{
if( m_portRestrictions == 0 )
{
return true;
}
return ( m_portRestrictions & (int)dataType ) != 0;
}
public bool ConnectTo( WireReference port )
{
if( m_locked )
return false;
if( m_externalReferences.Contains( port ) )
return false;
m_externalReferences.Add( port );
return true;
}
public bool ConnectTo( int nodeId, int portId )
{
if( m_locked )
return false;
foreach( WireReference reference in m_externalReferences )
{
if( reference.NodeId == nodeId && reference.PortId == portId )
{
return false;
}
}
m_externalReferences.Add( new WireReference( nodeId, portId, m_dataType, false ) );
return true;
}
public bool ConnectTo( int nodeId, int portId, WirePortDataType dataType, bool typeLocked )
{
if( m_locked )
return false;
foreach( WireReference reference in m_externalReferences )
{
if( reference.NodeId == nodeId && reference.PortId == portId )
{
return false;
}
}
m_externalReferences.Add( new WireReference( nodeId, portId, dataType, typeLocked ) );
return true;
}
public void DummyAdd( int nodeId, int portId )
{
m_externalReferences.Insert( 0, new WireReference( nodeId, portId, WirePortDataType.OBJECT, false ) );
m_isDummy = true;
}
public void DummyRemove()
{
m_externalReferences.RemoveAt( 0 );
m_isDummy = false;
}
public void DummyClear()
{
m_externalReferences.Clear();
m_isDummy = false;
}
public WireReference GetConnection( int connID = 0 )
{
if( connID < m_externalReferences.Count )
return m_externalReferences[ connID ];
return null;
}
public void ChangeProperties( string newName, WirePortDataType newType, bool invalidateConnections )
{
Name = newName;
ChangeType( newType, invalidateConnections );
//if ( m_dataType != newType )
//{
// DataType = newType;
// if ( invalidateConnections )
// {
// InvalidateAllConnections();
// }
// else
// {
// NotifyExternalRefencesOnChange();
// }
//}
}
public void ChangeType( WirePortDataType newType, bool invalidateConnections )
{
if( m_dataType != newType )
{
//ParentNode node = UIUtils.GetNode( m_nodeId );
//if ( node )
//{
// Undo.RegisterCompleteObjectUndo( node.ContainerGraph.ParentWindow, Constants.UndoChangeTypeNodesId );
// Undo.RecordObject( node, Constants.UndoChangeTypeNodesId );
//}
DataType = newType;
if( invalidateConnections )
{
InvalidateAllConnections();
}
else
{
NotifyExternalRefencesOnChange();
}
}
}
public virtual void ChangePortId( int newId ) { }
public virtual void NotifyExternalRefencesOnChange() { }
public void UpdateInfoOnExternalConn( int nodeId, int portId, WirePortDataType type )
{
for( int i = 0; i < m_externalReferences.Count; i++ )
{
if( m_externalReferences[ i ].NodeId == nodeId && m_externalReferences[ i ].PortId == portId )
{
m_externalReferences[ i ].DataType = type;
}
}
}
public void InvalidateConnection( int nodeId, int portId )
{
int id = -1;
for( int i = 0; i < m_externalReferences.Count; i++ )
{
if( m_externalReferences[ i ].NodeId == nodeId && m_externalReferences[ i ].PortId == portId )
{
id = i;
break;
}
}
if( id > -1 )
m_externalReferences.RemoveAt( id );
}
public void RemoveInvalidConnections()
{
Debug.Log( "Cleaning invalid connections" );
List<WireReference> validConnections = new List<WireReference>();
for( int i = 0; i < m_externalReferences.Count; i++ )
{
if( m_externalReferences[ i ].IsValid )
{
validConnections.Add( m_externalReferences[ i ] );
}
else
{
Debug.Log( "Detected invalid connection on node " + m_nodeId + " port " + m_portId );
}
}
m_externalReferences.Clear();
m_externalReferences = validConnections;
}
public void InvalidateAllConnections()
{
m_externalReferences.Clear();
}
public virtual void FullDeleteConnections() { }
public bool IsConnectedTo( int nodeId, int portId )
{
if( m_locked )
return false;
for( int i = 0; i < m_externalReferences.Count; i++ )
{
if( m_externalReferences[ i ].NodeId == nodeId && m_externalReferences[ i ].PortId == portId )
return true;
}
return false;
}
public WirePortDataType ConnectionType( int id = 0 )
{
return ( id < m_externalReferences.Count ) ? m_externalReferences[ id ].DataType : DataType;
}
public bool CheckMatchConnectionType( int id = 0 )
{
if( id < m_externalReferences.Count )
return m_externalReferences[ id ].DataType == DataType;
return false;
}
public void MatchPortToConnection( int id = 0 )
{
if( id < m_externalReferences.Count )
{
DataType = m_externalReferences[ id ].DataType;
}
}
public void ResetWireReferenceStatus()
{
for( int i = 0; i < m_externalReferences.Count; i++ )
{
m_externalReferences[ i ].WireStatus = WireStatus.Default;
}
}
public bool InsideActiveArea( Vector2 pos )
{
return m_activePortArea.Contains( pos );
}
public void Click()
{
if( m_isEditable )
{
if( ( EditorApplication.timeSinceStartup - m_lastTimeClicked ) < PortClickTime )
{
m_editingName = true;
GUI.FocusControl( "port" + m_nodeId.ToString() + m_portId.ToString() );
TextEditor te = (TextEditor)GUIUtility.GetStateObject( typeof( TextEditor ), GUIUtility.keyboardControl );
if( te != null )
{
te.SelectAll();
}
}
m_lastTimeClicked = EditorApplication.timeSinceStartup;
}
}
public bool Draw( Rect textPos, GUIStyle style )
{
bool changeFlag = false;
if( m_isEditable && m_editingName )
{
textPos.width = m_labelSize.x;
EditorGUI.BeginChangeCheck();
GUI.SetNextControlName( "port" + m_nodeId.ToString() + m_portId.ToString() );
m_name = GUI.TextField( textPos, m_name, style );
if( EditorGUI.EndChangeCheck() )
{
m_dirtyLabelSize = true;
changeFlag = true;
}
if( Event.current.isKey && ( Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter ) )
{
m_editingName = false;
GUIUtility.keyboardControl = 0;
}
}
else
{
GUI.Label( textPos, m_name, style );
}
//GUI.Label( textPos, string.Empty );
return changeFlag;
}
public void ResetEditing()
{
m_editingName = false;
}
public virtual void ForceClearConnection() { }
public bool IsConnected
{
get { return ( m_externalReferences.Count > 0 && !m_locked ); }
}
public List<WireReference> ExternalReferences
{
get { return m_externalReferences; }
}
public int ConnectionCount
{
get { return m_externalReferences.Count; }
}
public Rect Position
{
get { return m_position; }
set { m_position = value; }
}
public Rect LabelPosition
{
get { return m_labelPosition; }
set { m_labelPosition = value; }
}
public int PortId
{
get { return m_portId; }
set { m_portId = value; }
}
public int OrderId
{
get { return m_orderId; }
set { m_orderId = value; }
}
public int NodeId
{
get { return m_nodeId; }
set { m_nodeId = value; }
}
public virtual WirePortDataType DataType
{
get { return m_dataType; }
set { m_dataType = value; }
}
public bool Visible
{
get { return m_visible; }
set
{
m_visible = value;
if( !m_visible && IsConnected )
{
ForceClearConnection();
}
}
}
public bool Locked
{
get { return m_locked; }
set
{
//if ( m_locked && IsConnected )
//{
// ForceClearConnection();
//}
m_locked = value;
}
}
public virtual string Name
{
get { return m_name; }
set { m_name = value; m_dirtyLabelSize = true; }
}
public bool DirtyLabelSize
{
get { return m_dirtyLabelSize; }
set { m_dirtyLabelSize = value; }
}
public bool HasCustomColor
{
get { return m_hasCustomColor; }
}
public Color CustomColor
{
get { return m_customColor; }
set
{
m_hasCustomColor = true;
m_customColor = value;
}
}
public Rect ActivePortArea
{
get { return m_activePortArea; }
set { m_activePortArea = value; }
}
public Vector2 LabelSize
{
get { return m_labelSize; }
set { m_labelSize = value; }
}
public Vector2 UnscaledLabelSize
{
get { return m_unscaledLabelSize; }
set { m_unscaledLabelSize = value; }
}
public bool IsEditable
{
get { return m_isEditable; }
set { m_isEditable = value; }
}
public bool Available { get { return m_visible && !m_locked; } }
public override string ToString()
{
string dump = "";
dump += "Order: " + m_orderId + "\n";
dump += "Name: " + m_name + "\n";
dump += " Type: " + m_dataType;
dump += " NodeId : " + m_nodeId;
dump += " PortId : " + m_portId;
dump += "\nConnections:\n";
foreach( WireReference wirePort in m_externalReferences )
{
dump += wirePort + "\n";
}
return dump;
}
public bool RepeatButtonState
{
get { return m_repeatButtonState; }
set { m_repeatButtonState = value; }
}
public bool IsDummy { get { return m_isDummy; } }
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Wires/WirePort.cs/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/Editor/Wires/WirePort.cs",
"repo_id": "jynew",
"token_count": 5260
} | 849 |
Shader "Hidden/ClampOpNode"
{
Properties
{
_A ("_Value", 2D) = "white" {}
_B ("_Min", 2D) = "white" {}
_C ("_Max", 2D) = "white" {}
}
SubShader
{
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
sampler2D _A;
sampler2D _B;
sampler2D _C;
float4 frag(v2f_img i) : SV_Target
{
float4 value = tex2D( _A, i.uv );
float4 min = tex2D( _B, i.uv );
float4 max = tex2D( _C, i.uv );
return clamp(value, min, max);
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_ClampOpNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_ClampOpNode.shader",
"repo_id": "jynew",
"token_count": 286
} | 850 |
Shader "Hidden/CrossProductOpNode"
{
Properties
{
_A ("_Lhs", 2D) = "white" {}
_B ("_Rhs", 2D) = "white" {}
}
SubShader
{
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
sampler2D _A;
sampler2D _B;
float4 frag(v2f_img i) : SV_Target
{
float4 a = tex2D( _A, i.uv );
float4 b = tex2D( _B, i.uv );
return float4(cross(a.rgb, b.rgb),0);
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_CrossProductOpNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_CrossProductOpNode.shader",
"repo_id": "jynew",
"token_count": 249
} | 851 |
Shader "Hidden/FractNode"
{
Properties
{
_A ("_A", 2D) = "white" {}
}
SubShader
{
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
sampler2D _A;
float4 frag(v2f_img i) : SV_Target
{
return frac(tex2D( _A, i.uv ));
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_FractNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_FractNode.shader",
"repo_id": "jynew",
"token_count": 175
} | 852 |
Shader "Hidden/HSVToRGBNode"
{
Properties
{
_A ( "_Hue", 2D ) = "white" {}
_B ( "_Saturation", 2D ) = "white" {}
_C ( "_Value", 2D ) = "white" {}
}
SubShader
{
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
uniform sampler2D _A;
uniform sampler2D _B;
uniform sampler2D _C;
float4 frag ( v2f_img i ) : SV_Target
{
float h = tex2D ( _A, i.uv ).r;
float s = tex2D ( _B, i.uv ).r;
float v = tex2D ( _C, i.uv ).r;
float4 K = float4( 1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0 );
float3 p = abs ( frac ( (h).xxx + K.xyz ) * 6.0 - K.www );
float3 hsvToRgb = v * lerp ( K.xxx, clamp ( p - K.xxx, 0.0, 1.0 ), (s).xxx );
return float4( GammaToLinearSpace(hsvToRgb), 1 );
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_HSVToRGBNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_HSVToRGBNode.shader",
"repo_id": "jynew",
"token_count": 423
} | 853 |
Shader "Hidden/LightAttenuation"
{
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#include "UnityCG.cginc"
#include "Lighting.cginc"
float4 _EditorWorldLightPos;
float4 frag(v2f_img i) : SV_Target
{
float2 xy = 2 * i.uv - 1;
float z = -sqrt(1-saturate(dot(xy,xy)));
float3 worldNormal = normalize(float3(xy, z));
float3 lightDir = normalize( _EditorWorldLightPos.xyz );
return saturate(dot(worldNormal ,lightDir) * 10 + 0.1);
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_LightAttenuation.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_LightAttenuation.shader",
"repo_id": "jynew",
"token_count": 253
} | 854 |
Shader "Hidden/NoiseGeneratorNode"
{
Properties
{
_A ("_RGB", 2D) = "white" {}
}
SubShader
{
Pass //Simplex2D
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
sampler2D _A;
float3 mod2D289 ( float3 x ) { return x - floor ( x * ( 1.0 / 289.0 ) ) * 289.0; }
float2 mod2D289 ( float2 x ) { return x - floor ( x * ( 1.0 / 289.0 ) ) * 289.0; }
float3 permute ( float3 x ) { return mod2D289 ( ( ( x * 34.0 ) + 1.0 ) * x ); }
float snoise ( float2 v )
{
const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
float2 i = floor ( v + dot ( v, C.yy ) );
float2 x0 = v - i + dot ( i, C.xx );
float2 i1;
i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
float4 x12 = x0.xyxy + C.xxzz;
x12.xy -= i1;
i = mod2D289 ( i );
float3 p = permute ( permute ( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
float3 m = max ( 0.5 - float3( dot ( x0, x0 ), dot ( x12.xy, x12.xy ), dot ( x12.zw, x12.zw ) ), 0.0 );
m = m * m;
m = m * m;
float3 x = 2.0 * frac ( p * C.www ) - 1.0;
float3 h = abs ( x ) - 0.5;
float3 ox = floor ( x + 0.5 );
float3 a0 = x - ox;
m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
float3 g;
g.x = a0.x * x0.x + h.x * x0.y;
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
return 130.0 * dot ( m, g );
}
float4 frag(v2f_img i) : SV_Target
{
float2 size = tex2D( _A, i.uv ).rg;
float noiseVal = snoise ( size );
return float4( noiseVal.xxx, 1);
}
ENDCG
}
Pass //Simplex3D
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
sampler2D _A;
float3 mod3D289 ( float3 x ) { return x - floor ( x / 289.0 ) * 289.0; }
float4 mod3D289 ( float4 x ) { return x - floor ( x / 289.0 ) * 289.0; }
float4 permute ( float4 x ) { return mod3D289 ( ( x * 34.0 + 1.0 ) * x ); }
float4 taylorInvSqrt ( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }
float snoise ( float3 v )
{
const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );
float3 i = floor ( v + dot ( v, C.yyy ) );
float3 x0 = v - i + dot ( i, C.xxx );
float3 g = step ( x0.yzx, x0.xyz );
float3 l = 1.0 - g;
float3 i1 = min ( g.xyz, l.zxy );
float3 i2 = max ( g.xyz, l.zxy );
float3 x1 = x0 - i1 + C.xxx;
float3 x2 = x0 - i2 + C.yyy;
float3 x3 = x0 - 0.5;
i = mod3D289 ( i );
float4 p = permute ( permute ( permute ( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );
float4 j = p - 49.0 * floor ( p / 49.0 ); // mod(p,7*7)
float4 x_ = floor ( j / 7.0 );
float4 y_ = floor ( j - 7.0 * x_ ); // mod(j,N)
float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;
float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;
float4 h = 1.0 - abs ( x ) - abs ( y );
float4 b0 = float4( x.xy, y.xy );
float4 b1 = float4( x.zw, y.zw );
float4 s0 = floor ( b0 ) * 2.0 + 1.0;
float4 s1 = floor ( b1 ) * 2.0 + 1.0;
float4 sh = -step ( h, 0.0 );
float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
float4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
float3 g0 = float3( a0.xy, h.x );
float3 g1 = float3( a0.zw, h.y );
float3 g2 = float3( a1.xy, h.z );
float3 g3 = float3( a1.zw, h.w );
float4 norm = taylorInvSqrt ( float4( dot ( g0, g0 ), dot ( g1, g1 ), dot ( g2, g2 ), dot ( g3, g3 ) ) );
g0 *= norm.x;
g1 *= norm.y;
g2 *= norm.z;
g3 *= norm.w;
float4 m = max ( 0.6 - float4( dot ( x0, x0 ), dot ( x1, x1 ), dot ( x2, x2 ), dot ( x3, x3 ) ), 0.0 );
m = m* m;
m = m* m;
float4 px = float4( dot ( x0, g0 ), dot ( x1, g1 ), dot ( x2, g2 ), dot ( x3, g3 ) );
return 42.0 * dot ( m, px );
}
float4 frag ( v2f_img i ) : SV_Target
{
float3 size = tex2D ( _A, i.uv ).rgb;
float noiseVal = snoise ( size );
return float4( noiseVal.xxx, 1 );
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_NoiseGeneratorNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_NoiseGeneratorNode.shader",
"repo_id": "jynew",
"token_count": 2196
} | 855 |
Shader "Hidden/PannerNode"
{
Properties
{
_A ("_UVs", 2D) = "white" {}
_B ("_PanTime", 2D) = "white" {}
_C ("_PanSpeed", 2D ) = "white" {}
}
SubShader
{
Pass
{
Name "Panner" // 14 - UV panner node
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D _A;
sampler2D _B;
sampler2D _C;
float _UsingEditor;
float _EditorTime;
float4 frag(v2f_img i) : SV_Target
{
float multiplier = tex2D ( _B, i.uv ).r;
float time = _EditorTime*multiplier;
if ( _UsingEditor == 0 )
{
time = multiplier;
}
float2 speed = tex2D ( _C, i.uv ).rg;
return tex2D( _A, i.uv) + time * float4( speed, 0, 0 );
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_PannerNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_PannerNode.shader",
"repo_id": "jynew",
"token_count": 371
} | 856 |
Shader "Hidden/RSqrtOpNode"
{
Properties
{
_A ("_A", 2D) = "white" {}
}
SubShader
{
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
sampler2D _A;
float4 frag(v2f_img i) : SV_Target
{
return rsqrt(tex2D( _A, i.uv ));
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_RsqrtOpNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_RsqrtOpNode.shader",
"repo_id": "jynew",
"token_count": 178
} | 857 |
Shader "Hidden/SimpleContrastNode"
{
Properties
{
_A ( "_RBG", 2D ) = "white" {}
_B ( "_Fraction", 2D ) = "white" {}
}
SubShader
{
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
uniform sampler2D _A;
uniform sampler2D _B;
float4 CalculateContrast ( float contrastValue, float4 colorTarget )
{
float t = 0.5 * ( 1.0 - contrastValue );
return mul ( float4x4( contrastValue, 0, 0, t, 0, contrastValue, 0, t, 0, 0, contrastValue, t, 0, 0, 0, 1 ), colorTarget );
}
float4 frag ( v2f_img i ) : SV_Target
{
float4 rgba = tex2D ( _B, i.uv );
float value = tex2D ( _A, i.uv ).r;
float4 finalColor = CalculateContrast( value , rgba );
return finalColor;
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_SimpleContrastNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_SimpleContrastNode.shader",
"repo_id": "jynew",
"token_count": 373
} | 858 |
Shader "Hidden/SubstanceSamplerNode"
{
Properties
{
_A ("_UV", 2D) = "white" {}
}
SubShader
{
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
sampler2D _A;
sampler2D _GenTex;
int _CustomUVs;
float4 frag( v2f_img i ) : SV_Target
{
float2 uvs = i.uv;
if( _CustomUVs == 1 )
uvs = tex2D( _A, i.uv ).xy;
float4 genTex = tex2D( _GenTex, uvs);
return genTex;
}
ENDCG
}
Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
sampler2D _A;
sampler2D _GenTex;
int _CustomUVs;
float4 frag( v2f_img i ) : SV_Target
{
float2 uvs = i.uv;
if( _CustomUVs == 1 )
uvs = tex2D( _A, i.uv ).xy;
float3 genTex = UnpackNormal( tex2D( _GenTex, uvs ) );
return float4( genTex, 0 );
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_SubstanceSamplerNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_SubstanceSamplerNode.shader",
"repo_id": "jynew",
"token_count": 475
} | 859 |
Shader "Hidden/TextureArrayNode"
{
Properties
{
_A ("_UVs", 2D) = "white" {}
_B ("_Index", 2D) = "white" {}
_C ("_Lod", 2D) = "white" {}
_D ("_NormalScale", 2D) = "white" {}
_G ("_Tex", 2D) = "white" {}
_TexConnected ("_TexConnected", Int) = 0
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#pragma target 3.5
#include "UnityCG.cginc"
#include "UnityStandardUtils.cginc"
uniform UNITY_DECLARE_TEX2DARRAY( _Sampler );
sampler2D _A;
sampler2D _B;
sampler2D _C;
sampler2D _D;
sampler2D _G;
float _CustomUVs;
float _LodType;
float _Unpack;
int _TexConnected;
float4 frag( v2f_img i ) : SV_Target
{
float2 uvs = i.uv;
if ( _CustomUVs == 1 )
uvs = tex2D( _A, i.uv ).xy;
float n = tex2D( _D, i.uv ).r;
float4 c = 0;
if ( _LodType == 1 ) {
float lod = tex2D( _C, i.uv ).r;
c = UNITY_SAMPLE_TEX2DARRAY_LOD( _Sampler, float3( uvs, tex2D( _B, i.uv ).r ), lod );
}
else if( _TexConnected == 0) {
c = UNITY_SAMPLE_TEX2DARRAY( _Sampler, float3( uvs, tex2D( _B, i.uv ).r ) );
}
else {
c = tex2D( _G, uvs );
}
if ( _Unpack == 1 )
{
c.rgb = UnpackScaleNormal(c, n);
}
return c;
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_TextureArrayNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_TextureArrayNode.shader",
"repo_id": "jynew",
"token_count": 705
} | 860 |
Shader "Hidden/WeightedBlendNode"
{
Properties
{
_A ( "_Weights", 2D) = "white" {}
_B ( "_Layer1", 2D) = "white" {}
_C ( "_Layer2", 2D ) = "white" {}
_D ( "_Layer3", 2D ) = "white" {}
_E ( "_Layer4", 2D ) = "white" {}
}
SubShader
{
CGINCLUDE
#include "UnityCG.cginc"
#pragma vertex vert_img
#pragma fragment frag
sampler2D _A;
sampler2D _B;
ENDCG
Pass
{
CGPROGRAM
float4 frag(v2f_img i) : SV_Target
{
float4 Layer1 = tex2D( _B, i.uv );
return Layer1;
}
ENDCG
}
Pass
{
CGPROGRAM
sampler2D _C;
float4 frag ( v2f_img i ) : SV_Target
{
float4 Weights = tex2D ( _A, i.uv );
float4 Layer1 = tex2D ( _B, i.uv );
float4 Layer2 = tex2D ( _C, i.uv );
return ( Weights.x*Layer1 + Weights.y*Layer2 ) / ( Weights.x + Weights.y );
}
ENDCG
}
Pass
{
CGPROGRAM
sampler2D _C;
sampler2D _D;
float4 frag ( v2f_img i ) : SV_Target
{
float4 Weights = tex2D( _A, i.uv );
float4 Layer1 = tex2D( _B, i.uv );
float4 Layer2 = tex2D( _C, i.uv );
float4 Layer3 = tex2D( _D, i.uv );
return ( Weights.x*Layer1 + Weights.y*Layer2 + Weights.z*Layer3 ) / ( Weights.x + Weights.y + Weights.z );
}
ENDCG
}
Pass
{
CGPROGRAM
sampler2D _C;
sampler2D _D;
sampler2D _E;
float4 frag ( v2f_img i ) : SV_Target
{
float4 Weights = tex2D ( _A, i.uv );
float4 Layer1 = tex2D ( _B, i.uv );
float4 Layer2 = tex2D ( _C, i.uv );
float4 Layer3 = tex2D ( _D, i.uv );
float4 Layer4 = tex2D ( _E, i.uv );
return ( Weights.x*Layer1 + Weights.y*Layer2 + Weights.z*Layer3 + Weights.w*Layer4 ) / ( Weights.x + Weights.y + Weights.z + Weights.w );
}
ENDCG
}
}
}
| jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_WeightedBlendNode.shader/0 | {
"file_path": "jynew/jyx2/Assets/3rd/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_WeightedBlendNode.shader",
"repo_id": "jynew",
"token_count": 922
} | 861 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.