public virtual UInt64 getSortId(RenderInfo info) { UInt64 sortId = 0; if (info.pipeline.blending.enabled == true) //this is a transparent object { //sort these back to front so transparent objects draw properly //regardless of material or object type sortId |= (UInt64)((1.0f / info.distToCamera) * UInt64.MaxValue); } else { //sort these front to back to reduce overdraw, but also in groups of similar //objects so we reduce state switches. Put renderables in depth buckets // which then get sorted by the texture or vbo id (depending on which is available) float maxDistance = 2000.0f; Byte distBucket = (Byte)((info.distToCamera / maxDistance) * 255); //number of distance buckets sortId = 0; sortId |= (UInt64)info.renderState.myVertexBuffers[0].id << 32; sortId |= (UInt64)distBucket; } return(sortId); }
public virtual void generateRenderCommand(RenderInfo r, BaseRenderQueue q) { }