-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basic webggl2 support for those that dont need much from webgl2 #623
Comments
After some exploration, look slike geenral support for WEBGL 2 would be difficult for regl. But what would help is some smaller changes that will enable some users to support webgl2. For example, just giving opengl2 context to regly, OpenJSCAD works just fine. First issue is that we are unable to add some optimizations by using oes_element_index_uint . oes_element_index_uint works if we use webgl1 but with webgl context we get to impossible situation
|
Have you seen this issue? #561 I'm not quite sure how to use it, but people have taken a stab at ironing out some of the basic compatibility issues. I don't think regl will ever formally support webgl 2 (unless it's a separate webgl2 fork), but I believe people have had enough luck to at least be able to take advantage of some webgl 2 features. |
@rreusser thanks for the link to the wrapper. Ii it comes to that, I might use it, for now this ugly workaround is enough. function createContext (canvas, contextAttributes) {
function get (type) {
try {
return {gl:canvas.getContext(type, contextAttributes), type}
} catch (e) {
return null
}
}
return (
get('webgl2') ||
get('webgl') ||
get('experimental-webgl') ||
get('webgl-experimental')
)
}
.......
.......
const {gl, type} = createContext(canvas)
const options = {gl}
if(type === 'webgl'){
options.extensions = ['oes_element_index_uint']
} |
my current workaround is |
openjscad uses regl, and looks to move to webgl2 with fall-back to webgl.
jscad/OpenJSCAD.org#878
currently a kind of workaround is used that supplies context instead of canvas element.
but some small changes will be needded in regl to support this.
The text was updated successfully, but these errors were encountered: