DefFX - A collection of useful shader effects


#21

This tool is really useful. http://spector.babylonjs.com/

You can make HTML5 builds, and then be able to see every step of rendering.


#22

I don’t think I can fix it the right way because things are missing.

Sprites are not currently sent normals? I tried to add the normal values to the shader program anyway but it’s not working.

Until this is fixed you can’t rotate sprites nor flip them otherwise it breaks the lights. You’ll have to make animations for each direction with their own normal texture pairs.

There is probably still a workaround related to sending more information to the shader from the object being lit but that’s kind of lame because it can require a script for every single thing being lit or a manager which knows about everything.


#23

I think if you changed the tilesource, the offset in shader should be changed, though we can pass it to shader, but all the changes have to be handled manually. I have the save idea these days, but give it up after some test :joy:.


#24

Hopefully we’ll be able to set _DIFFUSE, _NORMALS etc. textures for sprite frames in a user friendly and low busy work way. I made an issue on github to hopefully get the feature eventually.


#25

Yes, or allow us to pick another image from same atlas/tilesource, and the engine pass the offset to us, so we can avoid a second texture file.


#26

Here is way I suggested to do it so that all image version could still be in the same texture atlas.


#27

Any thoughts on CRT style shaders for retro games?


#28

You can adapt most any CRT style shader you can find in the wild to work with Defold if you can find a version you like. If it’s already GLSL it’s easier to adapt.


#29

If you follow Pkeod’s suggestion, please share, as I haven’t delved deep enough into the subject myself but I want it for my game as well.

Not all shaders will work on all platforms, be aware of that. I tried a scanline one on android and it was a no go. Think it’s GLSL version related.


#30

Can I ask which render script from your DefFX repo did you use for this example with normal sprite illumination? Could you please explain how can this effect be achieved? Even with your example sprite, normal map, pixel_sprite_normal_hstrip.material , fp and vp I’ve got something like this:

image


#31

No idea what’s wrong, no time to check it out right now.