@Pkeod Excellent!! Can you upload an example project ot reusable asset I can study in defold? This would be an amazing addition to the github repository with shaders!
Yes, Iāll push to the DefFX repo again soon. Iām adding some basic support for more lights/types first.
Still need to fix this issue of rotated sprites not getting right lighting due to static normal map. I think I just need to calculate tangent with dFdx / dFdy magic. Will try in a few hours at least.
This tool is really useful. http://spector.babylonjs.com/
You can make HTML5 builds, and then be able to see every step of rendering.
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.
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 .
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.
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.
Here is way I suggested to do it so that all image version could still be in the same texture atlas.
Any thoughts on CRT style shaders for retro games?
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.
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.
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:
No idea whatās wrong, no time to check it out right now.
Hi @Pkeod thanks for the scanline shader, it was really helpful - However it failed to compile on my graphics card after a driver update so hereās a fix:
Its fixed in my pull request - there was a problem with changing uniform values
Hey, Iām wanting to learn and maybe use/adapt some of the shaders here for my game. Would it be possible to add a license to the project? Iām still suffering trying to figure out how to add a grayscale shader to my project since the tutorial is out of date shaders are complex to me.
I have added a license now https://github.com/subsoap/deffx/blob/master/LICENSE It is Creative Commons Zero v1.0 Universal the one I prefer and use most of the time.
Also these are all old so user bewareā¦ you may need to adapt them to whatever changes are in current Defold. I want to go through fixing them up and so on but I promised to only take on 3D big time again when mesh based collision was added so it will have to wait.
Thank you! Iām looking into these now, the effects look definitely useful for a lot of games
i know nothing about opengl/shaders/etc, but felt like messing with this today (i originally saw it back when it was first posted). I hacked a little multi-light example together for fun. I really like this. Itās a lot of fun.