Jump to content

Texture/Material Effects


gamecreator
 Share

Recommended Posts

I'm getting to a point where I would like to implement special effects into my platformer.
mage.gif.b723c71231a9c074d7fcbdcac05a760e.gif
I'm talking about hit effects, spells, etc. ... stuff like this:

big-spark.gif

bunker-buster-effect-hit.gif?w=416

My main concern is that I want to avoid having 50 gigs of textures and be somewhat smart about how I do things.  So I'm hoping people can chime in here about what additional tricks I can use to save frames/be efficient.  Things like SetColor to change the color of effects instead of making pre-rendering separate colors.

This video I posted before had some neat tricks:

but I don't know how to do things like change the texture UV by code.  I've been looking at the material and texture docs and the only other thing that seems helpful is SetPixel but I think that's too expensive to do every frame for multiple textures.  My next step is to look at the headers for any possible undocumented functions but I could use some feedback on other tricks / functions I may have missed.

Finally, I know the smartest thing is probably to code shaders (for example, I'm pretty sure it could scroll or scale the texture UV no problem) but that's been a bit intimidating for me to get into.  If things get a little out of hand with these sprite sheets then it may come to me having to dive in.

I just tested animating and scaling the UVs in Max in various ways but it looks like Leadwerks doesn't import them.

tldr: what are some ways to animate/alter materials or textures with code besides SetColor and SetPixel?

Link to comment
Share on other sites

Implemented a hit effect (free spritesheet here: https://opengameart.org/content/hit-animation-frame-by-frame).  Nice to get help from past threads too.

warrior.gif.d635fba395929bd8698a190b81be4179.gif

Edit: and most of a spell effect (I'm going to add at least one more layer to make it a bit more lively).  Note how the glow scales up in size quickly as he raises his staff.  That's done by code (using SetScale).

cast.gif.df4f2bfecf149a65092826a6ca5e66dd.gif

  • Like 6
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...