Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

7 years ago by StuartTresadern

Finally got the first version of the Tile based Shader completed. ( Some may have seen the updates in the private forum).

/><br />
<br />
<br />
You can find the latest update and links to the git repo.<br />
 <br />
<a href=http://trezsoft.wordpress.com/2012/07/17/impact-tile-shader-plugin/

Here’s a link to the live demo : http://www.spritesheet.net/impactdemos/tileshader/index.html


It seems to run fine on all browers (IE9 needed a refresh to load !) I have not tested this on any mobile devices so I would be very intersted if any one else does.

7 years ago by paulh

Absolutely lovely .. i'll have to design a game that can use it sometime!

I m guessing you could get a MASSIVE performance hike by not drawing whats not in view?

7 years ago by paulh

I also noticed a little bug, if you run to the far right wall, the player is no longer visible :-)

hope that helps.

7 years ago by lazer

This is awesome. The effect looks exactly like what I ended up doing for the light-based game I'm working on, but your code is much neater and the various options are great. I'll most likely end up switching my lighting to this.

7 years ago by stahlmanDesign

This is absolutely awesome

7 years ago by StuartTresadern

@All thanks :) hope it comes in handy.

@paulh performance: depends what type of game and if the layers are pre rendered. If they are pre rendered the win is not that great. I do have some additional work to do on the shader which should reduce the draw calls by 30-40% depending on how it is used. Thanks for reporting the bug, I had fixed this issue but it seems to have come back after I changed the offset calculations and added in support for scale. Il get it fixed asap.

@lazer if you have any ideas from your implemenation that may improve the shader class let me know and ill see if I can add them in.

7 years ago by RationalGaze

You're a genius man. Thanks a lot for your work !

7 years ago by mimik

great one.

7 years ago by Jerczu

Did you by any chance tested it wit iOSimpact?

7 years ago by StuartTresadern

No not yet. Its only using image draw calls ( the same way any other background map is draw), one of the reasons I used pre created tiles instead of using canvas drawing to generate them was because of some of the possible draw issues that I had read about at the time. If you do give it a try I would be interested in any feedback.

7 years ago by mimik

Would love to get it going with iOSimpact ;-)

7 years ago by StuartTresadern

Quick update: A dev "Nico" (see my blog for thread) has this working with http://ludei.com/tech/cocoonjslauncher cocoonJS on a Samsung Galaxy 2 , 60 FPS doing 126 draw calls. He reported some issue with appmobi which I need to look into before getting it to work with cocoonJS.

7 years ago by fugufish

nice work!

7 years ago by fugufish

@StuartTresadern in your biolab demo, i noticed that the player sprite becomes "black" when he hits the well running right.

but running left, everything look ok

7 years ago by fugufish

i attached a pic

/><br />
<br />
notice you can't see the player sprite anymore at the right wall ( just a black outline )			</div>
		</div>
			<div class=

7 years ago by StuartTresadern

Thanks for the feedback. paulh found this bug some time back. Basically its down to different camera offsets, when I put the shader in the jump run demo I did no check the difference it how the camera worked. The fix will be in the next version

6 years ago by gort

I really want to use it, but when i treid it diddent work. I'd like to see the demo, but the link is dead

6 years ago by Joncom

Quote from gort
I really want to use it, but when i treid it diddent work. I'd like to see the demo, but the link is dead
"Didn't work" is pretty vague. Maybe if you gave more information, such as an error you received in console, then someone could help you.

6 years ago by gort

Ok! Well... No errors. just some lighted tiles and blackness.

6 years ago by Joncom

@gort: Isn't that what the plugin is supposed to do?

6 years ago by gort

No, Becouse the player is in blackness and the lighted tiles are, like, 144 or 4 36x36 tiles away.

5 years ago by Apiheld

I improved the original plugin and posted a new version. This article describes it in a bit more detail and has a demo:

http://www.ntaso.com/tile-based-shader-plugin-for-impact-js/

/><br />
<br />
Improvements:<br />
<br />
- The shader supports multiple entities<br />
- Each entity can have its own lighting options (innerRadius and outerRadius)<br />
- Line of sight works for multiple entities<br />
- Improved the shading steps for small light sources<br />
- No extra shading layer required. It uses the collision map for line of sight shading. However, you can provide a shading layer if you want.<br />
- Fixed some bugs with scrolling maps and the camera plugin<br />
<br />
Thanks @StuartTresadern for the original plugin.			</div>
		</div>
			<div class=

5 years ago by city41

this is really awesome. I'm going to try incorporating it into my game. I used a super poor man's lighting technique, this will be way better.

5 years ago by stahlmanDesign

This is really great, especially because the demo and documentation is so thorough

5 years ago by Apiheld

Ah one more note:

It has a lot of draw calls. Like 600 or so. This was the same in the original plugin and I didn't try to reduce them. However, if your light sources don't move, they are hardly re-drawn and even if they move and you have 600 draws, a modern computer manages them quite fine. I'm just a bit worried about mobile devices. Might require additional tweaking.

5 years ago by Apiheld

And let me know if you have problems including it. I'll try to help. And show us the results later :)

5 years ago by Joncom

@Apiheld: Pretty GIF, cool demo, and nice documentation -- well done.

5 years ago by drhayes

Yeah, good job. Looks great and I'm going to be digging in on this one.

5 years ago by city41

I like this plugin. I want to use it in a game some day. I tried to add it to my game Dragon Plunder but I felt it wasn't quite the right look/feel for that game.

Good stuff!

5 years ago by Apiheld

@Joncom & drhayes: Thanks :)

@city41: Yeah, I think it doesn't work with all games. Your game doesn't have "obvious" tiles. A smoother or pixel-perfect shader would probably be better. A game where tiles are clearly identifiable as such (even though good pixel artists try to avoid that) benefits way more from a tile-based shader.
Page 1 of 2
« first « previous next › last »