defold / editor2-issues

DEPRECATED
44 stars 4 forks source link

Add feature to enhance sprites (or a new sprite+ component) so that texture frames can pass other textures along with diffuse #844

Open subsoap opened 7 years ago

subsoap commented 7 years ago

When you add images to an atlas you could add for example

guy_jump_1
guy_jump_2
guy_jump_3

What if we could add

guy_jump_1_DIFFUSE
guy_jump_2_DIFFUSE
guy_jump_3_DIFFUSE
guy_jump_1_NORMAL
guy_jump_2_NORMAL
guy_jump_3_NORMAL

Then be able to define the animation as

guy_jump_1
guy_jump_2
guy_jump_3

And in the sprite component be able to define the different texture sets to pass to the material like

DIFFUSE
NORMAL

And it would automatically pass in the right data for example for when the animation is on the first frame of animation "guy_jump"

guy_jump_1_DIFFUSE
guy_jump_1_NORMAL

This way the position of the different diffuse / normal / etc. maps doesn't matter, they could all share the same texture atlas but would also need to pass in the right coords for each extra texture too.

blurymind commented 7 years ago

This feature would be incredibly useful for sprite shaders The approach has been getting increasingly popular with the advance of tools such as https://www.kickstarter.com/projects/2dee/sprite-dlight-instant-normal-maps-for-2d-graphics https://www.youtube.com/watch?v=YMTZ_urkVjQ

related thread: https://forum.defold.com/t/deffx-a-collection-of-useful-shader-effects/8172/23