Rainbow Texture using VMT

Discussion in 'Mapping Questions & Discussion' started by Noltron200, Feb 25, 2015.

  1. Noltron200

    Noltron200 L1: Registered

    Messages:
    5
    Positive Ratings:
    0
    So I want to make a smooth & slow animated rainbow texture.
    I've tried making an animated texture but the transitions between colors was too jagged.

    So I've done some research and I believe that I can edit $color in the VMT.
    I have a solid white texture as the base, however in the VMT I have the following:

    Code:
    "LightmappedGeneric"
    {
    	"$basetexture" "test/whitetexture"
    
    	$setred 0
    	$setblu 0
    	$setgrn 0
    	$color "{ $setred $setgrn $setblu }"
    
    	Proxies
    	{
    		Sine
    		{
    			resultVar	$setred
    			sineperiod		12
    			timeoffset		0
    			sinemin		0
    			sinemax		255
    		}
    		
    		Sine
    		{
    			resultVar	$setgrn
    			sineperiod		12
    			timeoffset		4
    			sinemin		0
    			sinemax		255
    		}
    
    		Sine
    		{
    			resultVar	$setblu
    			sineperiod		12
    			timeoffset		8
    			sinemin		0
    			sinemax		255
    		}
    	}
    }
    
    Now I know the timing or w/e is probably not a perfect rainbow, but im not seeing any color changes in game. All I see is that solid white texture.

    Anyone have any ideas?
     
  2. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    944
    Positive Ratings:
    922
    Most importantly, do you have DirectX 9 enabled in tf2? Most VMT based effects require that to work.
    I haven't tested this, but i think the easiest way make this is to take a small rainbow texture and just texturescroll it.
    EDIT: I think I understood wrong what you meant. Ignore what I suggested to do.
     
  3. Noltron200

    Noltron200 L1: Registered

    Messages:
    5
    Positive Ratings:
    0
    The thing is I wanted it all to be one solid color at any one given time which would mean scrolling wouldn't quite do the job, but yeah I have DirectX 9 enabled :D

    Thanks for your response tho
     
  4. TMP

    aa TMP Abuser of Site Rules

    Messages:
    948
    Positive Ratings:
    551
    I'm kinda out of it right now, but the first thing I'd think is maybe it's the color of the texture. I would say try with a gray, something with a value of like, 128 (half of it, pure gray).
     
    • Thanks Thanks x 1
  5. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    944
    Positive Ratings:
    922
    I played around with it and came to the conclusion that $color either doesn't work or simply doesn't like real-time changes.

    You can try with the animation variant again by using A TON of 1x1 frames. (And RGB888 uncompressed format)
     
    • Thanks Thanks x 1
  6. Noltron200

    Noltron200 L1: Registered

    Messages:
    5
    Positive Ratings:
    0
    I'm going to mess around a little more with the vtf/vmt just cause I really wanted it to work but it sounds like it probably wont.

    But oh boy 1-color-value-per-frame differences xD
    Sounds like lots of fun. I'll try that when I have more time :)