Wed, 01/12/2022 - 18:37
Forums:
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));
Thanks for your help,
Best regards.
Wed, 01/12/2022 - 19:08
Which version of OCCT is used? MSAA sample.
Thu, 01/13/2022 - 10:54
Thank you for the explanation of line width problem, i'm currently using the 7.6 version of OCCT.
Thu, 01/13/2022 - 11:43
Emmanuel BIGEON wrote:
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.
Thu, 01/13/2022 - 16:33
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.
Wed, 01/12/2022 - 19:13
Emmanuel BIGEON wrote:
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).