Fading Values: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(removed spam)
Line 1: Line 1:
[http://activeimage.c3.hu/css/jhdsew.html prevacid generic] [http://www.stillwaterhomes.com/listings/images/pic/qcfxmm.html equality commission for northern ireland] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/qnvxti.html yoga shorts] [http://www.olemissfans.com/chatpro/image/kcqjir.html red morning glory] [http://www.easypayinfo.com/subscribe/tmp/somqvp.html slownik polsko angielski] [http://ndr.hu/rhodes/jmqejq.html the daily eastern news] [http://www.stillwaterhomes.com/listings/images/pic/iurcfx.html jackson sports] [http://www.plurpage.com/classifieds/cache/fissql.html accident interstate 75] [http://www.salona-yachts.eu/misc/tbbkmb.html the tower theater philadelphia] [http://www.plurpage.com/classifieds/cache/tcwwep.html rude humor pictures] [http://activeimage.c3.hu/css/rlwopl.html train travel virgin] [http://activeimage.c3.hu/css/gmcupn.html array initializer java] [http://activeimage.c3.hu/css/ugtsbj.html theatre jobs in ireland] [http://www.olemissfans.com/chatpro/image/okhqvw.html acrage for sale in texas] [http://activeimage.c3.hu/css/bgdhpc.html sony t630 software] [http://troniny.ovh.org/gallery/layout/oorldb.html philips bulbs] [http://www.olemissfans.com/chatpro/image/lpxvmo.html technique vehicle search] [http://www.lowell.edu/styles/old_style/css/hhegxi.html cipro] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/tffuxl.html tintin images] [http://www.salona-yachts.eu/misc/lbuljc.html slide film scanner] [http://ndr.hu/rhodes/vualqu.html nas server comparison] [http://www.salona-yachts.eu/misc/cmagrm.html lou reed cover] [http://www.easypayinfo.com/subscribe/tmp/cwbmsg.html phone from morocco] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/jdxhua.html after dark mac os x] [http://ndr.hu/rhodes/wvrjtl.html army of the night] [http://www.farmelco.hu/test/css/jnjklk.html love to] [http://ndr.hu/rhodes/vwwkbf.html life saving steps] [http://kom-pas.de/3xcms/config/hkatuploads/images/gtiijc.html after dark collection review] [http://www.systemsupport.und.edu/cache/avatars/emo/roksxt.html phone ringtones] [http://www.easypayinfo.com/subscribe/tmp/nmtqrm.html king david family tree] [http://www.olemissfans.com/chatpro/image/srmknn.html 70s toys] [http://kom-pas.de/3xcms/config/hkatuploads/images/jfjpjs.html jobs boston mass] [http://www.stillwaterhomes.com/listings/images/pic/uhqjks.html teamwork skills list] [http://ndr.hu/rhodes/vprqdj.html usb digital tv box] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/qvcqit.html kit homes in scotland] [http://www.plurpage.com/classifieds/cache/wawmre.html leather couch sale] [http://troniny.ovh.org/gallery/layout/bulsfe.html pro shot lasers] [http://activeimage.c3.hu/css/jawhst.html new york state public record] [http://aura.c3.hu/thumb/hiwpto.html east hampton apartments] [http://www.stillwaterhomes.com/listings/images/pic/lihxbc.html widespread disease] [http://www.easypayinfo.com/subscribe/tmp/exfxom.html medicine career information] [http://www.housing.und.edu/reshalls/blog/wp-content/uploads/2007/04/img/kbqahe.html discount zocor] [http://www.olemissfans.com/chatpro/image/fgxwxb.html ice cream scoopers] [http://kom-pas.de/3xcms/config/hkatuploads/images/hwmcic.html online translation german english] [http://www.easypayinfo.com/subscribe/tmp/lvmqrk.html white lilies island] [http://troniny.ovh.org/gallery/layout/kvwwta.html time in alice springs] [http://aura.c3.hu/thumb/rkcjuh.html school and assignment and book] [http://www.lowell.edu/styles/old_style/css/nfbvht.html night in vegas] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/wgoned.html local movie theater guide] [http://informer.siam.edu/themes/hm/gfjdvr.html alltel ringtone] [http://www.plurpage.com/classifieds/cache/ekjrrv.html medical technology system] [http://informer.siam.edu/themes/hm/qhskom.html cyclobenzaprine] [http://www.plurpage.com/classifieds/cache/lbogdp.html using tapi] [http://www.stillwaterhomes.com/listings/images/pic/ucrdsq.html applying law school] [http://www.easypayinfo.com/subscribe/tmp/olajeb.html what are phosphates] [http://activeimage.c3.hu/css/ivrbuh.html 1010 canada distance long] [http://activeimage.c3.hu/css/fxpqre.html e commerce site builders] [http://www.olemissfans.com/chatpro/image/mpqten.html mo better blues review] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/rvehhx.html exclusivity contract sample] [http://2001.c3.hu/mas/ahfbrp.html im alright] [http://www.stillwaterhomes.com/listings/images/pic/sittfe.html ap 1000 default ip] [http://ndr.hu/rhodes/ohwhbb.html american murder rate] [http://kom-pas.de/3xcms/config/hkatuploads/images/gshuja.html oreg] [http://www.stillwaterhomes.com/listings/images/pic/jdihfd.html south african department of foreign affairs] [http://informer.siam.edu/themes/hm/xrfpae.html cheap glucophage] [http://www.salona-yachts.eu/misc/qnwiac.html import car canada us] [http://informer.siam.edu/themes/hm/bwnkvr.html provigil] [http://kom-pas.de/3xcms/config/hkatuploads/images/vrwxxi.html naruto manga downloads] [http://informer.siam.edu/themes/hm/etvpvg.html discount propecia] [http://www.stillwaterhomes.com/listings/images/pic/oumcqp.html auto body canadian part] [http://informer.siam.edu/themes/hm/aqoohj.html azithromycin] [http://www.easypayinfo.com/subscribe/tmp/wftusu.html state tax burdens] [http://aura.c3.hu/thumb/ojoiln.html the great lost bear] [http://troniny.ovh.org/gallery/layout/qifrdj.html suisse asset management] [http://www.easypayinfo.com/subscribe/tmp/ugomrd.html reasonable suspicion and probable cause] [http://maps.my2gig.com/cache/qfpplr.html why to date a dancer] [http://troniny.ovh.org/gallery/layout/rkompk.html my all lyrics mariah carey] [http://www.easypayinfo.com/subscribe/tmp/phrotw.html mount saint joes college] [http://aura.c3.hu/thumb/dwaimw.html unload class] [http://www.easypayinfo.com/subscribe/tmp/vxlgcj.html agreement lease property] [http://kom-pas.de/3xcms/config/hkatuploads/images/degkuf.html web access failed] [http://www.easypayinfo.com/subscribe/tmp/qddiaw.html eminem girls lyrics] [http://www.plurpage.com/classifieds/cache/xinxur.html student rush tickets new york] [http://aura.c3.hu/thumb/abkvgd.html espn sports guy] [http://www.easypayinfo.com/subscribe/tmp/avggdq.html kitten care tip] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/ijppal.html new jersey ethanol] [http://2001.c3.hu/mas/trobpg.html site slovenia suggest] [http://www.easypayinfo.com/subscribe/tmp/jeswbx.html tx immunization release form] [http://informer.siam.edu/themes/hm/exttuu.html discount zocor] [http://kom-pas.de/3xcms/config/hkatuploads/images/jugxdu.html reference encyclopedias] [http://www.stillwaterhomes.com/listings/images/pic/mvjmhi.html early intervention programs in new york] [http://kristinlyseggen.com/gallery/1documentaries/7travel/kfvdrs.html pa government law] [http://aura.c3.hu/thumb/vfgxfx.html montar negocio un] [http://maps.my2gig.com/cache/bxshll.html off site backup storage] [http://www.easypayinfo.com/subscribe/tmp/fodvhk.html shelby county high school] [http://www.lowell.edu/styles/old_style/css/awtwlk.html retro ringtone] [http://www.easypayinfo.com/subscribe/tmp/nfoqia.html touch me feel me] [http://maps.my2gig.com/cache/uiqgar.html american standard website] [http://ndr.hu/rhodes/ljtwpj.html psychology masters degree] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/nljhgn.html short love poems in spanish]
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 11:14, 8 November 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.