[gl2ps] troubles rendering to gl2ps

Gregory Martinez gregory.david.martinez at gmail.com
Thu Jul 21 09:00:09 CEST 2016


Apparently, this is being caused by my use of vertex and fragment shaders
-- as when I don't use them, gl2ps works fine.  Is there a way I could use
both vertex/fragment shaders with gl2ps?

On Wed, Jul 20, 2016 at 8:15 PM, Gregory Martinez <
gregory.david.martinez at gmail.com> wrote:

> Hello,
>
> I'm having troubles rendering to gl2ps.  When I try to render to gl2ps, I
> get a eps that is blank, but has the correct dimensions.  This makes me
> think that it's using the correct viewport, but something is going wrong
> with the actual rendering.  The GL option I am using are:
>
>             glewInit();
>             glClearColor(1.0, 1.0, 1.0, 1.0);
>             glEnable(GL_DEPTH_TEST);
>             glDepthFunc(GL_LESS);
>             glEnable(GL_BLEND);
>             glEnable(GL_VERTEX_PROGRAM_TWO_SIDE);
>             glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
>             glEnable(GL_LIGHT0);
>             glEnable(GL_LIGHT1);
>             glEnable(GL_LIGHT2);
>             glEnable(GL_LIGHT3);
>             glEnable(GL_LIGHT4);
>             glEnable(GL_LIGHT5);
>             glEnable(GL_LIGHT6);
>             glEnable(GL_LIGHT7);
>
> Although I've tried commenting these out with no effect.  I'm also using
> shaders and frame buffer objects -- will these effect gl2ps in anyway?
>
>  The snippet of code that renders to gl2ps is:
>
> void RenderToFile(const GLfloat rotX, const GLfloat rotY, const GLfloat
> rotZ, const GLfloat distance)
>  {
>             FILE *fp = fopen("myoutput.eps", "wb");
>             GLint buffsize = 0, state = GL2PS_OVERFLOW;
>             GLint viewport[4];
>
>             glGetIntegerv(GL_VIEWPORT, viewport);
>
>             char *oldlocale = setlocale(LC_NUMERIC, "C");
>
>             /* gl2ps drawing stuff */
>             setlocale(LC_NUMERIC, oldlocale);
>
>             while( state == GL2PS_OVERFLOW )
>             {
>                 buffsize += 1024*1024;
>                 gl2psBeginPage ( "Titles", "Software", viewport,
>                                 GL2PS_EPS, GL2PS_BSP_SORT, GL2PS_SILENT |
>                                 GL2PS_SIMPLE_LINE_OFFSET |
> GL2PS_NO_BLENDING |
>                                 GL2PS_OCCLUSION_CULL | GL2PS_BEST_ROOT |
> GL2PS_USE_CURRENT_VIEWPORT,
>                                 GL_RGBA, 0, NULL, 0, 0, 0, buffsize,
>                                 fp, "myoutput" );
>                 Render(rotX, rotY, rotZ, distance);
>                 state = gl2psEndPage();
>
>             }
>             fclose(fp);
> }
>
> Here, Render(...) contains the actual drawing commands.  Any help would be
> appreciated.
>
> -- Greg
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gl2ps/attachments/20160721/42a606d6/attachment.html>