R: [Plib-users] Overriding face culling
                
                Brought to you by:
                
                    sjbaker
                    
                
            
            
        
        
        
    | 
      
      
      From: Paolo L. <p.l...@ci...> - 2003-02-19 16:31:12
      
     | 
| Norman,
thanks for the hint - so under your guidelines my implementation is now:
	dontcullface = !dontcullface;
	if ( dontcullface ) {
		glDisable( GL_CULL_FACE );
		ssgOverrideCullface( TRUE );
	}
	else {
		glEnable( GL_CULL_FACE );
		ssgOverrideCullface( FALSE );
	}
Unfortunately it still doesn't work.
Paolo
> -----Messaggio originale-----
> Da: pli...@li...
> [mailto:pli...@li...]Per conto di Norman Vine
> Inviato: mercoledì 19 febbraio 2003 17.02
> A: pli...@li...
> Oggetto: RE: [Plib-users] Overriding face culling
>
>
> Paolo Leoncini writes:
> >
> > Can anybody explain why? and how to force disabling back face culling?
>
>
> Maybe this code snippet will help
>
>
>   /*
>     Multipass rendering sometimes required:
>
>     * Wire plus filled
>     * Filled-front-faces with wire backfaces.
>     * Selected polygons have white wire faces.
>   */
>
>   if ( rendermode & RENDER_TEXTURE )
>   {
>     glEnable ( GL_TEXTURE_2D ) ;
>     ssgOverrideTexture ( FALSE ) ;
>   }
>   else
>   {
>     glDisable ( GL_TEXTURE_2D ) ;
>     ssgOverrideTexture ( TRUE ) ;
>   }
>
>   /*
>     If filled AND not wire AND not backfaces - then need wire
>     as a first pass.
>   */
>
>   if ( (rendermode & RENDER_FILLED    )!=0 &&
>        (rendermode & RENDER_WIRE      )==0 &&
>        (rendermode & RENDER_BACKFACES )==0 )
>   {
>     /* First pass: Both faces, wireframe */
>
>     glPolygonMode ( GL_FRONT_AND_BACK, GL_LINE ) ;
>     glDisable ( GL_CULL_FACE ) ;
>     ssgOverrideCullface ( TRUE ) ;
>     ssgCullAndDraw ( getSceneRoot() ) ;
>
>     /* Zap the Z buffer */
>
>     glClear ( GL_DEPTH_BUFFER_BIT ) ;
>
>     /* Second pass: Front faces only - filled */
>
>     glPolygonMode ( GL_FRONT_AND_BACK, GL_FILL ) ;
>     glEnable ( GL_CULL_FACE ) ;
>     ssgOverrideCullface ( FALSE ) ;
>     ssgCullAndDraw ( getSceneRoot() ) ;
>   }
>   else
>
>   /*
>     If filled AND wire - then need wire as a second
>     pass.
>   */
>
>     if ( (rendermode & RENDER_FILLED)!=0 &&
>        (rendermode & RENDER_WIRE  )!=0 )
>     {
>       setOffsetProjectionMatrix ( PUSH_BACK ) ;
>       glPolygonMode ( GL_FRONT_AND_BACK, GL_FILL ) ;
>       glDisable ( GL_CULL_FACE ) ;
>       ssgOverrideCullface ( TRUE ) ;
>       ssgCullAndDraw ( getSceneRoot() ) ;
>
>       glPolygonMode ( GL_FRONT_AND_BACK, GL_LINE ) ;
>       glEnable ( GL_CULL_FACE ) ;
>       ssgOverrideCullface ( FALSE ) ;
>       ssgCullAndDraw ( getSceneRoot() ) ;
>     }
>     else
>
>     /* We only need one pass.  */
>
>     {
>       if ( rendermode & RENDER_WIRE )
>         glPolygonMode ( GL_FRONT_AND_BACK, GL_LINE ) ;
>       else
>         glPolygonMode ( GL_FRONT_AND_BACK, GL_FILL ) ;
>
>       if ( rendermode & RENDER_BACKFACES )
>       {
>         glDisable ( GL_CULL_FACE ) ;
>         ssgOverrideCullface ( TRUE ) ;
>       }
>       else
>       {
>         glEnable ( GL_CULL_FACE ) ;
>         ssgOverrideCullface ( FALSE ) ;
>       }
>
>       ssgCullAndDraw ( getSceneRoot() ) ;
>     }
>
>   glFinish () ;
>
>
> Ciao
>
> Norman
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
> The most comprehensive and flexible code editor you can use.
> Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
> www.slickedit.com/sourceforge
> _______________________________________________
> plib-users mailing list
> pli...@li...
> https://lists.sourceforge.net/lists/listinfo/plib-users
 |