I can only imagine one situation where a more than two triangle plane is needed, which is using it as a mesh collider (as you can get more precise movements using lots of smaller triangles rather than just two (I am imagining a case where the plane would be used to model parts of a character,or something, not as a floor or wall, as, in these cases, a two triangle plane would be just as enough as a plane with hundreds of triangles. (Please, correct if I am wrong on this!)
Also, I believe (by my tests so far) that a two triangle plane does not lose any render quality comparing to a multiple triangle plane. Again, correct if I am wrong on this!
With that in mind, my question is: When would you ever use a plane with more than 2 triangles expect for the case above (using it in a mesh collider)?
The number of triangles in a plane shouldn’t make any difference as far as a mesh collider goes. You might use lots of triangles in a plane if you’re using vertex lighting with spotlights/point lights, since you can at least get a rough approximation of correct lighting in that case, whereas you can’t with just two.
But couldn’t you do this with fragment shader? I understand that vertex shader would be limited by the number of triangles, but I would guess you could have that light processing done in the fragment shader and, therefore, two triangles would be just as enough as multiple ones. What am I missing Eric?
Vertex lights operate on vertices only. If you’re using pixel lights, then naturally 2 triangles is as good as 200. Not all hardware can use pixel shaders, or at least that was true then the Unity plane primitive was created.
This might be the real reason it was implemented like this, but I don’t know for sure. Along with an assumption that primitives are used only as place holders until the real 3D model arrives. Yet if what you really want is a quad then you’ll feel pretty stupid as you fire up the full 3D max suite to model 2 triangles.
Thanks Eric and UnLogick. Now it makes more sense.
Once Eric said there is no difference between a mesh collider modeled with a 2 triangle plane and one with hundreds of triangles, then I guess the main (and maybe only?) reason on why there are plenty of triangles on Unity’s plane primitive is because of the lack of support of pixel shaders for old GPUs as you guys pointed out.
Thanks everybody!
PS: If anybody has another guess, please, feel free to reply to this thread.
Even with more modern GPUs you still might run out of pixel lights, depending on how many you set up in the quality settings, so it’s possible you’d fall back to vertex lights. That’s kind of an edge case though; I think in most cases 2 triangles would be fine, which is probably why they’re apparently adding a 2-triangle plane primitive.
but not a triangle! outrageous! other engines have MakeTriangle() ! must I seriously code a triangle! there should be a button for eveything, including make game