[Mesa-dev] Anti-aliasing problem using OSMesa

Brian Paul brianp at vmware.com
Mon Apr 24 15:16:02 UTC 2017


On 04/21/2017 12:25 AM, green we wrote:
> I tried to use OSMesa to do offscreen rendering, refer to the osdemo and
> the tutorial here: http://www.alecjacobson.com/weblog/?p=2827
> There are obvious serrations on the edge of the model.
>   I have tried these solution but all failed, can any one gieve me some
> suggestions? the solution I have tried:
> 1. Using post processing -- pp_jimenezmlaa
> the result is not good enough.
>
> 2. Try to using MSAA by FBO, but the multisamled fbo can't be created
> correctly.
>    Detail desctription here:
> http://stackoverflow.com/questions/43532454/osmesa-gl-framebuffer-incomplete-attachment-error-when-create-a-multisampling-fb

I'm not 100% sure, but I think the Intel "swr" render works with OSMesa 
and supports MSAA.  That would be the only software driver that would 
possibly support AA FBOs.


>
> 3. Try to modify the sampling function in mesa, according the thread:
> https://sourceforge.net/p/mesa3d/mailman/message/24438334/ ,  set the
> stop = 16 and add exit(__LINE__) in the function.
> but it seems the function is not used anymore.

It's used, but only by the "legacy" swrast driver, not the llvmpipe, 
softpipe or swr drivers.  In any case glEnable(GL_POLYGON_SMOOTH) is not 
a great approach to AA.  And we don't support it with any gallium driver.

I suspect you're using either softpipe or llvmpipe.  You could try swr 
by setting GALLIUM_DRIVER=swr, if you build the swr driver.

-Brian

>
> The mesa swrast AA triangle code is in src/mesa/swrast/s_aatriangle.c
> and s_aatritemp.h
> The compute_coverage() functions (different versions for RGB vs. CI
> mode) basically count how many sub-pixel samples lie inside the
> triangle for each pixel.  A jittered 4x4 sample pattern is used.  You
> could probably increase the number of samples to improve AA quality a
> little.
> -Brian
>
> Thanks!
> ------------------------------------------------------------------------
> wegatron at hotmail.com
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>



More information about the mesa-dev mailing list