   }//end if(relevantSize>0)
   
   // D E P T H   A S S E M B L Y
-  for(int i=0; i<relevantSize; i++){
-   vec4 dqColor	= intrinsicCodeTexel(0,floatBitsToUint(depthQueue[ordering[i]][2u]),vec3(0,0,0),depthQueue[ordering[i]].rg,illuminatedFog);
+  for(uint i=0u; i<relevantSize; i++){
+   vec4 dqColor = primitiveLayer(pQuads[ordering[i]],0,illuminatedFog,vUVZI[ordering[i]]);
    color 		= mix(color.rgb,dqColor.rgb,dqColor.a);
   }//end for(relevantSize)
-  
+
 fragColor.rgb		 	= color;
 }//end main()
 vec4 intrinsicCodeTexel(float warpedFog,uint textureID,vec3 norm,vec2 uv, vec3 illuminatedFog){
 // TOC
 if(textureID==0u)return vec4(0,1,0,1);//Green means textureID=zero
 if(textureID==100024u)return vec4(1,1,0,1);//Yellow means 0xDEADBEEF (unwritten) reverse[4022250974][3735928559u]
 uvec4 	tocHeader 	= texelFetch(rootBuffer,int(textureID+TOC_OFFSET_VEC4_HEADER));
 if(tocHeader[TOC_HEADER_OFFSET_QUADS_MAGIC]!=1337u)return vec4(1,0,1,1);//Magenta means invalid texture.
 vec2	tDims		= vec2(float(tocHeader[TOC_HEADER_OFFSET_QUADS_WIDTH]),float(tocHeader[TOC_HEADER_OFFSET_QUADS_HEIGHT]));


const vec3 sunColor 					= vec3(1.4,1.4,1.2);

const int DEPTH_QUEUE_SIZE				= 5;
const float DEAD_BEEF					= 100024;
const uint PAGE_SIZE_VEC4				= 96u;

const uint VTX_TEXTURE_WIDTH			= 1024u;
const uint VTX_TEXTURE_USABLE_WIDTH = (VTX_TEXTURE_WIDTH/3u)*3u;

const uint PQUAD_SIDE_WIDTH			= 2u;
const uint PRIM_TEXTURE_WIDTH		= 512u;
const uint PRIM_TEXTURE_HEIGHT		= 512u;
const float PRIM_TEX_HEIGHT_SCALAR	= 1/float(PRIM_TEXTURE_HEIGHT);
const float PRIM_TEX_WIDTH_SCALAR	= 1/float(PRIM_TEXTURE_WIDTH);
const uint PRIMS_PER_ROW			= PRIM_TEXTURE_WIDTH/PQUAD_SIDE_WIDTH;
const uint OVERSAMPLING				= 4u;

const  vec2 PRIM_QUAD_BL 			= vec2(PRIM_TEX_WIDTH_SCALAR,PRIM_TEX_HEIGHT_SCALAR)/(2*float(OVERSAMPLING));

float warpFog(float z){
return clamp(pow(z,80)*1.2,0,1);
}
