in webGL, it is possible to activate anti-aliasing on canvas-context intialization like
gl = canvas.getContext("experimental-webgl", { antialias: true });
My simple question is: how can this option be set via Emscripten C++ to asm.js compiler ? I do not ask about implementing my own antialiasing via custom shader code.
In SDL you can set antialias enabled through SDL_GL_MULTISAMPLEBUFFERS. Like this:
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); // enable MULTISAMPLE
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 2); // can be 2, 4, 8 or 16
SDL_SetVideoMode(...)
This native code will enable antialias for gl context. Look at library_sdl.js:
// in makeSurface function
var webGLContextAttributes = {
antialias: ((SDL.glAttributes[13 /*SDL_GL_MULTISAMPLEBUFFERS*/] != 0) && (SDL.glAttributes[14 /*SDL_GL_MULTISAMPLESAMPLES*/] > 1)),
depth: (SDL.glAttributes[6 /*SDL_GL_DEPTH_SIZE*/] > 0),
stencil: (SDL.glAttributes[7 /*SDL_GL_STENCIL_SIZE*/] > 0)
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With