|
|
Line 1: |
Line 1: |
| [http://web.archive.org/web/20071205142235/http://softcore-lesbians.lovich.info/ softcore lesbians] [http://web.archive.org/web/20071205142235/melissa-dettwiller.surfle.info/ melissa dettwiller] [http://web.archive.org/web/20071205142235/http://cute-blonds-girls.pyknic.info/ cute blonds girls] [http://web.archive.org/20071205143121/http://move-packing.cubrun.info/ move packing] [http://web.archive.org/20071205143121/mark-ruffalo.strontic.info/ mark ruffalo] [http://web.archive.org/20071205143121/warn-winch.strontic.info/ warn winch] [http://web.archive.org/20071205143121/http://lolita-sex-young.topkick.info/ lolita sex young 14] [http://web.archive.org/20071205143121/http://used-motorcycle.cubrun.info/ used motorcycle price guides] [http://marissa-miller.leonite.info/ marissa miller] [http://chinese-medicine.overwell.info/ chinese medicine] [http://man-forced-to.leonite.info/ man forced to wear panties] [http://web.archive.org/20071205143121/http://cellulites-infection.pinelike.info/ cellulites infection] [http://internet-marketing.pyknic.info/ internet marketing firm virginia] [http://web.archive.org/web/20071205142235/http://acquisition.diadrome.info/ acquisition] [http://web.archive.org/web/20071205142235/http://randmcnally.diadrome.info/ randmcnally] [http://the-bear-necessities.overwell.info/ the bear necessities] [http://web.archive.org/web/20071205142235/web-folders-xp.surfle.info/ web folders xp] [http://web.archive.org/20071205143121/http://lactating-girls.cubrun.info/ lactating girls] [http://web.archive.org/20071205143121/http://dont-phunk-with.pinelike.info/ dont phunk with my heart mp3] [http://web.archive.org/20071205143121/http://miami-dade-county.topkick.info/ miami dade county bail bond] [http://web.archive.org/web/20071205142235/http://vent.leonite.info/ vent] [http://web.archive.org/20071205143121/http://tri-state-rental.pinelike.info/ tri state rental] [http://web.archive.org/web/20071205142235/http://fishes.pyknic.info/ fishes] [http://flasher.overwell.info/ flasher] [http://web.archive.org/web/20071205142235/http://print-shop-8.diadrome.info/ print shop 8] [http://web.archive.org/20071205143121/http://katie-homes.cubrun.info/ katie homes] [http://adult-disney-cartoons.overwell.info/ adult disney cartoons] [http://web.archive.org/20071205143121/http://nino-rota.cubrun.info/ nino rota] [http://web.archive.org/web/20071205142235/alexa-vega-nude.surfle.info/ alexa vega nude] [http://web.archive.org/20071205143121/http://cheerleader.cubrun.info/ cheerleader] [http://kid-dirt-bikes.pyknic.info/ kid dirt bikes] [http://web.archive.org/20071205143121/http://wednesday-13.overwell.info/ wednesday 13] [http://web.archive.org/web/20071205142235/http://white-blood-cells.leonite.info/ white blood cells] [http://newsletter.overwell.info/ newsletter] [http://web.archive.org/web/20071205142235/http://union-pacific-railroad.leonite.info/ union pacific railroad] [http://web.archive.org/web/20071205142235/http://final-fantasy.pyknic.info/ final fantasy 7 xxx] [http://web.archive.org/web/20071205142235/fucking-comics.surfle.info/ fucking comics] [http://web.archive.org/web/20071205142235/http://jukeboxes.diadrome.info/ jukeboxes] [http://web.archive.org/web/20071205142235/http://nike-free.leonite.info/ nike free] [http://corporate-video.pyknic.info/ corporate video production] [http://web.archive.org/20071205143121/http://america-west-airlines.cubrun.info/ america west airlines] [http://web.archive.org/web/20071205142235/http://mustang-horses.pyknic.info/ mustang horses] [http://web.archive.org/20071205143121/http://cedric-the-entertainer.pinelike.info/ cedric the entertainer] [http://acrobat-for-mac.pyknic.info/ acrobat for mac osx] [http://disney-anime.pyknic.info/ disney anime] [http://golf-club-components.overwell.info/ golf club components] [http://web.archive.org/20071205143121/free-mobile.strontic.info/ free mobile ringtone] [http://web.archive.org/20071205143121/http://mushroom-soup-chicken.overwell.info/ mushroom soup chicken breast] [http://web.archive.org/20071205143121/http://agent.cubrun.info/ agent] [http://lesbian-virgins.pyknic.info/ lesbian virgins] [http://web.archive.org/web/20071205142235/http://jimi-hendrix-purple.pyknic.info/ jimi hendrix purple haze] [http://web.archive.org/web/20071205142235/http://naturisme.diadrome.info/ naturisme] [http://web.archive.org/web/20071205142235/http://provident-bank.lovich.info/ provident bank] [http://web.archive.org/web/20071205142235/http://sexy-celebs.diadrome.info/ sexy celebs] [http://hotdogs.pyknic.info/ hotdogs] [http://web.archive.org/20071205143121/http://getting-off.topkick.info/ getting off] [http://web.archive.org/web/20071205142235/shaman.surfle.info/ shaman] [http://web.archive.org/web/20071205142235/http://marine-vessel.leonite.info/ marine vessel emissions] [http://lifelong-learning.overwell.info/ lifelong learning] [http://feather-fans.leonite.info/ feather fans] [http://web.archive.org/20071205143121/http://ecommerce-site.overwell.info/ ecommerce site design] [http://web.archive.org/20071205143121/http://black-men.cubrun.info/ black men] [http://web.archive.org/20071205143121/http://flashyourrack.overwell.info/ flashyourrack] [http://web.archive.org/20071205143121/http://euro-2004.topkick.info/ euro 2004] [http://web.archive.org/20071205143121/http://sugar-daddy.cubrun.info/ sugar daddy] [http://ushers-yeah-song.leonite.info/ ushers yeah song] [http://web.archive.org/20071205143121/http://free-reverse-cell.topkick.info/ free reverse cell phone number search] [http://web.archive.org/web/20071205142235/http://colorado-state.pyknic.info/ colorado state jobs] [http://web.archive.org/web/20071205142235/http://cedar-city-ut.diadrome.info/ cedar city ut real estate] [http://web.archive.org/20071205143121/miyavi.strontic.info/ miyavi] [http://web.archive.org/20071205143121/face-sit-smother.strontic.info/ face sit smother] [http://web.archive.org/20071205143121/http://nebraska-furniture.topkick.info/ nebraska furniture] [http://web.archive.org/20071205143121/solar-flare.strontic.info/ solar flare] [http://fashion-show.leonite.info/ fashion show] [http://gay-studs.pyknic.info/ gay studs] [http://mature-latina.leonite.info/ mature latina girls] [http://web.archive.org/20071205143121/http://muhammad-ali-storys.cubrun.info/ muhammad ali storys] [http://shirt-no-bra.pyknic.info/ shirt no bra] [http://web.archive.org/20071205143121/http://school-rape.pinelike.info/ school rape] [http://jukebox.leonite.info/ jukebox] [http://web.archive.org/20071205143121/http://vegas-bachelorette.pinelike.info/ vegas bachelorette party] [http://web.archive.org/20071205143121/http://lap-tops.cubrun.info/ lap tops] [http://web.archive.org/web/20071205142235/discount-shopping.surfle.info/ discount shopping online] [http://web.archive.org/web/20071205142235/http://merriam-webster.leonite.info/ merriam webster] [http://annapolis-fishing.leonite.info/ annapolis fishing boat rental] [http://web.archive.org/20071205143121/http://hip-hop-video.cubrun.info/ hip hop video model] [http://web.archive.org/web/20071205142235/http://pholadelphia-auto.lovich.info/ pholadelphia auto show] [http://web.archive.org/web/20071205142235/http://reverse-cell-phone.diadrome.info/ reverse cell phone number directory] [http://web.archive.org/20071205143121/http://bears.pinelike.info/ bears] [http://web.archive.org/20071205143121/free-gay-cowboy.strontic.info/ free gay cowboy] [http://valley-fair.overwell.info/ valley fair] [http://web.archive.org/20071205143121/http://bio.topkick.info/ bio] [http://web.archive.org/20071205143121/http://dnd.pinelike.info/ dnd] [http://web.archive.org/20071205143121/http://taux-euribor.overwell.info/ taux euribor] [http://web.archive.org/20071205143121/http://sonny-and-cher.cubrun.info/ sonny and cher] [http://nudist-camp-naturist.overwell.info/ nudist camp naturist] [http://web.archive.org/20071205143121/http://eager-beaver.topkick.info/ eager beaver] [http://web.archive.org/web/20071205142235/http://aliso-viejo.lovich.info/ aliso viejo california real estate] [http://web.archive.org/20071205143121/http://sourcing.topkick.info/ sourcing] [http://web.archive.org/web/20071205142235/http://carribean-cruise.lovich.info/ carribean cruise] [http://web.archive.org/web/20071205142235/http://saddam-rifle-into.lovich.info/ saddam rifle into the air video] [http://extreme-motor-sports.leonite.info/ extreme motor sports] [http://north-western.overwell.info/ north western train timetables] [http://forum.pyknic.info/ forum] [http://lil.leonite.info/ lil] [http://web.archive.org/20071205143121/http://broadband.pinelike.info/ broadband] [http://web.archive.org/web/20071205142235/http://lettering.leonite.info/ lettering] [http://fist-fucking.overwell.info/ fist fucking free] [http://web.archive.org/web/20071205142235/http://costa-rico.pyknic.info/ costa rico] [http://web.archive.org/web/20071205142235/http://love-hina-doujinshi.diadrome.info/ love hina doujinshi] [http://web.archive.org/20071205143121/teen-boy-cum.strontic.info/ teen boy cum] [http://web.archive.org/20071205143121/http://gang-fucking.topkick.info/ gang fucking] [http://web.archive.org/20071205143121/http://web-browser-statistics.cubrun.info/ web browser statistics 2005] [http://web.archive.org/20071205143121/guitar-notes.strontic.info/ guitar notes] [http://web.archive.org/20071205143121/http://caribbean-lots.pinelike.info/ caribbean lots] [http://brazilian-wax.pyknic.info/ brazilian wax job] [http://web.archive.org/20071205143121/http://naked-on-beach.topkick.info/ naked on beach] [http://web.archive.org/web/20071205142235/http://women-tits.leonite.info/ women tits] [http://web.archive.org/20071205143121/the-grudge.strontic.info/ the grudge] [http://web.archive.org/web/20071205142235/http://anal-sex-positions.lovich.info/ anal sex positions] [http://web.archive.org/web/20071205142235/http://short-hair-formal.diadrome.info/ short hair formal style] [http://nfl-football-tickets.leonite.info/ nfl football tickets] [http://web.archive.org/web/20071205142235/http://computer-clipart.leonite.info/ computer clipart] [http://web.archive.org/web/20071205142235/http://the-raffles-hotel.diadrome.info/ the raffles hotel] [http://web.archive.org/web/20071205142235/http://recipe-for-making.pyknic.info/ recipe for making pork sausage] [http://web.archive.org/20071205143121/http://sex-xxx.topkick.info/ sex xxx] [http://web.archive.org/20071205143121/episode-iii-star.strontic.info/ episode iii star wars] [http://web.archive.org/20071205143121/paintball-supply.strontic.info/ paintball supply company] [http://web.archive.org/20071205143121/http://woman.topkick.info/ woman] [http://web.archive.org/web/20071205142235/peer-to-peer-file.surfle.info/ peer to peer file sharing] [http://web.archive.org/web/20071205142235/affordable-domain.surfle.info/ affordable domain name registration] [http://web.archive.org/web/20071205142235/http://beyonce-fucking.pyknic.info/ beyonce fucking] [http://web.archive.org/web/20071205142235/http://waterfalls.leonite.info/ waterfalls] [http://web.archive.org/20071205143121/http://ghost-photos.overwell.info/ ghost photos] [http://web.archive.org/20071205143121/http://health-and-beauty.cubrun.info/ health and beauty aids] [http://teal-fabrics.pyknic.info/ teal fabrics] [http://web.archive.org/web/20071205142235/http://gaucho-pants.pyknic.info/ gaucho pants] [http://web.archive.org/web/20071205142235/http://jude-laws-penis.lovich.info/ jude laws penis pictures] [http://fucking-housewife.leonite.info/ fucking housewife] [http://web.archive.org/20071205143121/http://landscape-architecture.overwell.info/ landscape architecture] [http://nasty-cops.leonite.info/ nasty cops] [http://web.archive.org/web/20071205142235/http://real-teen.leonite.info/ real teen] [http://web.archive.org/web/20071205142235/http://curious-about.leonite.info/ curious about threesomes] [http://web.archive.org/20071205143121/http://used-tractors.topkick.info/ used tractors] [http://web.archive.org/20071205143121/unable-to-resolve.strontic.info/ unable to resolve anything] [http://web.archive.org/20071205143121/american-heart.strontic.info/ american heart association diet] [http://web.archive.org/20071205143121/http://breast-augmentations.topkick.info/ breast augmentations] [http://web.archive.org/web/20071205142235/http://all-inclusive-vacation.leonite.info/ all inclusive vacation] [http://web.archive.org/web/20071205142235/http://saltwater-lighting.leonite.info/ saltwater lighting] [http://web.archive.org/web/20071205142235/http://medical-billing.diadrome.info/ medical billing software prices] [http://web.archive.org/20071205143121/http://www-witch-com.cubrun.info/ www witch com] [http://beautiful-german.leonite.info/ beautiful german girls] [http://roadway-express.leonite.info/ roadway express] [http://web.archive.org/20071205143121/fone-finder.strontic.info/ fone finder] [http://web.archive.org/web/20071205142235/why-are-barns.surfle.info/ why are barns] [http://web.archive.org/web/20071205142235/preteen-bbs-gateway.surfle.info/ preteen bbs gateway] [http://girls-legs-wide.pyknic.info/ girls legs wide open] [http://porno-star.leonite.info/ porno star] [http://web.archive.org/20071205143121/polycythemia.strontic.info/ polycythemia] [http://shylolita-sex.pyknic.info/ shylolita sex] [http://preteens-top-girl.overwell.info/ preteens top girl model] [http://australian-escorts.pyknic.info/ australian escorts forum] [http://mail-security.overwell.info/ mail security 8100] [http://web.archive.org/20071205143121/free-nude-videos.strontic.info/ free nude videos] [http://web.archive.org/web/20071205142235/http://naked-muscular.pyknic.info/ naked muscular men] [http://web.archive.org/web/20071205142235/http://babe-sex.leonite.info/ babe sex] [http://web.archive.org/20071205143121/http://star-trek-fakes.pinelike.info/ star trek fakes] [http://web.archive.org/web/20071205142235/http://free-football.lovich.info/ free football games to play] [http://web.archive.org/20071205143121/http://slut-wifes.pinelike.info/ slut wifes] [http://web.archive.org/20071205143121/organ-donation.strontic.info/ organ donation] [http://web.archive.org/web/20071205142235/antivirus-free.surfle.info/ antivirus free] [http://web.archive.org/web/20071205142235/http://we-were-soldiers.lovich.info/ we were soldiers] [http://web.archive.org/web/20071205142235/http://wide-open-vaginas.leonite.info/ wide open vaginas] [http://web.archive.org/20071205143121/http://titanium-dioxide.cubrun.info/ titanium dioxide] [http://web.archive.org/20071205143121/swim-goggles.strontic.info/ swim goggles] [http://sex-in-a-car.overwell.info/ sex in a car] [http://web.archive.org/20071205143121/http://memoirs-of-a-geisha.cubrun.info/ memoirs of a geisha] [http://family-guy-xxx.overwell.info/ family guy xxx] [http://web.archive.org/20071205143121/http://free-virtual-sex.pinelike.info/ free virtual sex] [http://dalmatian.pyknic.info/ dalmatian] [http://web.archive.org/20071205143121/http://two-cocks.topkick.info/ two cocks] [http://web.archive.org/web/20071205142235/http://baby-cribs.pyknic.info/ baby cribs] [http://web.archive.org/20071205143121/http://exposure.cubrun.info/ exposure] [http://wrecked-harleys.overwell.info/ wrecked harleys] [http://web.archive.org/20071205143121/product-reviews.strontic.info/ product reviews] [http://kristen.pyknic.info/ kristen] [http://web.archive.org/web/20071205142235/http://lyrics-to-story.leonite.info/ lyrics to story of my life] [http://web.archive.org/web/20071205142235/http://gingseng.pyknic.info/ gingseng] [http://web.archive.org/web/20071205142235/http://neve-campbell.lovich.info/ neve campbell nude] [http://web.archive.org/web/20071205142235/http://its-like-magic.lovich.info/ its like magic lyrics] [http://web.archive.org/20071205143121/office-xp-easter.strontic.info/ office xp easter eggs] [http://web.archive.org/web/20071205142235/http://last-minute-cruises.leonite.info/ last minute cruises] [http://web.archive.org/20071205143121/http://pantys.topkick.info/ pantys] [http://web.archive.org/web/20071205142235/cd-cases.surfle.info/ cd cases] [http://web.archive.org/web/20071205142235/http://mini-ipod.lovich.info/ mini ipod] [http://anh-khoa-than.overwell.info/ anh khoa than vietnam] [http://ricky-martin.pyknic.info/ ricky martin mp3] [http://web.archive.org/web/20071205142235/http://red-knuckles.pyknic.info/ red knuckles] [http://web.archive.org/20071205143121/http://sexual-fantasy.cubrun.info/ sexual fantasy] [http://tropical-bedding.leonite.info/ tropical bedding]
| | [[Image:garry_motionblur.jpg|thumb]] |
| [[Image:garry_motionblur.jpg|thumb]] | | |
| ==Introduction== | | ==Introduction== |
| Here's something that is in Garry's Mod: '''Motion Blur'''. This method doesn't use any shaders and will therefore work on most graphic cards. | | Here's something that is in Garry's Mod: '''Motion Blur'''. This method doesn't use any shaders and will therefore work on most graphic cards. |
Line 7: |
Line 7: |
|
| |
|
| == Creating a new Render Target == | | == Creating a new Render Target == |
|
| |
| Open the file src/cl_dll/rendertexture.cpp, and above the Power of Two Frame Buffer Texture add: | | Open the file src/cl_dll/rendertexture.cpp, and above the Power of Two Frame Buffer Texture add: |
|
| |
|
Line 37: |
Line 36: |
|
| |
|
| == Rendering the Motion Blur == | | == Rendering the Motion Blur == |
|
| |
| First of all, console commands need to be added so they can be used. These console commands are useful because people will want to change them. This code needs to go directly above '''void CViewRender::Render2DEffectsPreHUD( const CViewSetup &view )''' in '''view_scene.cpp'''. | | First of all, console commands need to be added so they can be used. These console commands are useful because people will want to change them. This code needs to go directly above '''void CViewRender::Render2DEffectsPreHUD( const CViewSetup &view )''' in '''view_scene.cpp'''. |
|
| |
|
Line 168: |
Line 166: |
| </pre> | | </pre> |
|
| |
|
| == Single Player == | | == Single-player == |
| | |
| If you're working on a Single Player Mod, you may have found that the front buffer wont update on a map change, or player death, this is because when you change the map, the gpGlobals->curtime variable resets to 0.0 seconds, but your fNextDrawTime retains its value. | | If you're working on a Single Player Mod, you may have found that the front buffer wont update on a map change, or player death, this is because when you change the map, the gpGlobals->curtime variable resets to 0.0 seconds, but your fNextDrawTime retains its value. |
|
| |
|
Line 189: |
Line 186: |
| <pre>if( gpGlobals->curtime >= fNextDrawTime ) </pre> | | <pre>if( gpGlobals->curtime >= fNextDrawTime ) </pre> |
|
| |
|
| == Material Files == | | == Material files == |
| | |
| That should do it. You need to add a material file called '''frontbuffer.vmt''' in your materials folder - although you could probably use an existing one. Here's an example: | | That should do it. You need to add a material file called '''frontbuffer.vmt''' in your materials folder - although you could probably use an existing one. Here's an example: |
|
| |
|
Line 199: |
Line 195: |
| } | | } |
|
| |
|
| [[Category:Camera]][[Category:Programming]] | | [[Category:Camera]] |
| | [[Category:Programming]] |
| [[Category:Tutorials]] | | [[Category:Tutorials]] |
Introduction
Here's something that is in Garry's Mod: Motion Blur. This method doesn't use any shaders and will therefore work on most graphic cards.
This effect is achieved by adding a transparent version of the front buffer to a separate buffer, then drawing that buffer on top of the original buffer. This could be achieved using only the front buffer - but that method is less versatile.
Creating a new Render Target
Open the file src/cl_dll/rendertexture.cpp, and above the Power of Two Frame Buffer Texture add:
static CTextureReference s_pMotionBlurTex0;
ITexture *GetMotionBlurTex0( void )
{
if( !s_pMotionBlurTex0 )
{
s_pMotionBlurTex0.InitRenderTarget( 256, 256, RT_SIZE_FULL_FRAME_BUFFER,
IMAGE_FORMAT_ARGB8888, MATERIAL_RT_DEPTH_NONE, false );
Assert( !IsErrorTexture( s_pMotionBlurTex0 ) );
}
return s_pMotionBlurTex0;
}
This is the function that will be used to get a pointer to the render target. The '256' numbers are meaningless, they get overridden by RT_SIZE_FULL_FRAME_BUFFER which forces the texture to be the size of the frame buffer.
So now in the file src/cl_dll/rendertexture.h directly under #define RENDERTARGETS_H add:
ITexture *GetMotionBlurTex0( void );
This will allow you to use this function.
Rendering the Motion Blur
First of all, console commands need to be added so they can be used. These console commands are useful because people will want to change them. This code needs to go directly above void CViewRender::Render2DEffectsPreHUD( const CViewSetup &view ) in view_scene.cpp.
// To toggle the blur on and off
ConVar pp_motionblur("pp_motionblur", "1", 0, "Motion Blur");
// The amount of alpha to use when adding the FB to our custom buffer
ConVar pp_motionblur_addalpha("pp_motionblur_addalpha", "0.1", 0, "Motion Blur Alpha");
// The amount of alpha to use when adding our custom buffer to the FB
ConVar pp_motionblur_drawalpha("pp_motionblur_drawalpha", "1", 0, "Motion Blur Draw Alpha");
// Delay to add between capturing the FB
ConVar pp_motionblur_time("pp_motionblur_time", "0.05", 0, "The amount of time to wait until updating the FB");
Directly under the console commands add this code.
void CViewRender::DoMotionBlur( void )
{
if ( pp_motionblur.GetInt() == 0 ) return;
static float fNextDrawTime = 0.0f;
bool found;
IMaterialVar* mv = NULL;
IMaterial *pMatScreen = NULL;
ITexture *pMotionBlur = NULL;
ITexture *pOriginalTexture = NULL;
// Get the front buffer material
pMatScreen = materials->FindMaterial( "frontbuffer", TEXTURE_GROUP_OTHER, true );
// Get our custom render target
pMotionBlur = GetMotionBlurTex0();
// Store the current render target
ITexture *pOriginalRenderTarget = materials->GetRenderTarget();
// Set the camera up so we can draw the overlay
int oldX, oldY, oldW, oldH;
materials->GetViewport( oldX, oldY, oldW, oldH );
materials->MatrixMode( MATERIAL_PROJECTION );
materials->PushMatrix();
materials->LoadIdentity();
materials->MatrixMode( MATERIAL_VIEW );
materials->PushMatrix();
materials->LoadIdentity();
if( gpGlobals->curtime >= fNextDrawTime )
{
UpdateScreenEffectTexture( 0 );
// Set the alpha to whatever our console variable is
mv = pMatScreen->FindVar( "$alpha", &found, false );
if (found)
{
if ( fNextDrawTime == 0 )
{
mv->SetFloatValue( 1.0f );
}
else
{
mv->SetFloatValue( pp_motionblur_addalpha.GetFloat() );
}
}
materials->SetRenderTarget( pMotionBlur );
materials->DrawScreenSpaceQuad( pMatScreen );
// Set the next draw time according to the convar
fNextDrawTime = gpGlobals->curtime + pp_motionblur_time.GetFloat();
}
// Set the alpha
mv = pMatScreen->FindVar( "$alpha", &found, false );
if (found)
{
mv->SetFloatValue( pp_motionblur_drawalpha.GetFloat() );
}
// Set the texture to our buffer
mv = pMatScreen->FindVar( "$basetexture", &found, false );
if (found)
{
pOriginalTexture = mv->GetTextureValue();
mv->SetTextureValue( pMotionBlur );
}
// Pretend we were never here, set everything back
materials->SetRenderTarget( pOriginalRenderTarget );
materials->DrawScreenSpaceQuad( pMatScreen );
// Set our texture back to _rt_FullFrameFB
if (found)
{
mv->SetTextureValue( pOriginalTexture );
}
materials->DepthRange( 0.0f, 1.0f );
materials->MatrixMode( MATERIAL_PROJECTION );
materials->PopMatrix();
materials->MatrixMode( MATERIAL_VIEW );
materials->PopMatrix();
}
This should all make sense.
Now add this to just before // Draw the 2D graphics at around line 3540 in view_scene.cpp
DoMotionBlur();
Open up view_scene.h and put this at the end of file before #endif // VIEW_SCENE_H
inline void UpdateScreenEffectTexture( int textureIndex )
{
ITexture *pTexture = GetFullFrameFrameBufferTexture( textureIndex );
materials->CopyRenderTargetToTexture( pTexture );
materials->SetFrameBufferCopyTexture( pTexture, textureIndex );
}
Lastly open up viewrender.h and add this line after RenderViewEx at around line 170
void CViewRender::DoMotionBlur( void );
Single-player
If you're working on a Single Player Mod, you may have found that the front buffer wont update on a map change, or player death, this is because when you change the map, the gpGlobals->curtime variable resets to 0.0 seconds, but your fNextDrawTime retains its value.
So when the blur performs the check:
if ( fNextDrawTime < gpGlobals->curtime )
It will not return true until gpGlobals->curtime catches up - so if you played for 30 mins on the last map, the blur will start working 30 minutes into the new map. To do this you need to reset your fNextDrawTime on a map change by using the hack below, or don't use this check at all.
if ( fNextDrawTime - gpGlobals->curtime > 1.0f)
{
fNextDrawTime = 0.0f;
}
This code sits above this line
if( gpGlobals->curtime >= fNextDrawTime )
Material files
That should do it. You need to add a material file called frontbuffer.vmt in your materials folder - although you could probably use an existing one. Here's an example:
"UnlitGeneric"
{
"$basetexture" "_rt_FullFrameFB"
"$ignorez" 1
}