Context: Drawing Graphs on HoloLens via Unity Particle System.
For drawing complex Graphs on Microsoft HoloLens (see my Answer https://stackoverflow.com/a/46073583/5707551) i want to use the VertexLit/Unlit Shaders to increase the frame rate
But if i try to access the color via
void Update()
{
//...
for (int i = 0; i < points.Length; i++)
{
Color c = points[i].GetCurrentColor(GetComponent<ParticleSystem>());
points[i].startColor = c;
}
//...
GetComponent<ParticleSystem>().SetParticles(points, points.Length);
}
with this Shaders the color of the particles does not change.
It worked fine with the default or the FastConfigurable Shader.
Does anyone know what I must consider when using these shaders?
Edit - Shader Properties:
Shader "HoloToolkit/Vertex Lit Configurable"
{
Properties
{
[Header(Main Color)]
[Toggle] _UseColor("Enabled?", Float) = 0
_Color("Main Color", Color) = (1,1,1,1)
[Space(20)]
[Header(Base(RGB))]
[Toggle] _UseMainTex("Enabled?", Float) = 1
_MainTex("Base (RGB)", 2D) = "white" {}
[Space(20)]
// Uses UV scale, etc from main texture
[Header(Emission(RGB))]
[Toggle] _UseEmissionTex("Enabled?", Float) = 0
[NoScaleOffset] _EmissionTex("Emission (RGB)", 2D) = "white" {}
[Space(20)]
[Header(Blend State)]
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One"
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero"
[Space(20)]
[Header(Other)]
[Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back"
[Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual"
[Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On"
[Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All"
}
SubShader
{
Tags { "RenderType" = "Opaque" "PerformanceChecks" = "False" }
LOD 100
Blend[_SrcBlend][_DstBlend]
ZTest[_ZTest]
ZWrite[_ZWrite]
Cull[_Cull]
ColorMask[_ColorWriteMask]
Pass
{
Name "FORWARD"
Tags { "LightMode" = "ForwardBase" }
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fwdbase
#pragma multi_compile_fog
// We only target the HoloLens (and the Unity editor), so take advantage of shader model 5.
#pragma target 5.0
#pragma only_renderers d3d11
#pragma shader_feature _USECOLOR_ON
#pragma shader_feature _USEMAINTEX_ON
#pragma shader_feature _USEEMISSIONTEX_ON
#pragma multi_compile __ _NEAR_PLANE_FADE_ON
#include "HoloToolkitCommon.cginc"
#include "VertexLitConfigurable.cginc"
ENDCG
}
}
}