Seriously!

Go Back   Seriously! Forums > Serious Sam Series > Serious Sam 3 > Serious Sam 3: BFE Workshop

Serious Sam 3: BFE Workshop The official forum for Serious Sam 3: BFE projects, be it maps, mods, or something else.

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 08-08-2014, 05:05 AM   #1   Add To Ignore List  
Lurker
 
Dankzaii's Avatar
 
Joined: Nov 2011
Location: Isengard
 
Dankzaii is offline
Default Making animated textures?

I was wondering if its possible to import textures in SED in a way they are animated

(Like lets say, I want to import all the frames of a .gif and then make it so that I can "recreate" that gif inside SED as a model)
  Reply With Quote
Old 08-08-2014, 07:33 AM   #2   Add To Ignore List  
Developer Fairy
 
Solais's Avatar
 
Croteam Representative
Joined: Nov 2009
 
Solais is offline
Default Re: Making animated textures?

Well, in SS3's editor, if you click Texture, below Create Texture there's now a Make Sprite Sheet thing. Haven't tried it yet though, but imo it's that.
__________________
Since Old Lost Age I Shine

My Serious Sam 3/HD Workshop


While I do work for Croteam, I'm first of all of this community, so my opinions are my own and do not represent Croteam's views.
Unless when I use this nice blue color I totally didn't steal from Blizzard.
  Reply With Quote
Old 08-09-2014, 12:11 AM   #3   Add To Ignore List  
.
 
viper45's Avatar
 
Joined: Mar 2001
 
viper45 is offline
Default Re: Making animated textures?

To make an animated texture, you have to make a sprite sheet. The feature Solais is talking about crashes SED3.5 for me, so unless you have better luck with it, you'll have to make one by hand.

A sprite sheet is just a single texture that includes all frames of your animation in a perfectly spaced grid. What your grid looks like depends on how many frames are in your animation. For example, if you have 4 frames, it could be split into a 2x2 grid. Things get a little more confusing if your number of frames isn't a power of 2 (2, 4, 8, 16, etc).

Here's an example of what a spritesheet with 10 frames might look like:

http://img.photobucket.com/albums/v720/Viper45/SpriteSheetExample.jpg~original

I couldn't use something like a 5x2 grid because that wouldn't fit in a texture with proper dimensions (powers of 2). So I went with 4x4 and wound up with unused frames, which is fine and will probably happen more often than not.

Then you bring that texture into SED3 as you normally would. Give your model a material, and use the sprite sheet as your texture. Then add a "CTextureAnimatorModifier" to your Shader Modifiers list. Set the "Count of frames X" and "Count of frames Y" to the dimensions of your grid, then set "Count of Frames" to the total number of frames in your animation. Lastly, set the Loop Period to the number of seconds you want the full animation to take.

Here's my Modifier that makes the above texture work:

http://img.photobucket.com/albums/v720/Viper45/AnimatorModifier.jpg~original

I set X and Y to 4 since I used a 4x4 grid, told it to only use 10 frames so that it doesn't try to use the space marked "Unused frames", and then set the Loop period to 2 so that it takes 2 seconds to go through all 10 frames.

I hope that helps. Let me know if you run into any issues or have any more questions.

Last edited by viper45; 08-09-2014 at 12:18 AM.
  Reply With Quote
Old 08-09-2014, 12:22 AM   #4   Add To Ignore List  
Lurker
 
Dankzaii's Avatar
 
Joined: Nov 2011
Location: Isengard
 
Dankzaii is offline
Default Re: Making animated textures?

Huh, that is very interesting!

Beforehand I would like to know, can I make it so that the grid is 8 squares width x 8 squares height? The gif uses 58 frames, but is it fine as long as the resolution is something with the power of 2? (like the whole sheet is 512 x 512 or something)
  Reply With Quote
Old 08-09-2014, 12:37 AM   #5   Add To Ignore List  
.
 
viper45's Avatar
 
Joined: Mar 2001
 
viper45 is offline
Default Re: Making animated textures?

Yeah, 8x8 would be just fine. That's what I would use for 58 frames. 512x512 might be a little small for it though, that would mean each frame is only 64x64. I wouldn't be afraid to go up to 1024 or 2048.
  Reply With Quote
Old 08-09-2014, 01:02 AM   #6   Add To Ignore List  
Lurker
 
Dankzaii's Avatar
 
Joined: Nov 2011
Location: Isengard
 
Dankzaii is offline
Default Re: Making animated textures?

Alright, I just made a 2x2 grid as a test and everything seems to be working great so far!

Thank you so much Viper! I owe you a really big one!
  Reply With Quote
Old 08-09-2014, 09:06 AM   #7   Add To Ignore List  
Finzy Corp. CEO
 
Finzy's Avatar
 
Joined: Sep 2005
Location: Whatshisoffice
 
Finzy is offline
Default Re: Making animated textures?

Thanks for that Viper, that seems very useful. I can already see lots of creative uses for it. Wonder if there are any performance issues using large textures with it though (say 2K or 4K textures).
  Reply With Quote
Old 08-09-2014, 11:31 AM   #8   Add To Ignore List  
Pan
Silver Lined Boots
 
Pan's Avatar
 
Joined: May 2007
Location: Looking for Snake
 
Pan is offline
Default Re: Making animated textures?

Thank you so much Viper this is super useful.
__________________
"Don't you have to be told to do things to be considered a slave?"
  Reply With Quote
Old 08-09-2014, 12:40 PM   #9   Add To Ignore List  
.
 
viper45's Avatar
 
Joined: Mar 2001
 
viper45 is offline
Default Re: Making animated textures?

Glad I could help. Finzy, I'm not 100% sure but I don't think a 4k sprite sheet would hurt performance any more than a normal 4k texture would. I think the engine just moves the model's UV coords to cycle through the different frames. Other than that, it's just a normal texture. SS3 already uses lots of 4k textures so I think it would be fine.
  Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making HUD Textures dragon99919 Serious Sam HD 0 02-18-2013 03:31 PM
Making collisions follow animated models viper45 Serious Sam HD 4 01-17-2012 10:13 AM


All times are GMT -4. The time now is 04:19 PM.