c# - HoloLens: Using Unlit / VertexLit Shaders with Particle System -
context: drawing graphs on hololens via unity particle system.
for drawing complex graphs on microsoft hololens (see answer https://stackoverflow.com/a/46073583/5707551) want use vertexlit/unlit shaders increase frame rate
but if try access color via
void update() { //... (int = 0; < points.length; i++) { color c = points[i].getcurrentcolor(getcomponent<particlesystem>()); points[i].startcolor = c; } //... getcomponent<particlesystem>().setparticles(points, points.length); }
with shaders color of particles not change.
it worked fine default or fastconfigurable shader.
does know 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 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 // target hololens (and unity editor), 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 } } }
Comments
Post a Comment