Author Topic: Some question about the order of drawing.  (Read 2127 times)

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Some question about the order of drawing.
« on: September 10, 2013, 09:43:12 am »
How does jPCT-AE implement the order of drawing(rendering)?   

Dose jPCT-AE use any Occlusion culling?

I need these info to help my  art  partner to design the game scene. For example, one-large-combined-mesh VS small meshes, small textures VS one-large-texture, and so on.

by depth (necessity for accurate draw order / painter's algorithm)
-by program (context changes may be costly!)
--by texture in program (that texture context changes may be costly...)
---by mesh that uses that texture
----by discrete entity transform (every entity using this mesh)


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Some question about the order of drawing.
« Reply #1 on: September 10, 2013, 09:59:08 am »
Transparent objects will be sorted by depth, no matter what. They have to to ensure correct rendering order. Opaque objects are sorted to minimize state changes. This means basically:

  • base texture
  • additional texture layers
  • shaders (if OpenGL 2.0 is being used)


In addition, the engine detects if the mesh being rendered is the same one as it was in the previous render call and skips state changes that aren't needed in this case. The same applies to light sources and some matrices.
The engine doesn't do any occlusion culling. Mobile GPUs (except for Tegra) do this anyway.

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Re: Some question about the order of drawing.
« Reply #2 on: September 10, 2013, 11:04:08 am »
Thanks!

So, for opaque objects, the engine doesn't do any rough depth-sorting(front-to-back or back-to-front, like sorting by the distance between obj and camera), right?

And where do you get the information of Mobile GPU?  Do you have personal blog? Please recommend some books\forum\blog\wiki\... to study Graphic\Game technology.



Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Some question about the order of drawing.
« Reply #3 on: September 10, 2013, 12:11:36 pm »
No, it doesn't. It could only be applied to objects that share the same textures/shaders/lights... anyway and even then, it only makes sense if these objects have at least some additional overdraw. To "optimize" for this almost non-existant case makes no sense and i'm pretty sure that it won't help anyway. Tegra is the only immediate mode renderer on a mobile device. All others do defered/tile based rendering, which means that they do the sorting internally and much better than an engine could do it.

About the gpu information: Detailed information about mobile gpus is sparse. I'm a hardware freak since ever and so i "just know" a lot about how things work. I can't suggest any specific source of information.