 **/
 
 void main(){
-uint	primitiveID = uint(texture(primitiveIDTexture,screenLoc)[0u]*65536);
+uint	primitiveID = uint(texelFetch(primitiveIDTexture,ivec2(gl_FragCoord),0)[0u]*65536);
 vec4	color;
 /*vec3	illuminatedFog
 					= fogColor*sunColor;*/

 uint	codeBkPgNum	= codeIdx / CODES_PER_CODE_PAGE;
 vec2	subTexUVsub	= codeXY*CODE_PAGE_TEXEL_SIZE_UV;
 vec2	codePgUV	= (vec2(float(codeIdx % CODE_PAGE_SIDE_WIDTH_CODES),float((codeIdx / CODE_PAGE_SIDE_WIDTH_CODES)%CODE_PAGE_SIDE_WIDTH_CODES))/float(CODE_PAGE_SIDE_WIDTH_CODES))+subTexUVsub;
 return				  texture(rgbaTiles,vec3(codePgUV,codeBkPgNum));
 }
 
 vec4 intrinsicCodeTexel(uint textureID,vec3 norm,vec2 uv){

 vec2	pQuadBL		= PRIM_QUAD_BL;
 pQuadBL.x			+=float(col*2u)*PRIM_TEX_WIDTH_SCALAR;// x2 because each quad is 2 texels wide.
 pQuadBL.y			+=float(row*2u)*PRIM_TEX_HEIGHT_SCALAR;
 return				pQuadBL+vec2(PRIM_TEX_WIDTH_SCALAR,PRIM_TEX_HEIGHT_SCALAR)*screenLoc.xy;
}

float getTextureID(uint primitiveID){
