Urban Terror Forums: Animated Shaders (gif) - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Animated Shaders (gif) Rate Topic: -----

#11 User is offline   Kolossus Icon

  • Account: kolossus
  • Joined: 28-September 10
  • Posts: 386

Posted 27 June 2014 - 10:26 PM

I was reading the documentation you linked, but I still don't know what these things do. I can try changing the numbers and compiling (sigh) just to see what happens but that's going to take some time. :P

#12 User is offline   JRandomNoob Icon

  •   moderator   
    Community Moderator

Posted 30 June 2014 - 03:49 PM

Sorry for not responding earlier, I had to figure it out first and I’m lazy:-P

Example shader for 10-frame animation:

textures/ut4_mymap/test
{
qer_editorimage textures/ut4_mymap/test1
{
animMap 10 textures/ut4_mymap/test1 textures/ut4_mymap/test3 textures/ut4_mymap/test5 textures/ut4_mymap/test7 textures/ut4_mymap/test9
blendFunc GL_ONE GL_ONE
rgbGen wave triangle 1 1 0 10
}
{
animMap 10 textures/ut4_mymap/test2 textures/ut4_mymap/test4 textures/ut4_mymap/test6 textures/ut4_mymap/test8 textures/ut4_mymap/test10
blendFunc GL_ONE GL_ONE
rgbGen wave triangle 1 1 0.5 10
}
}


When editing an existing shader you can leave the rgbGen wave lines mostly unchanged. What matters for this application is the third number, 0 in the first and 0.5 in the second stage — this is the phase. 0.5 time-shifts the second stage by half (when the first stage is at maximum, the second is at minimum, and vice versa). You can use more than just two stages, although three of them would go out of sync (0.333… × 3 does not equal 1).

Note the numbering of the images — the frames are drawn in an alternating order.

Also: You don’t have to recompile to see the changes you’ve made in a shader, unless the shader affects lighting or has physical properties like nonsolid or water. Just reloading the map will suffice.
dswp.de
Beginner’s Guide to Urban Terror (woefully out of date)
Daily Deadnade (Last updated September 9, 2016)

#13 User is offline   Kolossus Icon

  • Account: kolossus
  • Joined: 28-September 10
  • Posts: 386

Posted 30 June 2014 - 04:31 PM

Thank you very much! Don't worry, we all have priorities. :D

So basically if the first series is A and the second is B, the shader does ABABABABAB? I mean, since the images are alternating.

I made a gif of 16 frames, I'll try to fix the code now and see what happens.

#14 User is offline   Iye Icon

  •   head moderator   
    Co-Chief Community Moderator
  • Account: iye
  • Country:
  • Joined: 07-June 11
  • Posts: 1,054

Posted 02 July 2014 - 01:42 PM

the idea is that you have two layers showing 5 frames in a cycle each.
then you blend them into eachother by changing the alpha value of the whole channel. (thats what the rgbgen does here) the 1 and .5 are offsets at start (phase) means the first layer will be shown and the dissappear, while the second layer appears.
you could also use sin or square but square wont look good for the blending on lower frequencies.

basically the sequence here is a_1 , b_1 , a_2 , b_2,...

to add frames you can just add them to the layers (in the correct order)
this will add your frames, lower the view time per frame.
(doesnt really matter in ost cases)

This post has been edited by Iye: 02 July 2014 - 01:46 PM

Sorry for my bad spelling - I am still asleep. :)

|=| Iye's UrT Addon |=| Firefox Personas |=| Maps |=|
http://www.mediafire...vk3a602hcfg.jpg

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Advertisement


Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942