Animated textures discussion

Ask questions, discuss ideas, get answers
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Animated textures discussion

Post by fo0k »

Ok, so Rather than continue to create new threads on this (because there are a few things I'm trying) I guess we can put it all in this thread.

I just tried a quick process of using render to texture to spit out a full animated uvmapped texture for a room.
This technique would be great for candle light etc.. flickering TV.. swinging light... machinery.. lightning (ground terrain, skybox etc can also be lit like this and biks stay 100% synced with each other it seems which is good!) (Lies.. they don't sadly.. I was just 'lucky' for a while!)

Very basic but with an added rotation bundle for the light (or probably just do it with textures) a good effect can be created. The full texture for this room is only 12mb and is 1024x1024 pixels
Cool things can be done for sure..

4mb gif

This is ingame...
Image

The texture..

Image
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Animated textures discussion

Post by Swaffy »

Wow, that is really cool.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Animated textures discussion

Post by Apache Thunder »

If the BIKs do stay synced then you can in theory create a dynamic map where it can turn from day to night. Granted the only thing that won't change is the direction of dynamic shadows, but everything else could be set up this way.

First off the UV channels for all the objects used in the map would have to be swapped so that your lightmap channel is on chl1 so that you can use the RS file to path to the external BIKs. Then have the colormap as a DDS file in your map's objectlightmaps folder. Only down side to this is additional file size of the map as a result. Similar statics would have different positions and thus each unique static would need it's own lightmap file. There's no global lightmap file for statics like there is for PCOs as far as I can tell. So there will be many redundant copies of the same texture for multiple statics. But the game seems to handle DDS format lightmap files pretty well. However the DDS files can not have any alpha in them. I recall BF1942 crashing when a DDS lightmap had alpha in it. (old long fixed bug with 3DSMax resulted in the non lightmapped areas of the lightmap files (aka the background around all the UV faces in the texture) to be all alpha instead of the normal all black. When I put them ingame like this, I recall getting a CTD. So you can't do this with statics that depend on having alpha in the main texture. :(

PCOs can have lightmaps too. Lightmaps for those however are only stored in the texture/objectlightmaps location. Only difference is the file name does not include position cooridents like normal statics. Thus this will effect any PCO using the geometry template that lightmap's file name is set up for. I would not recommend doing this to any PCO that is mobile or would rotate or change orientation as this would ruin the effect. (lit side would then be facing wrong direction)


Only downside with this is the lack of dynamic shadows updating and having to have a copy of all the statics color maps in each map's RFAs. That's assuming you do this in more then one map though. :P

However don't expect BIKs to stay in sync with ingame elements like rotational bundles. (for example you have a rotating lamp mesh or something and want it to rotate in synce with the animated BIKs). They can never stay in sync with ingame elements as BIKs animate even when the game is paused. BIKs also slow down/lag a bit during ingame activity as the game prioritizes ingame performance over that of the BIKs. (thus the reason why BIKs can't be used as loading screens to add map specific load screen music) Even if the game was never paused, any rotational bundles set up to cast light via this method can never stay in sync with BIKs.

Thus the best route is to limit this to things that won't rotate or have the rotation done in the BIKs them selves so that it appears to be rotating. (like for example it would work with a police siren light only if the light inside the plastic cover is depicted as a texture and not as a actual mesh inside the light dome. If it's a mesh it would then need to rotate and thus can't stay in sync with the BIKs. So the best route is to remove the actual light fixture mesh and have the light dome depict a 2D version of it instead and the rotation would then be achieved via BIKs which you say are always in sync with other BIKs. :D
ImageImageImage
I have cameras in your head!
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Animated textures discussion

Post by fo0k »

Yeah I think this is really not practical for a normal, full conquest style map. It could certainly work for a small, close (interior only) combat knife/pistol type setup though. The game does begin to lag when using bik for terrain, sky and objects (I gave a lightning attempt a go.. It worked.. but you could feel the choppy framerate starting to happen so its simply not going to work. (well.. maybe in 20 years when we are old but have machines that will eat it up! heheh).

so.. if I swap over colour map and lightmap like you said it still looks the same?? I assumed the game treated the lightmap channel differently so would not look correct.

That is huge news :) Currently squashing an entire model into a single texture like this ruins the detail of the texture. I recall talking about having bik lightmaps before but don't remember this swapping as being a solution.. it sounds ideal.

I slapped on a few textures and included bump maps too.. The result was good.. (but would be vastly better with the technique above)

Also agree that having the light source being part of the animation is much better.. I included a very rudimentary attempt here too with another light just pointing back and rotating around.


10mb gif
the bump maps certainly add some substance to it all.. also in-game recording below

Image
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Animated textures discussion

Post by Apache Thunder »

Have you found a way of getting lights to "flicker" in 3DSMax as part of animation? Setting up lights so they rotate via animation etc is one thing, but flickering is something I am unsure of. I want to give this animated lightmap thing a try at some point. Specificially with my good ol' DC Sea Rigs map. I want some of the interior lights to flicker. :D
ImageImageImage
I have cameras in your head!
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Animated textures discussion

Post by fo0k »

heheh, actually I keep thinking about your DC rigs stuff as being puuurfect for this.

flickering lights.. you can keyframe the intensity/multiplier.. :)
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Animated textures discussion

Post by Apache Thunder »

Haha nice! I shall indeed. I may try and find some light hum sound effects and place them near the lights for added ambient effect. :D
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Animated textures discussion

Post by Swaffy »

Both of you should try to get a job at DICE. Be a texturer.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Animated textures discussion

Post by fo0k »

Heheh, appreciate the compliment :)
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Animated textures discussion

Post by Apache Thunder »

Success! The UVMap swap works wonderfully.

I've gotten my buoy lights in Perilous Port to flash on and off:


Though tricky to do. In Max 7, you need to save the chl1 uvmap to a file, then switch to chl3 uvmap, select all the faces in the UVMap editor -> Copy to clipboard via CTRL+C or via edit menu then switch back to chl1 and select all faces in editor and then CTRL+V or EDIT -> Paste to paste in the uvmap overwriting the old one.

Then to get your chl1 uvmap on chl3, create a second unwrap modifier (switching channels on the existing one will cause you to lose your changes on the chl3 uvmap! Must be done on a second modifier) and switch to chl3 uvmap. Then load the uvmap file you saved so that it overwrites the chl3 uvmap with the one you saved to a file prior to copying the chl3 uvmap to chl1. Now right click one of the modifiers and hit "Collapse All" to make the changes permanent and re-export the object with lightmap option checked.

Now your lightmap file in the map rfa will be the object's main texture and the file the RS file for the mesh loads will be your lightmap. Now you can have the game path to the BIK video and use as your lightmap for the object. :D
ImageImageImage
I have cameras in your head!
Post Reply