I would think your code is based some what on;
http://developer.valvesoftware.com/wiki/AVI_Materials

--------
Owner Nigredo Studios http://www.nigredostudios.com

--- On Sun, 13/9/09, Jonas 'Sortie' Termansen <hlcod...@maxsi.dk> wrote:

From: Jonas 'Sortie' Termansen <hlcod...@maxsi.dk>
Subject: Re: [hlcoders] Avi Materials
To: "Discussion of Half-Life Programming" <hlcoders@list.valvesoftware.com>
Received: Sunday, 13 September, 2009, 8:18 PM

You are doing something wrong. I have been really toying with this, and 
I have had some of the bugs you have mentioned, but I have also fixed 
them. The problem is that produceral materials needs to be redrawn. 
Although as long as stay ingame it doesn't 'need' to be redrawn, but you 
cannot be sure the memory of the produceral texture is overriden. This 
happens when you alt-tab the game or something nasty.

The avi system you are using are a bit flawed in the first place. I've 
been experimenting with using ffmpeg instead - and I got it successfully 
working ingame. Although it's hardly finished and is still very very 
buggy and experimental, it is able to playable all sorts of videos. I 
need to add a few other features to it, but if you are interested, mail 
me and I'll provide you with the WIP code. I'll post it on the Wiki once 
it's working correctly.
> Hello,
>
>  
>
> I've tried to utilize the IAvi Interface to create a material for an avi
> file.
>
>  
>
> I've the following code running when my entity is created on the client.
>
>  
>
> The avi is a valid file because it complains if it can't find the file. The
> file I am passing in for now was created in the engine itself using
> startmovie blah avi
>
>  
>
> if(updateType == DATA_UPDATE_CREATED)
>
> {
>
>       m_hAviMaterial =
> avi->CreateAVIMaterial(m_strAviMaterial,m_strAviMaterial,"GAME");
>
>  
>
>       if ( m_hAviMaterial != AVIMATERIAL_INVALID )
>
>       {
>
>             m_flAviFrameCount = avi->GetFrameCount(m_hAviMaterial);
>
>             m_pAviMaterial = avi->GetMaterial(m_hAviMaterial);
>
>             SetNextClientThink(CLIENT_THINK_ALWAYS);
>
>       }
>
>  
>
>       if(m_pAviMaterial)
>
>             m_pAviMaterial->AddRef();
>
> }
>
>  
>
> Then in my DrawModel function I do.
>
>  
>
> if(m_pAviMaterial)
>
>       modelrender->ForcedMaterialOverride(m_pAviMaterial);
>
>  
>
> int val = BaseClass::DrawModel(flags);
>
> modelrender->ForcedMaterialOverride(0);
>
> return val;
>
>  
>
> This does not work so to speak because I get a material on my model that is
> pink checkerboard partially and the rest has no alpha. When I brought up the
> console I got some artifacts from other textures showing on my model. These
> artifacts seemed to be the memory for the main menu texture, and also one of
> our mods hud textures as well as some random pixels.
>
>  
>
> I've also tried forcing the frame to some constant value every think and it
> doesn't help.
>
>  
>
> Has anyone had any success with using this?
>
>  
>
> Thanks
>
> Chris
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please 
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>   


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




      
__________________________________________________________________________________
Get more done like never before with Yahoo!7 Mail.
Learn more: http://au.overview.mail.yahoo.com/
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to