Alright, so I used the Motion Blur tutorial from the wiki to help me create
a new CTextureReference to be used as a render target. The code looks like
this:
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;
}
Now, I duplicated this code into another function using a new
CTextureReference so I can have another render target. My function looks
like this:
static CTextureReference s_pSecondTex;
ITexture *GetSecondTex( void )
{
if( !s_pSecondTex )
{
s_pSecondTex.InitRenderTarget( 256, 256, RT_SIZE_FULL_FRAME_BUFFER,
IMAGE_FORMAT_ARGB8888, MATERIAL_RT_DEPTH_NONE, false );
Assert( !IsErrorTexture( s_pSecondTex ) );
}
return s_pSecondTex;
}
Now, if I try to call both functions in my code, the game ends up crashing.
It doesn't matter which one I call first -- it always crashes on the second
one. Here's a snippet of the call stack:
shaderapidx9.dll!2a01d0cf()
[Frames below may be incorrect and/or missing, no symbols loaded for
shaderapidx9.dll]
shaderapidx9.dll!2a0115a4()
shaderapidx9.dll!2a01ca6a()
MaterialSystem.dll!0d77ad4c()
client.dll!CTextureReference::InitRenderTarget() + 0x7e bytes
client.dll!GetDOFTex0()
Now, since I can't get down that far in the code, I'm at a complete loss. I
realize the motion blur tutorial is probably outdated, and that the shader
system has evolved quite a bit, so if I'm approaching the creation of render
targets incorrectly, please let me know. Otherwise, does anyone else have
thoughts?
_________________________________________________________________
More photos, more messages, more storageget 2GB with Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders