Icare Posted July 23, 2010 Share Posted July 23, 2010 Hi , Who can explain to me the usefulness of the callback function on the materials. What is that and how they are used? Thank a lot Nicolas Quote Link to comment Share on other sites More sharing options...
Canardia Posted July 23, 2010 Share Posted July 23, 2010 They are probably good for physics audio. So when a body collides or sweeps over another body, the material callback would determine which sound to play. For example metal against wood, metal against sand, wood against glass, wood against rock, etc... Every game has that. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Masterxilo Posted July 24, 2010 Share Posted July 24, 2010 The material callbacks are called every time a material is set for rendering. You could update some uniforms of the shader the material uses within that callback. Or change some textures (for animated materials). Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
Icare Posted July 25, 2010 Author Share Posted July 25, 2010 ok, thank But how I do in blitzmax to retrieve the function pointer ? Nicolas Quote Link to comment Share on other sites More sharing options...
cocopino Posted July 26, 2010 Share Posted July 26, 2010 In Blitzmax you use Byte Ptr, something like: SetEntityCallback (mesh, Byte Ptr(myCallBackFunction), ENTITYCALLBACK_COLLISION ) Function myCallBackFunction( ent:TEntity ) 'do stuff here with ent End Function Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Icare Posted July 26, 2010 Author Share Posted July 26, 2010 thank a lot. Nicolas Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.