DiscussionsIssue archiveVisualization and 3D Viewer

Archived discussion

Usage problem of anti-aliasing in WebAssembly

Visualization and 3D ViewerWed, 01/12/2022 - 18:375 replies

Browse this forum
QuestionAuthor

Hi.

I'm trying to add anti-aliasing to my WebAssembly application as follow, but it doesn't seems to work.

Graphic3d_RenderingParams& aParams = view->ChangeRenderingParams();
aParams.IsAntialiasingEnabled = Standard_True;

// I tried this as well not really sure how to use it
aParams.NbMsaaSamples = 8;

I also tried apply LineAspect considering the fact that maybe my line were too thin. But didnt' succeed here as well, if you have any insight to why it don't i'm really interested.


// Doesn't work
 m_aisshape->Attributes()->FaceBoundaryAspect()->SetColor(Quantity_NOC_BLACK);
 m_aisshape->Attributes()->FaceBoundaryAspect()->SetTypeOfLine(Aspect_TOL_SOLID);
 m_aisshape->Attributes()->FaceBoundaryAspect()->SetWidth(3.0);
 
// Doesn't work
m_aisshape->Attributes()->SetLineAspect(new Prs3d_LineAspect(Quantity_NOC_BLACK, Aspect_TOL_SOLID, 4.0));

Archived image: external image

Thanks for your help,

Best regards.

Discussion

5 archived replies

Posts are displayed in their archived order.

01Commenter-1

I'm trying to add anti-aliasing to my WebAssembly application as follow, but it doesn't seems to work.

Which version of OCCT is used? MSAA sample.

02Author

Thank you for the explanation of line width problem, i'm currently using the 7.6 version of OCCT.

03Commenter-1

 Author wrote:

I'm trying to add anti-aliasing to my WebAssembly application as follow, but it doesn't seems to work.

...
Thank you for the explanation of line width problem, i'm currently using the 7.6 version of OCCT.

WebGL 2.0 has limited support for MSAA (compared to desktop OpenGL 3.2 and OpenGL ES 3.1+ available on mobile devices), so that it required extra efforts to add it to OCCT - this has been done in current development branch (targeting OCCT 7.7.0). Graphic3d_RenderingParams::RenderResolutionScale could be used as alternative to MSAA for antialiased output.

04Author

Thank you !
I upgraded my OCCT to 7.7 and now it works very well ! I've also tested the line width with Mozilla options and it does too.

Best regards.

05Commenter-1

 Author wrote:

I also tried apply LineAspect considering the fact that maybe my line were too thin.

WebGL implementations on Desktop browsers usually do not support line width greater than 1.0. Though this could be changed in advanced browser settings (webgl.disable-angle=true within about:config in case of Firefox).