Jump to content


Photo

Animated Textures


4 replies to this topic

#1 Goldwell

Goldwell

    Team Member

  • Active Developer
  • PipPipPipPip
  • 2031 posts

Posted 19 March 2017 - 03:46 PM

I have a small 5 frame texture that I wish to animate, I was wondering how I would go about this?

 

I tried using a material to do this but it flashes red randomly which obviously doesn't work. Anyway the material is written as follows

animated_test


{
        noshadows
        {
                if ( (time * 24) % 5 == 0 )

                
                map     textures/anim/1
        }
        {
                if ( (time * 24) % 5 == 1 )

                
                map     textures/anim/2
        }
        {
                if ( (time * 24) % 5 == 2 )

                
                map     textures/anim/3
        }
        {
                if ( (time * 24) % 5 == 3 )

                
                map     textures/anim/4
        }
        {
                if ( (time * 24) % 5 == 4 )

                
                map     textures/anim/5
        }
}

If anyone knows a fix to the above or knows of a different way to animate textures I would really appreciate it :)


  • Anderson likes this
The Accountant Series
Part 1: A Noble Home (complete rebuild coming soon) | Part 2: New In town


Lord Edgar Trilogy
Lord Edgar's Bathhouse | Lord Edgar's Disappearance | Lord Edgar's Estate
 
Stand Alone Missions
Spring Cleaning

#2 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1601 posts

Posted 19 March 2017 - 05:09 PM

you can do it with a gui, but you can't have too many as there's a limit to the amount of gui's you can use.


  • Anderson likes this

#3 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4737 posts

Posted 20 March 2017 - 04:54 AM

You have to specify a blend mode. The map command doesn't do anything for itself.

 

So for example:

blend diffusemap
map textures/anim/1

  • Goldwell likes this
FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#4 Goldwell

Goldwell

    Team Member

  • Active Developer
  • PipPipPipPip
  • 2031 posts

Posted 20 March 2017 - 06:46 AM

 

You have to specify a blend mode. The map command doesn't do anything for itself.

 

So for example:

blend diffusemap
map textures/anim/1

 

Oh I see, thanks! :)


The Accountant Series
Part 1: A Noble Home (complete rebuild coming soon) | Part 2: New In town


Lord Edgar Trilogy
Lord Edgar's Bathhouse | Lord Edgar's Disappearance | Lord Edgar's Estate
 
Stand Alone Missions
Spring Cleaning

#5 HMart

HMart

    Member

  • Member
  • PipPip
  • 465 posts

Posted 20 March 2017 - 08:34 PM

You can also use a texture strip like this:

textures/particles/caustics
{
   qer_editorimage textures/particles/causticsstrip_ed.jpg
   noSelfShadow
   translucent
   noShadows
   twosided
   {
      blend add
      map textures/particles/caustics.tga
      scale 1 / 24 , 1  // this is where you define the frames of your texture strip, if i'm remembering correctly 1/24 means 1 image divided by 24 frames
      scroll table32[ time * .2	] , 0  // this animates the frames in this case i used a table to modulate the animation
      rgb 0.1
   }
} 

Or a ROQ video has a texture like this:

video/caustics
{
	nonsolid	
	noimpact	
	nodamage	
	noShadows	
	noSelfShadow
	translucent
	qer_editorimage	textures/editor/video.tga
	{
		name	"Stage 1"
		blend	add
		videomap	loop video/caustics.roq
	}
}

  • Goldwell likes this



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users