Search Unity

Rendering a colored point cloud for android devices, problem with RGB colors [RESOLVED]

Discussion in 'Shaders' started by Guillaumzed, Oct 18, 2016.

  1. Guillaumzed

    Guillaumzed

    Joined:
    Mar 29, 2015
    Posts:
    71
    Hello everyone,

    I was trying out that script+shader to make a point cloud :
    http://www.kamend.com/2014/05/rendering-a-point-cloud-inside-unity/

    And I've found out something odd with the points colors that, sometimes, won't display on my android devices : It's like if the R of the RGB channel was somekind of second Alpha channel.

    Meaning that if R=0, your colors won't show up at all and like they are small, pixel points, starting from underneath 0.75 on the R channel and you can't see a thing.

    And therefore, it's impossible to display a plain Color.green or Color.blue : they won't appear at all !

    I guess it has something to do with the shader rendering of the mesh's points, but I don't know what ...

    I can see this problem on my old Asus Transform and the latest samsung Galaxy.
    But it's displaying without the problem on my 2 years old motorola 4G and on desktop.

    Can you help me with that ?
     
  2. Guillaumzed

    Guillaumzed

    Joined:
    Mar 29, 2015
    Posts:
    71
    This is crazy : if I do Quads or Triangles instead of Points, the shape appear in green or blue !

    So it's really a problem with Points who doesn't show up on my android devices' screens when there's no red inside...
     
  3. Guillaumzed

    Guillaumzed

    Joined:
    Mar 29, 2015
    Posts:
    71
    I tried with the built in Unlit-Color shader instead of the shader from Kamend and I see the same problem : when a plain green or a plain blue is applied to the material, the points cloud do not show. (but the quads cloud or triangles cloud , yes)

    So, well, i'm lost. Don't know where to look for a solution.
     
  4. tsangwailam

    tsangwailam

    Joined:
    Jul 30, 2013
    Posts:
    280
    Which device are you testing? model no.?
     
  5. Guillaumzed

    Guillaumzed

    Joined:
    Mar 29, 2015
    Posts:
    71
    My mistake : actually it worked on both devices but you could'nt actually see the green dots because the pixel size was stucked to 1 and the white dots are bright though the green ones almost invisible... Sorry for this thread.

    Also, about that PSIZE problem on OPENGL ES if I use the same Shader than Lann here :
    http://answers.unity3d.com/questions/807548/how-do-i-use-psize-in-a-unity-454-shader.html
    (which is different than the Kamend's one because it has the PSIZE information in it.)
    And Without using the EnablePointSize class from Kamend, here is my find :
    I can actually see the PSIZE working on my ASUS Transformer TF300T which is an android tablet on OPENGL ES 2.0. (So the pixels are at the size defined in the shader.)

    It's kind of a scoop because it looks like no one has reported being able to make it works with Unity for android.
    But I haven't got the time to search more about that subject for now.