Shader "UltraCombos/ParticleWorks/ParticleViewer/Mesh" { Properties { _Color("Color", Color) = (1,1,1,1) _MainTex("Albedo (RGB)", 2D) = "white" {} _Metallic("Metallic", Range(0, 1)) = 0.0 _Smoothness("Smoothness", Range(0, 1)) = 0.5 _Emission("Emission", Range(0, 5)) = 0.0 } SubShader { Tags{ "RenderType" = "Opaque" } LOD 200 Cull Off CGPROGRAM #pragma surface surf Standard fullforwardshadows vertex:vert addshadow #pragma target 4.5 sampler2D _MainTex; fixed4 _Color; half _Smoothness; half _Metallic; half _Emission; #ifdef SHADER_API_D3D11 #include "Inc/Defines.cginc" StructuredBuffer ssbo; #endif struct Input { float3 color; float2 texcoord; }; void vert(inout appdata_full v, out Input o) { UNITY_INITIALIZE_OUTPUT(Input, o); #ifdef SHADER_API_D3D11 int id = v.texcoord.z; //int index = v.texcoord.w; Particle p = ssbo[id]; v.vertex = mul(p.model_matrix, v.vertex); v.normal = mul((float3x3)p.model_matrix, v.normal); o.color = p.color; o.texcoord = v.texcoord.xy; #endif } void surf(Input IN, inout SurfaceOutputStandard o) { //float cc = length(IN.texcoord - float2(0.5f, 0.5f)); //clip(0.5f / sqrt(2.0f) - cc); fixed4 c = tex2D(_MainTex, IN.texcoord) * _Color * float4(IN.color, 1); o.Albedo = c.rgb; o.Metallic = _Metallic; o.Smoothness = _Smoothness; o.Alpha = c.a; //float lumin = pow(Luminance(IN.color), 2.2f); o.Emission = c.rgb * _Emission;// *lumin; } ENDCG } FallBack "Diffuse" }