Jump to content

SurfaceTransparentCompare using bounding box


photo

Recommended Posts

Problem

In our scenes, we use many objects with transparent textures. The problem is Unigine uses the bounding sphere for depth sorting, and when some planes, with different sizes, are placed very close each other (in a symbol composition this is a very common situation) it produces visual artifacts. We tried to avoid this conflict making planes of the same size, but in some cases this doesn't solve the problem and, in some symbol compositions, it's very difficult to put it in practice.

post-59-002530100 1284621668_thumb.jpg

 

Suggestion

In other engines this problem does not exist because they uses the boundingbox for transparent object sorting. I think Unigine can support this functionality easily just modifying the SurfaceTransparentCompare class adding an extra parameter in constructor and implementing functionality (of course :) ):

 

enum { USE_BOUNDSPHERE_MODE, USE_BOUNDBOX_MODE };
SurfaceTransparentCompare(Vector<ObjectSurface*> &surfaces,const vec3 &camera,SortingMode mode=USE_BOUNDSPHERE_MODE)

 

Thanks,

Iván.

Link to comment
×
×
  • Create New...