...Create a WebGL effect?

0 favourites
  • 7 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hello! I was curious if there is some kind of guide to creating effects for Construct? I've been really curious in learning GLSL to do this, but I looked in the effects folder and it looks like there are XML files that look like they were generated in a way ("Don't change the id, change the name instead"), although I could be mistaken. If I am mistaken, then this is really confusing.

    I've also tried copying a certain effect that wasn't built for C2 and changing the XML manually to fit it, but when I applied it in C2 I get all sorts of errors...

    Any tips or guides to lead me in the right direction is severely appreciated. Thank you :)

  • Nothing's generated, all the files are hand-written. You can copy-paste an existing effect and just tweak the files to make new ones, e.g. changing the name and id and changing the shader code.

    The shader language is WebGL's shading language. This is slightly different variant of GLSL that you traditionally get on desktop - it's based on GLSL ES, which is the mobile variant, plus the fact it's run in a browser and is often re-compiled behind the scenes for security reasons. This means desktop GLSL basically never copy-pastes and works - you'll need to carefully port it based on the limitations of WebGL shaders.

  • Nothing's generated, all the files are hand-written. You can copy-paste an existing effect and just tweak the files to make new ones, e.g. changing the name and id and changing the shader code.

    The shader language is WebGL's shading language. This is slightly different variant of GLSL that you traditionally get on desktop - it's based on GLSL ES, which is the mobile variant, plus the fact it's run in a browser and is often re-compiled behind the scenes for security reasons. This means desktop GLSL basically never copy-pastes and works - you'll need to carefully port it based on the limitations of WebGL shaders.

    Ah, thank you. I was originally trying to see if I could get shurcooL's Motion Blur Demo (WebGL based, but I had thought GLSL was used in WebGL. Silly me ^^') to work in Construct. I wasn't gonna use it without permission, but I wanted to see how well it would work in-game. He wrote two separate scripts (One for fragment shading, one for vertex shading.), so I have no idea how I would get those two to work together, even though I don't know how to use the language anyways...

    I'll certainty look into the language a bit more and see what kind of neat things I can create on my own, though. Thanks again!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hi Phobos002 did you have any luck with your Motion Blur effect? I'm looking to do something similar..

  • Not as an effect, but very recently I made a very decent Motion Blur using R0J0's paster object. The problem is that it's currently a CPU hog and I'm not sure in what ways I can optimize it. I am going to make a thread about it and give the capx for it and see what ideas the community might have. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    You can see it right now here: https://dl.dropboxusercontent.com/u/214 ... index.html

    There are a a few artifacts (Transparancy and rounded pixels) but I'm sure there's a way around it. Let me know what you think!

  • I'm really excited to see this Motion blur effect with more optimization.

  • I'm really excited to see this Motion blur effect with more optimization.

    I am going to try to do the same thing with only sprites and see if it runs any faster. Hopefully it does and we will all have a happy ending

    EDIT: It's a LOT faster, but it uses a LOT of objects. (25% CPU with 12 entities (24*12 = 288 objects) instead of 50% CPU with 9 entities) Need to find a way to use less objects ._.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)