Shader Alternatives

RosalinaGalaxer

  • Posts: 239
Hey,

I was wondering if there was any alternative to shaders that could achieve the same effects, but on HTML5. I was hoping to have a mix of the ripple and magnify shader to put behind my bosses, purely for eye candy. If there isn't, that's highly disappointing, but not the end of the world.

Thanks!
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

merrak

  • *
  • Posts: 2738
Shouldn't shaders be supported on HTML5? That sounds like something supported by the more recent OpenFL (what Stencyl 3.5 uses). Quick note: https://community.openfl.org/t/html5-apply-shader-to-bitmapdata/9980

Maybe m.e. knows more about this.

mdotedot

  • Posts: 1654
Image and Actor Shaders:     http://community.stencyl.com/index.php?topic=57431.0

These can be applied to ImageAPI and Actors.

If you want to have particle effects you can check out the Zame Particle System, but these work on images and not on Actors or ImageAPI instances.


Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

RosalinaGalaxer

  • Posts: 239
Shouldn't shaders be supported on HTML5?
That would not appear to be the case. I am still running 3.4, though, so that could be a factor, unless 3.5 released without me knowing somehow...
That link looks promising, but I'm not sure how I'd use bitmap.shader.

All that stuff looks cool, m.e., but it's all for 3.5, which I don't have, so...
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

merrak

  • *
  • Posts: 2738
3.4 uses a much older release of OpenFL... something like 2.x or 3.x where as the current version is 8.x. What resolution is your game?

RosalinaGalaxer

  • Posts: 239
640 x 640, though I'm not sure if that's going to be final. Why, may I ask?
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

merrak

  • *
  • Posts: 2738
640 x 640, though I'm not sure if that's going to be final. Why, may I ask?

Per-pixel rendering is always an option, although for 640x640 probably not a viable one. Your best bet would probably be to wait for 3.5/4.0 public release and explore the new options. The word in the Discord Chat is that it'll be available soon.

RosalinaGalaxer

  • Posts: 239
Yeah, JeffreyDriver said he read about the 3.5 release being soon somewhere. Do we have a solid date, or is it just "sooner than before"?

Is there an article on per-pixel rendering? It sounds interesting.
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

merrak

  • *
  • Posts: 2738
Yeah, JeffreyDriver said he read about the 3.5 release being soon somewhere. Do we have a solid date, or is it just "sooner than before"?

"Within days" was what I read on the Discord. I'm not aware of a solid date, but I wouldn't have expected that. I took that to mean the 'todo' items are finished, but there might be some lingering bugs to fix, documentation to update, and a few other last-minute items.

Is there an article on per-pixel rendering? It sounds interesting.

This is the reference I went off of for my game, which uses per-pixel rendering to draw walls https://community.openfl.org/t/what-is-the-fastest-per-pixel-manipulation-in-html5/1352

Edit. My own results using the methods described in the threads. Might give you a rough idea of how many pixels you can work with per frame.

http://community.stencyl.com/index.php/index.php?topic=41034.msg297036#msg297036

My results suggest rendering 640x640 pixels should be doable, but keep in mind that's only drawing the pixel--not computing what color values it should have, reading data from the source image, doing any math, that sort of thing.

« Last Edit: January 02, 2019, 03:32:00 pm by merrak »

RosalinaGalaxer

  • Posts: 239
Hmm. That looks far beyond my skill level. I guess I'll just have to wait and convert my game to 3.5 when it releases to get shaders working.
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

RosalinaGalaxer

  • Posts: 239
So I've updated to 4.0, and I can run the basic shaders that Stencyl has built in on HTML5. However, any code shader results in a black screen on HTML5. Is there any reason for this? Could the syntax in the shaders be old, and thus not work with the newer OpenFL?
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz


rob1221

  • *
  • Posts: 9473
Looks like shaders that use arrays are not working on either desktop or HTML5.  Other code shaders work fine for me.

RosalinaGalaxer

  • Posts: 239
What shaders did you try, rob1221? I've been trying to get laserhosen's magnify shader and your coloured rings shader to work. Are those array shaders?

Sorry if I sound like an idiot, but I basically am once it comes to actual code.
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

rob1221

  • *
  • Posts: 9473
I see a black screen on HTML5 with my color rings shader so some non-array shaders also aren't working.