Hello everyone, I proudly present jGpuSkin: a skeletal animation plugin for DBPro. Rather than augmenting DBPro's built-in functionality, this plugin is a replacement animation system which was written with the intention of reducing cpu load when using multi-camera renderers. Skeleton data is not represented using DBPro's limb system which helps to avoid overhead within the sync command, and also allows accurate bone transforms to be retrieved pre-sync.
The library makes no attempt to perform mesh deformation on the cpu; All objects handled by this plugin require an appropriate shader, and shaders cannot be shared across multiple objects. Shader bone matrix palettes are represented using float4 arrays, allowing a maximum of 80 weighted bones per object with up to 4 weights per vertex. The matrix palettes only contain bones which directly contribute to mesh deformation, meaning there is no limit to the number of non-weighted bones which can exist within a skeleton. These two features allow the plugin to work with many objects that are normally incompatible with standard fastbone shaders.
Before objects can be used with this plugin, they must be converted into the appropriate format using the provided Import Tool.
[Update 12/19/2017]
Import Tool Updates:
------------------------------------
- Updated the import code to calculate permutation matrices; Enable them by checking "Skeleton->Use Permutation Matrix" within the Tools menu after initial import (loading files which were produced by previous versions will not work).
- Updated the skeleton file format to store permutation matrices for objects which are saved with the "Use Permutation Matrix" option checked. Note: Permutation matrix data will be lost if "Use Permutation Matrix" is not checked while saving.
- Added Mesh tools for flipping vertex normals along each axis.
- Added a wireframe mode, and added backlighting to the default diffuse technique.
- Removed texture handling for the time being.
- Compiled using DBPro9Ex from this version on. If anyone here still uses XP just let me know and I will upload a version compiled with u7_7.
- Removed MSAA option which was added in the last beta, It didn't work well with the skeleton visualization and causes a strange issue with 9Ex
Bug Fixes:
------------------------------------
- Fixed a bug where freshly-imported objects would sometimes not assume their proper bind pose.
- Fixed a critical problem with the import tool's weld object function which was crashing the application (actually works this time...)
- Fixed some bugs with the keyframe reduction tool which were causing the animobject to display the improper animation frame
Plugin Updates:
------------------------------------
- Added better control over when/how AnimObject updates are performed to better suit various usage strategies.
- Implemented a mesh (limb) based LOD system; Uses the animobject's distance from the near plane (re-used culling data) for fast LOD calculation.
- Added the abillity to force a specific mesh LOD when rendering each camera.
- Permutation matrices are now loaded from skeleton data; Requires objects to have been exported using the latest import tool.
- Added SkeletonLOD system which is used to skip recalculating local transforms for certain bones when viewing the animobject at great distances.
- Updated the plugin to collect object data as soon as AnimObject_SetObject is called, rather than waiting for the shader. This removes the need to apply an object and shader before calling certain commands, as well as allowing more settings to be duplicated while cloning.
- Removed default camera mask, AnimObjects now require setting a camera mask before they will render to any cameras.
- Added an example showing how to use the LOD systems; Uses example media which was created and kindly donated by Chris Tate.
- Added an example showing how to render AnimObjects using DBPro's native renderer.
Bug Fixes:
------------------------------------
- Fixed a bug where the permutation matrix wasn't being applied when using object-space bone palettes.
Updated Commands (1):
------------------------------------
AnimObject_Update pAnimObj [, bUpdatePalette ] //New overload, allows for updating the bone palette in addition to the skeleton
New Commands (10):
------------------------------------
AnimObject_SetUpdateMode pAnimObj, Mode //0=Optimal update during sync (based on culling), 1=Always Update Skeleton (ignores culling), 2=Full Skeleton Update JGS_Update, 3=Skeleton And Palette Update within JGS_Update
AnimObject_SetLODLevels pAnimObj, LevelCount //defines the number of LOD levels the AnimObject's dbpro object is equipped to display. LevelCount begins at 0 (default)
AnimObject_SetLODDistance pAnimObj, Level, MinRange //defines the minimum distance at which the specified LOD should begin rendering. Level 0 is always assumed to have a MinRange of 0.
AnimObject_SetMeshLOD pAnimObj, Index, Level //defines which LOD level the specified mesh represents
JGS_SetCameraLOD CamID, Level //forces a specific animobject mesh LOD to be used when rendering the specified camera.
AnimObject_SetSkeletonLOD pAnimObj, bEnabled [, Dist#] //Specifies if an animobject should use SkeletonLOD, as well as what distance it should take effect
AnimBone_SetLOD pAnimBone, bUseLOD, bExcludeChildren //specify if a particular bone should participate in the SkeletonLOD system; True means this bone's local transforms will not be updated at great distances.
AnimObject_SetHidden pAnimObj, bHidden //Hide/Show an AnimObject; hidden animobjects are still updated but not rendered
bool = AnimObject_GetHidden(pAnimObj) //Returns an AnimObject's hidden status
AnimObject_UpdatePalette pAnimObj //Updates an AnimObject's bone palette (shader array)
Command List (132 total):
AnimObject_Load=jGpuSkin/AnimObject_Load.html=( SkeletonFileName$ )
AnimObject_Delete=jGpuSkin/AnimObject_Delete.html=pAnimObj, bDeleteEffect
AnimObject_Clone=jGpuSkin/AnimObject_Clone.html=( pAnimObj )
AnimObject_SetEffect=jGpuSkin/AnimObject_SetEffect.html=pAnimObj, EffectID
AnimObject_SetPosition=jGpuSkin/AnimObject_SetPosition.html=pAnimObj, X#, Y#, Z#
AnimObject_GetPositionX=jGpuSkin/AnimObject_GetPositionX.html=( pAnimObj )
AnimObject_GetPositionY=jGpuSkin/AnimObject_GetPositionY.html=( pAnimObj )
AnimObject_GetPositionZ=jGpuSkin/AnimObject_GetPositionZ.html=( pAnimObj )
AnimObject_SetRotation=jGpuSkin/AnimObject_SetRotation.html=pAnimObj, X#, Y#, Z#
AnimObject_GetRotationX=jGpuSkin/AnimObject_GetRotationX.html=( pAnimObj )
AnimObject_GetRotationY=jGpuSkin/AnimObject_GetRotationY.html=( pAnimObj )
AnimObject_GetRotationZ=jGpuSkin/AnimObject_GetRotationZ.html=( pAnimObj )
AnimObject_SetScale=jGpuSkin/AnimObject_SetScale.html=pAnimObj, X#, Y#, Z#
AnimObject_GetScaleX=jGpuSkin/AnimObject_GetScaleX.html=( pAnimObj )
AnimObject_GetScaleY=jGpuSkin/AnimObject_GetScaleY.html=( pAnimObj )
AnimObject_GetScaleZ=jGpuSkin/AnimObject_GetScaleZ.html=( pAnimObj )
AnimObject_GetObjectID=jGpuSkin/AnimObject_GetObjectID.html=( pAnimObj )
AnimObject_GetEffectID=jGpuSkin/AnimObject_GetEffectID.html=( pAnimObj )
AnimObject_GetBonePaletteSize=jGpuSkin/AnimObject_GetBonePaletteSize.html=( pAnimObj )
AnimObject_GetMaxBoneWeights=jGpuSkin/AnimObject_GetMaxBoneWeights.html=( pAnimObj )
AnimObject_GetBoneCount=jGpuSkin/AnimObject_GetBoneCount.html=( pAnimObj )
AnimObject_GetBone=jGpuSkin/AnimObject_GetBone.html=( pAnimObj, Index )
AnimObject_GetBoneByName=jGpuSkin/AnimObject_GetBoneByName.html=( pAnimObj, Name$ )
AnimObject_SetToBindPose=jGpuSkin/AnimObject_SetToBindPose.html=pAnimObj, bClearBoneOffsets
AnimObject_SetFrame=jGpuSkin/AnimObject_SetFrame.html=pAnimObj, pAnimTrack, FrameID#
AnimObject_GetFrame=jGpuSkin/AnimObject_GetFrame.html=( pAnimObj )
AnimObject_GetBlendFrame=jGpuSkin/AnimObject_GetBlendFrame.html=( pAnimObj )
AnimObject_InterpolateFrames=jGpuSkin/AnimObject_InterpolateFrames.html=pAnimObj, pAnimTrackA, FrameIDA#, pAnimTrackB, FrameIDB#, Alpha#
AnimObject_Play=jGpuSkin/AnimObject_Play.html=pAnimObj, pAnimTrack, FirstFrame, LastFrame, Speed#
AnimObject_Loop=jGpuSkin/AnimObject_Loop.html=pAnimObj, pAnimTrack, FirstFrame, LastFrame, Speed#, StartFrame
AnimObject_TransitionTo=jGpuSkin/AnimObject_TransitionTo.html=pAnimObj, pAnimTrack, Duration#, FirstFrame, LastFrame, Speed#
AnimObject_TransitionToLoop=jGpuSkin/AnimObject_TransitionToLoop.html=pAnimObj, pAnimTrack, Duration#, FirstFrame, LastFrame, Speed#, StartFrame
AnimObject_BlendTo=jGpuSkin/AnimObject_BlendTo.html=pAnimObj, pAnimTrack, Duration#, FirstFrame, LastFrame, Speed#
AnimObject_BlendToLoop=jGpuSkin/AnimObject_BlendToLoop.html=pAnimObj, pAnimTrack, Duration#, FirstFrame, LastFrame, Speed#, StartFrame
AnimObject_Pause=jGpuSkin/AnimObject_Pause.html=pAnimObj
AnimObject_Resume=jGpuSkin/AnimObject_Resume.html=pAnimObj
AnimObject_Stop=jGpuSkin/AnimObject_Stop.html=pAnimObj
AnimObject_GetAnimState=jGpuSkin/AnimObject_GetAnimState.html=( pAnimObj )
AnimObject_GetAnimFirstFrame=jGpuSkin/AnimObject_GetAnimFirstFrame.html=( pAnimObj )
AnimObject_GetAnimLastFrame=jGpuSkin/AnimObject_GetAnimLastFrame.html=( pAnimObj )
AnimObject_GetBlendState=jGpuSkin/AnimObject_GetBlendState.html=( pAnimObj )
AnimObject_GetBlendFirstFrame=jGpuSkin/AnimObject_GetBlendFirstFrame.html=( pAnimObj )
AnimObject_GetBlendLastFrame=jGpuSkin/AnimObject_GetBlendLastFrame.html=( pAnimObj )
AnimObject_GetAnimTrack=jGpuSkin/AnimObject_GetAnimTrack.html=( pAnimObj )
AnimObject_GetBlendAnimTrack=jGpuSkin/AnimObject_GetBlendAnimTrack.html=( pAnimObj )
AnimObject_IsAnimating=jGpuSkin/AnimObject_IsAnimating.html=( pAnimObj )
AnimObject_ClearBoneOffsets=jGpuSkin/AnimObject_ClearBoneOffsets.html=pAnimObj
AnimObject_GetAnimSpeed=jGpuSkin/AnimObject_GetAnimSpeed.html=( pAnimObj )
AnimObject_SetAnimSpeed=jGpuSkin/AnimObject_SetAnimSpeed.html=pAnimObj, Speed#
AnimObject_SetExcluded=jGpuSkin/AnimObject_SetExcluded.html=pAnimObj, bExcluded, bGluedObjects
AnimObject_GetExcluded=jGpuSkin/AnimObject_GetExcluded.html=( pAnimObj )
AnimObject_SetObject=jGpuSkin/AnimObject_SetObject.html=pAnimObj, ObjectID
AnimObject_SetCameraMask=jGpuSkin/AnimObject_SetCameraMask.html=pAnimObj, dwMaskBits
AnimObject_GetCameraMask=jGpuSkin/AnimObject_GetCameraMask.html=( pAnimObj )
AnimObject_OffsetRotation=jGpuSkin/AnimObject_OffsetRotation.html=pAnimObj, X#, Y#, Z#
AnimObject_Move=jGpuSkin/AnimObject_Move.html=pAnimObj, Distance#
AnimObject_MoveUp=jGpuSkin/AnimObject_MoveUp.html=pAnimObj, Distance#
AnimObject_MoveRight=jGpuSkin/AnimObject_MoveRight.html=pAnimObj, Distance#
AnimObject_SetCullRadius=jGpuSkin/AnimObject_SetCullRadius.html=pAnimObj, Radius#
AnimObject_SetCullBone=jGpuSkin/AnimObject_SetCullBone.html=pAnimObj, BoneIndex
AnimObject_SetPermutationMatrix=jGpuSkin/AnimObject_SetPermutationMatrix.html=pAnimObj, m11#, m12#, m13#, m21#, m22#, m23#, m31#, m32#, m33#
AnimObject_GetMeshCount=jGpuSkin/AnimObject_GetMeshCount.html=( pAnimObj )
AnimObject_SetMeshExcluded=jGpuSkin/AnimObject_SetMeshExcluded.html=pAnimObj, MeshIndex, bExcluded
AnimObject_GetMeshExcluded=jGpuSkin/AnimObject_GetMeshExcluded.html=( pAnimObj, MeshIndex )
AnimObject_Update=jGpuSkin/AnimObject_Update.html=pAnimObj [, bUpdatePalette ]
AnimObject_UpdatePalette=jGpuSkin/AnimObject_UpdatePalette.html=pAnimObj
AnimObject_SetUpdateMode=jGpuSkin/AnimObject_SetUpdateMode.html=pAnimObj, Mode
AnimObject_SetHidden=jGpuSkin/AnimObject_SetHidden.html=pAnimObj, bHidden
AnimObject_GetHidden=jGpuSkin/AnimObject_GetHidden.html=(pAnimObj)
AnimObject_SetLODLevels=jGpuSkin/AnimObject_SetLODLevels.html=pAnimObj, Levels
AnimObject_SetLODDistance=jGpuSkin/AnimObject_SetLODDistance.html=pAnimObj, Level, Distance
AnimObject_SetMeshLOD=jGpuSkin/AnimObject_SetMeshLOD.html=pAnimObj, MeshIndex, Level
AnimObject_SetSkeletonLOD=jGpuSkin/AnimObject_SetSkeletonLOD.html=pAnimObj, bEnabled [, Distance ]
AnimBone_GetName=jGpuSkin/AnimBone_GetName.html=( pAnimBone )
AnimBone_GetIndex=jGpuSkin/AnimBone_GetIndex.html=( pAnimBone )
AnimBone_GetPaletteIndex=jGpuSkin/AnimBone_GetPaletteIndex.html=( pAnimBone )
AnimBone_GetParent=jGpuSkin/AnimBone_GetParent.html=( pAnimBone )
AnimBone_GetChildCount=jGpuSkin/AnimBone_GetChildCount.html=( pAnimBone )
AnimBone_GetChild=jGpuSkin/AnimBone_GetChild.html=( pAnimBone, Index )
AnimBone_SetPosition=jGpuSkin/AnimBone_SetPosition.html=pAnimBone, X#, Y#, Z#, Mode
AnimBone_GetPositionX=jGpuSkin/AnimBone_GetPositionX.html=( pAnimBone, Mode )
AnimBone_GetPositionY=jGpuSkin/AnimBone_GetPositionY.html=( pAnimBone, Mode )
AnimBone_GetPositionZ=jGpuSkin/AnimBone_GetPositionZ.html=( pAnimBone, Mode )
AnimBone_SetRotation=jGpuSkin/AnimBone_SetRotation.html=pAnimBone, X#, Y#, Z#, Mode
AnimBone_GetRotation=jGpuSkin/AnimBone_GetRotation.html=pAnimBone, Mode
AnimBone_SetRotationOffsetMode=jGpuSkin/AnimBone_SetRotationOffsetMode.html=pAnimBone, Mode, bExcludeChildren
AnimBone_SetScale=jGpuSkin/AnimBone_SetScale.html=pAnimBone, X#, Y#, Z#, Mode
AnimBone_GetScaleX=jGpuSkin/AnimBone_GetScaleX.html=( pAnimBone, Mode )
AnimBone_GetScaleY=jGpuSkin/AnimBone_GetScaleY.html=( pAnimBone, Mode )
AnimBone_GetScaleZ=jGpuSkin/AnimBone_GetScaleZ.html=( pAnimBone, Mode )
AnimBone_SetToBindPose=jGpuSkin/AnimBone_SetToBindPose.html=pAnimBone, bExcludeChildren, bClearOffsets
AnimBone_SetFrame=jGpuSkin/AnimBone_SetFrame.html=pAnimBone, pAnimTrack, FrameID#, bExcludeChildren
AnimBone_GetFrame=jGpuSkin/AnimBone_GetFrame.html=( pAnimBone )
AnimBone_GetBlendFrame=jGpuSkin/AnimBone_GetBlendFrame.html=( pAnimBone )
AnimBone_InterpolateFrames=jGpuSkin/AnimBone_InterpolateFrames.html=pAnimBone, pAnimTrackA, FrameIDA#, pAnimTrackB, FrameIDB#, Alpha#, bExcludeChildren
AnimBone_Play=jGpuSkin/AnimBone_Play.html=pAnimBone, pAnimTrack, FirstFrame, LastFrame, Speed#, bExcludeChildren
AnimBone_Loop=jGpuSkin/AnimBone_Loop.html=pAnimBone, pAnimTrack, FirstFrame, LastFrame, Speed#, StartFrame, bExcludeChildren
AnimBone_TransitionTo=jGpuSkin/AnimBone_TransitionTo.html=pAnimBone, pAnimTrack, Duration#, FirstFrame, LastFrame, Speed#, bExcludeChildren
AnimBone_TransitionToLoop=jGpuSkin/AnimBone_TransitionToLoop.html=pAnimBone, pAnimTrack, Duration#, FirstFrame, LastFrame, Speed#, StartFrame, bExcludeChildren
AnimBone_BlendTo=jGpuSkin/AnimBone_BlendTo.html=pAnimBone, pAnimTrack, Duration#, FirstFrame, LastFrame, Speed#, bExcludeChildren
AnimBone_BlendToLoop=jGpuSkin/AnimBone_BlendToLoop.html=pAnimBone, pAnimTrack, Duration#, FirstFrame, LastFrame, Speed#, StartFrame, bExcludeChildren
AnimBone_Pause=jGpuSkin/AnimBone_Pause.html=pAnimBone, bExcludeChildren
AnimBone_Resume=jGpuSkin/AnimBone_Resume.html=pAnimBone, bExcludeChildren
AnimBone_Stop=jGpuSkin/AnimBone_Stop.html=pAnimBone, bExcludeChildren
AnimBone_GetAnimState=jGpuSkin/AnimBone_GetAnimState.html=( pAnimBone )
AnimBone_GetAnimFirstFrame=jGpuSkin/AnimBone_GetAnimFirstFrame.html=( pAnimBone )
AnimBone_GetAnimLastFrame=jGpuSkin/AnimBone_GetAnimLastFrame.html=( pAnimBone )
AnimBone_GetBlendState=jGpuSkin/AnimBone_GetBlendState.html=( pAnimBone )
AnimBone_GetBlendFirstFrame=jGpuSkin/AnimBone_GetBlendFirstFrame.html=( pAnimBone )
AnimBone_GetBlendLastFrame=jGpuSkin/AnimBone_GetBlendLastFrame.html=( pAnimBone )
AnimBone_GetAnimTrack=jGpuSkin/AnimBone_GetAnimTrack.html=( pAnimBone )
AnimBone_GetBlendAnimTrack=jGpuSkin/AnimBone_GetBlendAnimTrack.html=( pAnimBone )
AnimBone_IsAnimating=jGpuSkin/AnimBone_IsAnimating.html=( pAnimBone )
AnimBone_ClearOffsets=jGpuSkin/AnimBone_ClearOffsets.html=pAnimBone, bExcludeChildren
AnimBone_GetAnimSpeed=jGpuSkin/AnimBone_GetAnimSpeed.html=( pAnimBone )
AnimBone_SetAnimSpeed=jGpuSkin/AnimBone_SetAnimSpeed.html=pAnimBone, Speed#, bExcludeChildren
AnimBone_GetAnimObject=jGpuSkin/AnimBone_GetAnimObject.html=( pAnimBone )
Object_GlueToAnimBone=jGpuSkin/Object_GlueToAnimBone.html=ObjID, pAnimBone
Object_UnglueFromAnimBone=jGpuSkin/Object_UnglueFromAnimBone.html=ObjID
Object_GetGluedAnimBone=jGpuSkin/Object_GetGluedAnimBone.html=( ObjID )
AnimBone_GetGluedObjectCount=jGpuSkin/AnimBone_GetGluedObjectCount.html=( pAnimBone )
AnimBone_GetGluedObjectID=jGpuSkin/AnimBone_GetGluedObjectID.html=( pAnimBone, Index )
AnimBone_SetGluedObjectsExcluded=jGpuSkin/AnimBone_SetGluedObjectsExcluded.html=pAnimBone, bExcluded
AnimBone_SetLOD=jGpuSkin/AnimBone_SetLOD.html=pAnimBone, bEnabled, bExcludeChildren
AnimTrack_Load=jGpuSkin/AnimTrack_Load.html=( FileName$ )
AnimTrack_Delete=jGpuSkin/AnimTrack_Delete.html=pAnimTrack
AnimTrack_GetFrameCount=jGpuSkin/AnimTrack_GetFrameCount.html=( pAnimTrack )
JGS_VectorX=jGpuSkin/JGS_VectorX.html=( *no parameters* )
JGS_VectorY=jGpuSkin/JGS_VectorY.html=( *no parameters* )
JGS_VectorZ=jGpuSkin/JGS_VectorZ.html=( *no parameters* )
JGS_Update=jGpuSkin/JGS_Update.html=TimeDelta#
JGS_SetCameraLOD=jGpuSkin/JGS_SetCameraLOD.html=CameraID, LODLevel
This plugin is still very much a work in progress; all comments, questions, suggestions and bug reports are welcome.