Page 1 of 1

Shader Help

Posted: Sun Feb 05, 2012 2:15 pm
by xandaxs
Hey Guys!

I've this on a skybox texture:

Code: Select all

textures/skies/hip_grimm
{
   qer_editorimage env/hip_grimm/grimmnight_ft.tga

   q3map_lightsubdivide 768
   q3map_backsplash 0 0

   q3map_sunEXT .192 .191 .181 25 0 23 3 16
   q3map_skylight 100 3
   q3map_lightmapFilterRadius 0 8

   q3map_noFog
   
   surfaceparm sky
   surfaceparm noimpact
   surfaceparm nolightmap
   surfaceparm nodlight
   
   skyparms env/hip_grimm/grimmnight - -
   
   nopicmip
   nomipmaps
     {
      map env/hip_grimm/clouds.tga
      tcMod scale 4 4
      tcMod scroll 0.012 0.012
      blendFunc GL_ONE GL_ONE
   }
     {
      animMap .2 env/hip_grimm/thunderbolt_1.tga textures/lotr_textures/black.tga textures/lotr_textures/black.tga env/hip_grimm/thunderbolt_2.tga env/hip_grimm/thunderbolt_3.tga textures/lotr_textures/black.tga  textures/lotr_textures/black.tga
      blendFunc add
      rgbGen identity
      rgbGen wave Sin 0 1 0 1.1

   }
}


The skybox has moving clouds and some thunder lightnings showing up from time to time.
My problem is those thunders last longer than I need (more or less 6/7 seconds atm).

I want to make them come faster one after the others, how can I do that?
(does it have to do with the sin function?)

The Thunder part is below:

Code: Select all

     {
      animMap .2 env/hip_grimm/thunderbolt_1.tga textures/lotr_textures/black.tga textures/lotr_textures/black.tga env/hip_grimm/thunderbolt_2.tga env/hip_grimm/thunderbolt_3.tga textures/lotr_textures/black.tga  textures/lotr_textures/black.tga
      blendFunc add
      rgbGen identity
      rgbGen wave Sin 0 1 0 1.1

   }

Re: Shader Help

Posted: Mon Mar 05, 2012 5:58 am
by ailmanki
AnimMap <frequency> <texture1> ... <texture8>
The surfaces in the game can be animated by displaying a sequence of 1 to 8 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.

<Frequency>: the number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.

<texture1> ... <texture8>: the texturepath/texture name for each animation frame must be explicitly listed. Up to eight frames (eight separate .tga files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.


you set it to 0.2, that means it takes 5 seconds to go through your 7 frames. It takes about ~20ms for the lighning to happen. And apparently another 40-80ms for another lightning. So lets say 100ms for your 7 frames. So actually to get 100ms for that cycle you need to set frequency to 10. But well thats just the maths. No idea how that will look like.

Re: Shader Help

Posted: Mon Mar 05, 2012 7:31 am
by xandaxs
It's already fixed, long ago..
But thank you man!