[gl2ps] GL2PS_OCCLUSION_CULL ignores GL2PS_BLEND

Shahzad Muzaffar Shahzad.Muzaffar at cern.ch
Thu May 8 11:36:50 CEST 2008


Hello,
  Please try to apply the attached patch ("patch -p0 < 
gl2ps.1.32.culling.patch" in gl2ps version 1.32 directory). Basically it 
just adds the following line

if (prim->verts[0].rgba[3]<1.0F) return;

at line number 1766 of gl2ps.c (version 1.32). i.e. function 
gl2psAddPlanesInBspTreeImage () will look like

  if((*tree == NULL) && (prim->numverts > 2)){
    if (prim->verts[0].rgba[3]<1.0F) return;
    head = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d));
    for(i = 0; i < prim->numverts-1; i++){

This will avoid adding the transparant polygons in to the BSP tree map 
used for culling. So polygon hidden under these will not be culled. 
Please recompile and test again. Cheers,
--Shahzad

Travis Cobbs wrote:

> The GL2PS_OCCLUSION_CULL setting culls faces that are behind 
> transparent polygons, even when GL2PS_BLEND is properly used.  This 
> produces very ugly output.  Here is an example:
>
> http://www.halibut.com/~tcobbs/ldraw/private/CAR-Cull.zip 
> <http://www.halibut.com/%7Etcobbs/ldraw/private/CAR-Cull.zip>
>
> Unfortunately, if I don't use the GL2PS_OCCLUSION_CULL option, my file 
> comes out about 10 times bigger.  It does look correct, though.  Here 
> is the same file (WARNING: really big SVG inside the zip):
>
> http://www.halibut.com/~tcobbs/ldraw/private/CAR-NoCull.zip 
> <http://www.halibut.com/%7Etcobbs/ldraw/private/CAR-NoCull.zip>
>
> I know that gl2ps hasn't received much in the way of updates lately 
> (even on the CVS snapshot), so if anyone could even suggest what needs 
> to be done to fix the problem, I'll give the fix a try myself.
>
> Thanks.
>
> --Travis Cobbs
>
>------------------------------------------------------------------------
>
>_______________________________________________
>gl2ps mailing list
>gl2ps at geuz.org
>http://www.geuz.org/mailman/listinfo/gl2ps
>  
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gl2ps/attachments/20080508/05621283/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gl2ps.1.32.culling.patch
URL: <http://www.geuz.org/pipermail/gl2ps/attachments/20080508/05621283/attachment.patch>