Fading Values: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Spam Revert)
Line 1: Line 1:
[http://flo-et-dom.downslip.info/ flo et dom] [http://l-426-71.stroam.info/ l 426 71] [http://francoforte.unfeeble.info/ francoforte] [http://wrawler.info/index3_666.html homepage] [http://stroam.info/index7_666.html home] [http://tv-tuner-usb-2-0.unfeeble.info/ tv tuner usb 2 0] [http://the-corss.wrawler.info/ the corss] [http://tekio.misserve.info/ tekio] [http://indulger.info/index9_666.html site] [http://bushnell-powerview-16x32.unfeeble.info/ bushnell powerview 16x32] [http://telo-pvc.stroam.info/ telo pvc] [http://arte-scool.unfeeble.info/ arte scool] [http://misserve.info/index2_666.html url] [http://wonder-boy.downslip.info/ wonder boy] [http://forno-whirpool.misserve.info/ forno whirpool] [http://p4-560.batswing.info/ p4 560] [http://men-sport-gay-foto.indulger.info/ men sport gay foto] [http://router-fax.indulger.info/ router fax] [http://raccontami-francesco-renga.burblers.info/ raccontami francesco renga] [http://man-i-fill-like-a-woman.batswing.info/ man i fill like a woman] [http://hellbound-eminem.unfeeble.info/ hellbound eminem] [http://selif.unfeeble.info/ selif] [http://video-clip-seso.misserve.info/ video clip seso] [http://sacile.downslip.info/ sacile] [http://gig-robot.misserve.info/ gig robot] [http://sulka.indulger.info/ sulka] [http://ziberna.wrawler.info/ ziberna] [http://close-your-eyes.misserve.info/ close your eyes] [http://clk-55-amg.indulger.info/ clk 55 amg] [http://c-builder-6.stroam.info/ c builder 6] [http://gevelsberg.unfeeble.info/ gevelsberg] [http://downslip.info/index7_250.html page] [http://rover-420.batswing.info/ rover 420] [http://tego-caldero-n.indulger.info/ tego caldero n] [http://denim-evisu.wrawler.info/ denim evisu] [http://bgg.burblers.info/ bgg] [http://legge-29-97.batswing.info/ legge 29 97] [http://batswing.info/index4_250.html site] [http://downslip.info/index4_1000.html home] [http://wiso-g.misserve.info/ wiso g] [http://girls-ravenna.stroam.info/ girls ravenna] [http://downslip.info/ downslip.info] [http://dvx-9900.batswing.info/ dvx 9900] [http://behringer-bx1200.misserve.info/ behringer bx1200] [http://batswing.info/index1_666.html url] [http://flow-chart.misserve.info/ flow chart] [http://compaq-nc8000.stroam.info/ compaq nc8000] [http://covers-cd.burblers.info/ covers cd] [http://goleador.batswing.info/ goleador] [http://downslip.info/index3_1000.html homepage] [http://hard-c.indulger.info/ hard c] [http://nem.burblers.info/ nem] [http://air-1942.misserve.info/ air 1942] [http://misserve.info/index3_250.html index] [http://duce.stroam.info/ duce] [http://volkswagen-transporter.indulger.info/ volkswagen transporter] [http://ibm-t43.stroam.info/ ibm t43] [http://video-porn-luly-bosa.wrawler.info/ video porn luly bosa] [http://batswing.info/index6_1000.html page] [http://in-the-shadown.unfeeble.info/ in the shadown] [http://korn.wrawler.info/ korn] [http://teac-80.wrawler.info/ teac 80] [http://bich-life.stroam.info/ bich life] [http://the-grudge2.unfeeble.info/ the grudge2] [http://www-minedu-gob-pe.batswing.info/ www minedu gob pe] [http://onkyo-8511.stroam.info/ onkyo 8511] [http://dance-anni-60.misserve.info/ dance anni 60] [http://sony-gv.burblers.info/ sony gv] [http://unfeeble.info/ unfeeble.info] [http://the-day-after-tomorrow.downslip.info/ the day after tomorrow] [http://pc-woofer.batswing.info/ pc woofer] [http://epson-tw10h.stroam.info/ epson tw10h] [http://tv-lcd-dvi.batswing.info/ tv lcd dvi] [http://adsl2-firewall-router.indulger.info/ adsl2 firewall router] [http://batswing.info/index2_666.html home] [http://indulger.info/index2_250.html home] [http://volvo-gpl.misserve.info/ volvo gpl] [http://sexy-kelis.downslip.info/ sexy kelis] [http://kaljinka.unfeeble.info/ kaljinka] [http://amstrad-tv-14.wrawler.info/ amstrad tv 14] [http://lega-volley.indulger.info/ Lega volley] [http://www-birthay-alarm-com.burblers.info/ www birthay alarm com] [http://m-c-service.burblers.info/ m c service] [http://mac-free-download.stroam.info/ mac free download] [http://mercedes-190-e.indulger.info/ mercedes 190 e] [http://golf-6.stroam.info/ golf 6] [http://world-racing-2.unfeeble.info/ world racing 2] [http://l-30-06-94-n-509.indulger.info/ l 30 06 94 n 509] [http://seo.wrawler.info/ seo] [http://coolpix-5200-nikon.stroam.info/ coolpix 5200 nikon] [http://aepd.downslip.info/ aepd] [http://burblers.info/ burblers.info] [http://ibm-serveraid-6i.downslip.info/ ibm serveraid 6i] [http://sgml.unfeeble.info/ sgml] [http://hedy-lamarr.batswing.info/ hedy lamarr] [http://unfeeble.info/index1_666.html site] [http://hyundai-l72d.indulger.info/ hyundai l72d] [http://downslip.info/index6_666.html url] [http://dec-21.wrawler.info/ dec 21] [http://burblers.info/index6_1000.html site]
This article describes an advanced effect in the [[Source]] engine, used to fade fog between different values, but it can be used for any entity that has a color value to change over time. You might also use that article to shift the Z-plane on a map to reduce the visibility, etc.
This article describes an advanced effect in the [[Source]] engine, used to fade fog between different values, but it can be used for any entity that has a color value to change over time. You might also use that article to shift the Z-plane on a map to reduce the visibility, etc.



Revision as of 17:42, 28 October 2007

This article describes an advanced effect in the Source engine, used to fade fog between different values, but it can be used for any entity that has a color value to change over time. You might also use that article to shift the Z-plane on a map to reduce the visibility, etc.

This trick is quite powerful, as it allows you to alter values that we usually leave static on a map: it would add game immersion.

Entities required

  • logic_relay is perfect to change game values or to abstract the routine. It also makes it much easier to duplicate the effect in other maps.
  • logic_timer is the basis of the effect, this entities is designed for measuring the time ticks.
  • math_counter keeps track of the evolution of the values uppon time for our effect.
  • math_colorblend or math_remap do essentially the same thing: they remap a value based on the input value.

Entity setup

logic_relay
targetname fade_value1
OnTrigger counter SetValue 0
OnTrigger timer 
OnTrigger timer Enable
logic_timer
targetname timer
RefireTime .2
StartDisabled 1
OnTimer counter Add .01
math_counter
targetname counter
max 1
OnHitMax timer Disable
OutValue colorblend InValue
math_colorblend
targetname colorblend
colormin "0 0 0"
colormax "255 255 255"
OutColor env_fog_controller SetColor

Process description

You trigger the logic_relay with another entity, or from the console with ent_fire fade_value1 trigger. This will start the sequence. The logic_relay starts the logic_timer and resets the math_counter. The logic_timer re-fires every .2 seconds, firing its output OnTimer, which adds .01 to the math_counter's stored value. The math_counter outputs its OutValue whenever its value is changed, which is in turn put into the math_colorblend. The math_colorblend takes the input value, which is a range from 0-1, and changes the colors based on that.

This range allows for 100 steps. The values that are setup are a compromise between making the blend really smooth and performance. It's slightly "steppy" because it happens only 5 times a second. It would be a lot smoother if you increased it to happen more often, with less of a step. You could do that by only adding .005 or a smaller value than the default .01.

Once the math_counter hits its maximum value (1) it will fire an output telling the logic_timer to disable. This effectively stops the sequence until the logic_relay is fired again.

OutColor and OutValue outputs both accept a parameter in Hammer, but make sure you do not specify one. The parameter they pass will be dynamically generated by the entity itself.

You can change OutColor on the math_colorblend to target any entity that will accept a color value, and it should work just the same. This entity rig can be further adapted to work with a math_remap, and used to fade between any two values, allowing you to affect the values of pretty much any entity in the game, and change them over time.