Ashley's Recent Forum Activity

  • Transcoding media files is a specialist task that isn't really something a game engine would normally do. There are free web services out there that can already transcode media files for you.

  • At the moment you must use NW.js to publish to Steam.

  • I can't really get in to debugging people's addons for them, I hardly have time to do everything else as it is - but just glancing over this it looks like inst.conditions.OnDisconnect is the wrong way to refer to a condition so you're basically passing undefined to the Trigger method. Get used to using a JavaScript debugger and you should be able to find mistakes like this yourself.

  • It looks like a bug in a third-party addon, perhaps something to do with "MCubeMomentJS". If a third-party addon is breaking your project, you'll need to either remove it or report the problem to the addon developer.

  • Please note issues only reported to the forum will not be investigated. They are too easily lost and forgotten and frequently don't include essential information we need. If you run in to a problem please file an issue following all the guidelines.

  • On further review after checking the code, it turns out my earlier reply was wrong: destroying an object does not stop a positioned sound. Apologies for the confusion.

  • I'm not really sure what exactly you are referring to, but for what it's worth, I have a fully up-to-date Windows 11 running here and Construct 2 still appears to work fine and can still open projects OK.

  • Does the project use the legacy Function plugin? If so then for backwards compatibility c3_callFunction() will call a function in the legacy Function plugin instead of a built-in function. To make sure it calls built-in functions, remove the legacy Function plugin.

  • If a third party plugin is broken (it looks like it's lunarray_Tween), then try deleting it from the project. Make sure every object that uses it as a behavior has the behavior removed. That should mean preview works again. Then you can probably replace it with the new built-in Tween behavior.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • As far as I can tell from a quick glance at the docs, they don't use a real browser engine - it doesn't use HTML and CSS, instead using something they call WXML and WXSS.

    Past painful experience has taught me that trying to support non-standard browser engines is difficult to justify. It takes an enormous amount of development work and still never ends up working 100% correctly, with endless bugs that never happen in real browsers, and endless incompatibilities with how real browsers work, causing us to have to write complicated code all through the engine to deal with the various problems, which in turn risk breaking other platforms and making maintenance more difficult for the codebase as a whole. So it turns out being a huge time sink with product-wide disadvantages and then everyone still complains about it being broken anyway.

    Meanwhile if they just used a webview and used a real browser engine, we could achieve near-100% compatibility with very little work. So I'm afraid so long as they use their own custom not-a-real-browser engine, I would be extremely reluctant to work on this; if they supported real browser-based webviews, it would be much more likely we could support it. I don't know why they wouldn't use a real browser engine - it would be much less work both for them and for us, and modern browser engines have exceptional features and performance.

    Problem solved and further replies about attitude don't help anyone, so closing thread.

    This forum post will serve as preliminary documentation for the new support for WebGL 2 shader variants now supported in r321.

    To get started, download the latest effect SDK files from the Addon SDK manual. This now includes a sample WebGL 2 effect, which just renders red with WebGL 1 and green with WebGL 2 to demonstrate which variant is in use.

    Compatibility

    All existing WebGL 1 shaders are compatible with both WebGL 1 and WebGL 2. There is no need to write a WebGL 2 variant of a shader unless you need specific features only available with WebGL 2.

    If you do write a WebGL 2 shader, we strongly recommend still providing a WebGL 1 shader. Do whatever you can to support WebGL 1, whether it's a low quality version, glitchy, or even just output transparency so it doesn't render. If you don't provide a WebGL 1 shader at all, then any project using your shader will cause an error on devices that still only support WebGL 1, with the project failing to load and just displaying a blank screen. There are some details below on using WebGL 1 extensions to support more devices.

    Providing a WebGL 2 shader variant

    To provide a WebGL 2 shader variant, add the following property to addon.json:

    "supported-renderers": ["webgl", "webgl2"]

    This tells Construct to look for both a WebGL 1 and WebGL 2 shader for your addon.

    The WebGL 1 shader is still in the file effect.fx as before. If enabled then the file effect.webgl2.fx specifies the shader to load for WebGL 2.

    Writing WebGL 2 shaders

    Our documentation doesn't cover the full details of writing WebGL shaders - there are lots of other resources across the web covering that. However some key points to note when writing a WebGL 2 shader are:

    • A WebGL 2 shader MUST start with the line #version 300 es. This must be the first line - no comments or other lines are allowed before it.
    • Change varying to in for the vTex declaration.
    • gl_FragColor is not used in WebGL 2 shaders. Instead declare out lowp vec4 outColor; at the top level and assign the result color to that.
    • The texture2D() function for sampling a texture is now just texture() with WebGL 2.

    Once adapted you can then make use of WebGL 2 shader features, such as dFdx(), dFdy() and textureGrad().

    Using WebGL 1 extensions

    When only WebGL 1 is supported, Construct r321+ unconditionally activates the following extensions if supported:

    • EXT_frag_depth
    • OES_standard_derivatives
    • EXT_shader_texture_lod

    If your WebGL 2 shader uses equivalent features, this means you can sometimes support WebGL 1 too by activating them in your WebGL 1 shader, e.g.:

    #extension GL_EXT_frag_depth : enable
    #extension GL_EXT_shader_texture_lod : enable
    #extension GL_OES_standard_derivatives : enable
    
    // now you can use gl_FragDepthEXT, dFdx, dFdy, texture2DGradEXT etc.

    Note however Construct currently doesn't support any way to provide an alternative WebGL 1 shader when these extensions are not supported. Either WebGL 2 or WebGL 1 with some extensions should be widely supported, but it is difficult to find good quality data on this. This approach lets you support more devices though, as instead of requiring WebGL 2, your shader could work with WebGL 1 too if the necessary extensions are available.

    Testing

    Construct r321+ now provides a setting to force the editor and preview to run with WebGL 1. This can help you test your shader variants with both WebGL 1 and WebGL 2 (assuming your device supports WebGL 2). Note this option exists for shader testing only - exported projects will continue to use WebGL 2 when available regardless of the editor setting.

    Conclusion

    Effect addons in Construct r321+ can now take advantage of WebGL 2 shader features by providing a WebGL 2 shader variant. However the shader must be written with updated syntax for GLSL ES 3.0. It is sometimes possible to use WebGL 2 shader features with WebGL 1 using extensions, which will broaden support for your shader.

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,427,385 followers

Connect with Ashley

Trophy Case

  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • Forum Mega Brain Made 20,000 posts in the forums
  • x108
    Coach One of your tutorials has over 1,000 readers
  • x62
    Educator One of your tutorials has over 10,000 readers
  • x3
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x36
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs