[Bf-committers] Bringing anti-aliasing back by fixing selection method

Damien Plisson damien.plisson at yahoo.fr
Sat Jan 16 08:52:08 CET 2010


Hi Campbell,

The occlusion functions need to have the full object drawn (including faces, though this doesn't need to be perfectly neat), for the GPU to get all the zbuffer data, and thus tell how many samples for each glbegin/glend sequences are actually visible.
But there is still lots of room for optimization (including caching). But I may need help in this area.

Most of the functions are clearly grouped in the drawobject.c file (the oqs_* functions). editmesh_mod.c init_backbuf* functions are now clearly splitted in two parts, for the higher level selection part:
if (FSAA)
     use occlusion query
else
     use color coding

plus some others needed for occlusion vs color coding branching.

I added mechanism to query status of FSAA (glutil_isFSAAstarted()) so that occlusion query is used only when FSAA is initialized.
Not using #ifdef in this case also gives the flexibility that'll take advantage of the user prefs split Ton is envisioning. That is having some "launch time" user prefs which will include a FSAA toggle at pixelformat/init level.

Concerning the zbuffer broken part in existing code, I've not looked deeply in it to have an idea on it. But for Martin changes, there were triggered by an issue I reported in bug#20640. You can get the "bug triggering" .blend in the bug report.

Damien

Le 15 janv. 2010 à 02:08, Campbell Barton a écrit :

> Hey Damien, didnt even know these occlusion buffers existed until you
> posted but some considerations...
> 
> - Existing select code isnt perfect, for instance particle border
> select + zbuffer is broken (wasnt able to fix in an hr or 2). Martin
> commented some functions I added to fix selection which contain
> operations Im sure are needed in certain cases (converting the view
> clipping into object space is one) - Ill need to look into this
> further but I think there are currently cases where its broken.
> 
> - Skim-read your patch and noticed the occlusion functions you had are
> doing flat/smooth shading on faces. is this needed? (are vertex
> normals even needed?).
> 
> - If this could be added in and used only with FSAA Im OK with that,
> however it should at least not confuse the current state of selection
> more then it alredy is... these funcions should be grouped/clearly
> marked... IFDEF's or whatever so we know they are only called with
> FSAA.
> 
> - Campbell
> 
> On Thu, Jan 14, 2010 at 11:23 PM, joe <joeedh at gmail.com> wrote:
>> Or well I should be clearer, this needs to be optional at first while
>> we do wide-scale user tests and fix any issues.
>> 
>> Joe
>> 
>> On Thu, Jan 14, 2010 at 2:15 PM, joe <joeedh at gmail.com> wrote:
>>> I'd suggest making it an option for now, or only enabled when FSAA is on.
>>> 
>>> Joe
>>> 
>>> On Thu, Jan 14, 2010 at 12:49 AM, Damien Plisson
>>> <damien.plisson at yahoo.fr> wrote:
>>>> Unfortunately, even with glDisable(GL_MULTISAMPLE_ARB), there are still artifacts (at least n nvidia) that break the color coding method. And thus weird things happen, like orphan out of the selection area vertices being selected.
>>>> 
>>>> Occlusion query is part of openGL standard from rev. 1.5. So it should work well with other cards, but I'm interested to get feedback from ati/intel cards owners...
>>>> 
>>>> Damien
>>>> 
>>>> 
>>>> Le 14 janv. 2010 à 06:19, joe a écrit :
>>>> 
>>>>> Though of course rewriting it more properly is good too.  I've not
>>>>> looked into occlusion query since the original nvidia extension; how
>>>>> well does it work across disparate video cards?
>>>>> 
>>>>> Joe
>>>>> 
>>>>> On Wed, Jan 13, 2010 at 9:15 PM, joe <joeedh at gmail.com> wrote:
>>>>>> Explicitly disabling it in the selection draw functions seemed to work
>>>>>> well enough before, via glDisable(GL_ARB_MULTISELECT).
>>>>>> 
>>>>>> Joe
>>>>>> 
>>>>>> On Wed, Jan 13, 2010 at 8:32 AM, Damien Plisson <damien.plisson at yahoo.fr> wrote:
>>>>>>> Hi all,
>>>>>>> 
>>>>>>> FSAA was breaking border/lasso select operations (e.g. orphan vertices were selected).
>>>>>>> 
>>>>>>> FYI, The root cause for this issue is that as soon as FSAA is enabled at pixelformat level, even if not enabled afterwards, some color artifacts may appear in draw operations.
>>>>>>> This breaks the color coding selection method that is currently used in Blender for various selection tools like border, lasso, circle... when occlude geometry is enabled.
>>>>>>> 
>>>>>>> To fix it, the color coding selection method has to be replaced, and this is what this patch does by implementing the occlusion query method for the border/lasso/circle selection tools:
>>>>>>> 
>>>>>>> http://projects.blender.org/tracker/index.php?func=detail&aid=20660&group_id=9&atid=127
>>>>>>> 
>>>>>>> I'm looking forward for your feedback / comments / suggestions...
>>>>>>> 
>>>>>>> Damien
>>>>>>> _______________________________________________
>>>>>>> Bf-committers mailing list
>>>>>>> Bf-committers at blender.org
>>>>>>> http://lists.blender.org/mailman/listinfo/bf-committers
>>>>>>> 
>>>>>> 
>>>>> _______________________________________________
>>>>> Bf-committers mailing list
>>>>> Bf-committers at blender.org
>>>>> http://lists.blender.org/mailman/listinfo/bf-committers
>>>> 
>>>> _______________________________________________
>>>> Bf-committers mailing list
>>>> Bf-committers at blender.org
>>>> http://lists.blender.org/mailman/listinfo/bf-committers
>>>> 
>>> 
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
>> 
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



More information about the Bf-committers mailing list