Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Help ~,custom particle system move vertex position is very slow FPS....

Discussion in 'Shaders' started by dreamerflyer, Jul 9, 2015.

  1. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    Hi all, any method about optimized the move vertex position ?I test the FPS with 10,000 vertexes in particle system,unity 's particle system is more higher than my.how control the move vertex in unity 's particle system?Maybe run in C++?Or run in shader ?
     

    Attached Files:

    • p1.jpg
      p1.jpg
      File size:
      99.8 KB
      Views:
      824
    • p2.jpg
      p2.jpg
      File size:
      112.5 KB
      Views:
      715
    • p3.jpg
      p3.jpg
      File size:
      25.2 KB
      Views:
      813
  2. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    any help?
     
  3. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    Have some methed can add property in vertex buffer? Maybe can add a vetor3[] movingdir for move vertex,but i found nothing about vertex buffer in unity. I want run on mobile device
     
  4. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    I decise to move vertex in shader,How can i add more vector3d propertys in vertex buffer ,need help!
     
  5. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    some one?
     
  6. Dolkar

    Dolkar

    Joined:
    Jun 8, 2013
    Posts:
    576
    you can't.. Use existing channels like colors, normals, uvs.. whatever you aren't using.
     
  7. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    why can not? colors ,normals ect ....this channels is for other use,not enough !
     
  8. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    now i can moving and and chang start size,No idea about rotate for single quad,any help?
     

    Attached Files:

    • mp.png
      File size:
      1.5 MB
      Views:
      779
    Last edited: Jul 12, 2015
  9. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    Code (CSharp):
    1.   half3x3 roMatrixZ={
    2.                       half3(cos(dxTime),-sin(dxTime),0),
    3.                       half3(sin(dxTime),cos(dxTime),0),
    4.                       half3(0.0,0.0,1.0)
    5.                   };
    6.               half3 p=pos.xyz;
    7.          pos.xyz=mul(p,roMatrixZ);
    8.          o.pos = mul(UNITY_MATRIX_MVP,pos);
    can not rotate around quad center, need help!
     

    Attached Files:

    • ro.png
      File size:
      357.8 KB
      Views:
      824
  10. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    when use roMatrixZ to rotate ,when batching two particle systems all visible in camera,rotate wrong,why so strange...
     

    Attached Files:

    • p1.jpg
      p1.jpg
      File size:
      36.2 KB
      Views:
      1,456
    • p2.jpg
      p2.jpg
      File size:
      34.7 KB
      Views:
      1,453
  11. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    AND I want use mesh.uv2 for change lifetime and rollspeed,but in shader can not
    work by v.texcoord2,and TANSFORM_UV(2) not work too.ANY HELP?
     
  12. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
  13. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    How can i use boneweight in shader?