Hi everyone,
I've finished up rewriting the geometry instancing library. Before removing the old GeoInst_ commandset from jGfx, the new lib is being released as a separate plugin. I'm not yet sure if this plugin will replace the old GeoInst_ commandset within jGfx, or if it will remain a separate plugin.
Whats New?
============================
- Multi-mesh instances, Culling and LOD
- New grouping system for easy exclusion and BVH tree assembly
- New custom element datatypes and usages (pass data to the vertex shader using POSITION or TEXCOORD semantics)
Whats Changed?
============================
- The old GeoInst_ commandset's functionality is now spread across two new commandsets: GInst_ and GInstBuffer_
- Render states must now be controlled entirely within the shader, dbpro renderstate settings are no longer used
- The plugin's world matrices are now passed to the shader as POSITION elements
- Effect references are no longer gathered directly from object limbs, a new command has been added for that purpose
Update Nov-13-2018:
===================================
- Fixed an issue with mesh bounding volumes
- New commands for getting/setting GInstBuffer and GInstGroup bounds
- Added TreeIT Example
- New Seamless Texture Atlasing Example
Modified Commands (1):
------------------------------------------
pGInstBuffer = GInstBuffer_MakeNew( pGInst, InstanceCount [, bDynamic ] )
New Commands (24):
------------------------------------------
GInstBuffer_SetAutoBoundsEnabled pGInstBuffer, bEnabled
bool = GInstBuffer_GetAutoBoundsEnabled( pGInstBuffer )
GInstBuffer_SetBounds pGInstBuffer, MinX#, MinY#, MinZ#, MaxX#, MaxY#, MaxZ#
Value# = GInstBuffer_SetBoundsMinX( pGInstBuffer )
Value# = GInstBuffer_SetBoundsMinY( pGInstBuffer )
Value# = GInstBuffer_SetBoundsMinZ( pGInstBuffer )
Value# = GInstBuffer_SetBoundsMaxX( pGInstBuffer )
Value# = GInstBuffer_SetBoundsMaxY( pGInstBuffer )
Value# = GInstBuffer_SetBoundsMaxZ( pGInstBuffer )
Value# = GInstBuffer_SetBoundsCenterX( pGInstBuffer )
Value# = GInstBuffer_SetBoundsCenterY( pGInstBuffer )
Value# = GInstBuffer_SetBoundsCenterZ( pGInstBuffer )
GInstGroup_SetAutoBoundsEnabled pGInstGroup, bEnabled
bool = GInstGroup_GetAutoBoundsEnabled( pGInstGroup )
GInstGroup_SetBounds pGInstGroup, MinX#, MinY#, MinZ#, MaxX#, MaxY#, MaxZ#
Value# = GInstGroup_SetBoundsMinX( pGInstGroup )
Value# = GInstGroup_SetBoundsMinY( pGInstGroup )
Value# = GInstGroup_SetBoundsMinZ( pGInstGroup )
Value# = GInstGroup_SetBoundsMaxX( pGInstGroup )
Value# = GInstGroup_SetBoundsMaxY( pGInstGroup )
Value# = GInstGroup_SetBoundsMaxZ( pGInstGroup )
Value# = GInstGroup_SetBoundsCenterX( pGInstGroup )
Value# = GInstGroup_SetBoundsCenterY( pGInstGroup )
Value# = GInstGroup_SetBoundsCenterZ( pGInstGroup )
Command List (124 total):
GInst_MakeNew==*no parameters*
GInst_Delete==pGInst
GInst_SetObject==pGInst, ObjectID
GInst_BeginObjectAssembly==pGInst
GInst_AddMesh==pGInst, ObjectID, LimbID
GInst_FinishObjectAssembly==pGInst
GInst_GetMeshCount==( pGInst )
GInst_GetMeshObject==( pGInst, MeshIndex )
GInst_GetMeshLimb==( pGInst, MeshIndex )
GInst_SetEffect==pGInst, EffectID
GInst_GetEffect==( pGInst )
GInst_SetCameraMask==pGInst, dwMaskBits
GInst_GetCameraMask==( pGInst )
GInst_SetHidden==pGInst, bHidden
GInst_GetHidden==( pGInst )
GInst_SetRenderPriority==pGInst, Priority
GInst_GetRenderPriority==( pGInst )
GInst_Sort==*no parameters*
GInst_GetRenderIndex==( pGInst )
GInst_SetLODLevels==pGInst, LevelCount
GInst_GetLODLevels==( pGInst )
GInst_SetLODDistance==pGInst, Level, Distance#
GInst_GetLODDistance==( pGInst, Level )
GInst_SetMeshLOD==pGInst, MeshIndex, Level
GInst_GetMeshLOD==( pGInst, MeshIndex )
GInst_SetMeshCameraMask==pGInst, dwMaskBits
GInst_GetMeshCameraMask==( pGInst, MeshIndex )
GInst_SetMaxDrawDistance==pGInst, Distance#
GInst_GetMaxDrawDistance==( pGInst )
GInst_DeclareCustomElements==pGInst, bUseWorldMat
GInst_AddCustomElement==pGInst, D3DDeclType, D3DDeclUsage
GInst_FinishCustomElements==pGInst
GInst_GetDrawCalls==( [ CameraID ] )
GInst_GetDrawPrimitives==( [ CameraID ] )
GInst_GetDrawInstances==( [ CameraID ] )
GInstBuffer_MakeNew==( pGInst, InstanceCount [, bDynamic ] )
GInstBuffer_Delete==pGInstBuffer
GInstBuffer_Resize==pGInstBuffer, InstanceCount
GInstBuffer_GetSize==( pGInstBuffer )
GInstBuffer_GetGInst==( pGInstBuffer)
GInstBuffer_SetActiveInstanceCount==pGInstBuffer, InstanceCount
GInstBuffer_GetActiveInstanceCount==( pGInstBuffer )
GInstBuffer_SetHidden==pGInstBuffer, bHidden
GInstBuffer_GetHidden==( pGInstBuffer )
GInstBuffer_SetCullingEnabled==pGInstBuffer, bEnabled [, DistanceCalcMode ]
GInstBuffer_GetCullingEnabled==( pGInstBuffer )
GInstBuffer_SetGroup==pGInstBuffer, pGInstGroup
GInstBuffer_GetGroup==( pGInstBuffer )
GInstBuffer_SetPosition==pGInstBuffer, InstIndex, X#, Y#, Z#
GInstBuffer_GetPositionX==( pGInstBuffer, InstIndex )
GInstBuffer_GetPositionY==( pGInstBuffer, InstIndex )
GInstBuffer_GetPositionZ==( pGInstBuffer, InstIndex )
GInstBuffer_SetRotation==pGInstBuffer, InstIndex, X#, Y#, Z#
GInstBuffer_GetAngleX==( pGInstBuffer, InstIndex )
GInstBuffer_GetAngleY==( pGInstBuffer, InstIndex )
GInstBuffer_GetAngleZ==( pGInstBuffer, InstIndex )
GInstBuffer_SetScale==pGInstBuffer, InstIndex, X#, Y#, Z# || pGInstBuffer, InstIndex, Scale#
GInstBuffer_GetScaleX==( pGInstBuffer, InstIndex )
GInstBuffer_GetScaleY==( pGInstBuffer, InstIndex )
GInstBuffer_GetScaleZ==( pGInstBuffer, InstIndex )
GInstBuffer_UpdateInstance==pGInstBuffer, InstIndex
GInstBuffer_SetWorldMatrix==pGInstBuffer, InstIndex, pMat4
GInstBuffer_GetWorldMatrix==pGInstBuffer, InstIndex, pMat4
GInstBuffer_SetExcluded==pGInstBuffer, InstIndex, bExcluded
GInstBuffer_GetExcluded==( pGInstBuffer, InstIndex )
GInstBuffer_SetFloat==pGInstBuffer, InstIndex, CustEleIndex, X#
GInstBuffer_SetFloat2==pGInstBuffer, InstIndex, CustEleIndex, X#, Y#
GInstBuffer_SetFloat3==pGInstBuffer, InstIndex, CustEleIndex, X#, Y#, Z#
GInstBuffer_SetFloat4==pGInstBuffer, InstIndex, CustEleIndex, X#, Y#, Z#, W#
GInstBuffer_GetFloat==( pGInstBuffer, InstIndex, CustEleIndex, FloatIndex )
GInstBuffer_SetUByte4==pGInstBuffer, InstIndex, CustEleIndex, ByteX, ByteY, ByteZ, ByteW
GInstBuffer_GetUByte==( pGInstBuffer, InstIndex, CustEleIndex, ByteIndex )
GInstBuffer_SetDword==pGInstBuffer, InstIndex, CustEleIndex, DwValue
GInstBuffer_GetDword==( pGInstBuffer, InstIndex, CustEleIndex )
GInstBuffer_SetShort2==pGInstBuffer, InstIndex, CustEleIndex, X, Y
GInstBuffer_SetShort4==pGInstBuffer, InstIndex, CustEleIndex, X, Y, Z, W
GInstBuffer_GetShort==( pGInstBuffer, InstIndex, CustEleIndex, ShortIndex )
GInstBuffer_SetUShort2==pGInstBuffer, InstIndex, CustEleIndex, X, Y
GInstBuffer_SetUShort4==pGInstBuffer, InstIndex, CustEleIndex, X, Y, Z, W
GInstBuffer_GetUShort==( pGInstBuffer, InstIndex, CustEleIndex, UShortIndex )
GInstBuffer_SetDec3==pGInstBuffer, InstIndex, CustEleIndex, X, Y, Z
GInstBuffer_GetDec==( pGInstBuffer, InstIndex, CustEleIndex, DecIndex )
GInstBuffer_SetUDec3==pGInstBuffer, InstIndex, CustEleIndex, X, Y, Z
GInstBuffer_GetUDec==( pGInstBuffer, InstIndex, CustEleIndex, UDecIndex )
GInstBuffer_SetFloat16x2==pGInstBuffer, InstIndex, CustEleIndex, X#, Y#
GInstBuffer_SetFloat16x4==pGInstBuffer, InstIndex, CustEleIndex, X#, Y#, Z#, W#
GInstBuffer_GetFloat16==( pGInstBuffer, InstIndex, CustEleIndex, FloatIndex )
GInstBuffer_Update==pGInstBuffer [, bUpdateBounds ]
GInstBuffer_SetAutoBoundsEnabled==pGInstBuffer, bEnabled
GInstBuffer_GetAutoBoundsEnabled==( pGInstBuffer )
GInstBuffer_SetBounds==pGInstBuffer, MinX#, MinY#, MinZ#, MaxX#, MaxY#, MaxZ#
GInstBuffer_GetBoundsMinX==( pGInstBuffer )
GInstBuffer_GetBoundsMinY==( pGInstBuffer )
GInstBuffer_GetBoundsMinZ==( pGInstBuffer )
GInstBuffer_GetBoundsMaxX==( pGInstBuffer )
GInstBuffer_GetBoundsMaxY==( pGInstBuffer )
GInstBuffer_GetBoundsMaxZ==( pGInstBuffer )
GInstBuffer_GetBoundsCenterX==( pGInstBuffer )
GInstBuffer_GetBoundsCenterY==( pGInstBuffer )
GInstBuffer_GetBoundsCenterZ==( pGInstBuffer )
GInstGroup_MakeNew==( [ pGInstGroup ] )
GInstGroup_Delete==pGInstGroup, bDeleteBuffers
GInstGroup_SetExcluded==pGInstGroup, bExcluded
GInstGroup_GetExcluded==( pGInstGroup )
GInstGroup_SetCullingEnabled==pGInstGroup, bEnabled
GInstGroup_GetCullingEnabled==( pGInstGroup )
GInstGroup_GetParentGroup==( pGInstGroup )
GInstGroup_GetChildGroupCount==( pGInstGroup )
GInstGroup_GetChildGroup==( pGInstGroup, ChildIndex )
GInstGroup_GetInstBufferCount==( pGInstGroup )
GInstGroup_GetInstBuffer==( pGInstGroup, BufferIndex )
GInstGroup_SetAutoBoundsEnabled==pGInstGroup, bEnabled
GInstGroup_GetAutoBoundsEnabled==( pGInstGroup )
GInstGroup_SetBounds==pGInstGroup, MinX#, MinY#, MinZ#, MaxX#, MaxY#, MaxZ#
GInstGroup_GetBoundsMinX==( pGInstGroup )
GInstGroup_GetBoundsMinY==( pGInstGroup )
GInstGroup_GetBoundsMinZ==( pGInstGroup )
GInstGroup_GetBoundsMaxX==( pGInstGroup )
GInstGroup_GetBoundsMaxY==( pGInstGroup )
GInstGroup_GetBoundsMaxZ==( pGInstGroup )
GInstGroup_GetBoundsCenterX==( pGInstGroup )
GInstGroup_GetBoundsCenterY==( pGInstGroup )
GInstGroup_GetBoundsCenterZ==( pGInstGroup )
Device_GetDeclTypeCaps==( *no parameters* )
I've attached the new plugin to this post. Download contains the dll, keywords file, 8 example projects, and a command reference document (placeholder for help files until the new commandset's fate is decided).
@Chris,
I'm excited to see what you've come up with, this secret system has me intrigued. That does sound like quite the task, the new versions of AL are quite complicated but I have confidence that you'll find a way.
Quote: "I haven't quite memorized the command-set yet"
That's probably good, its obsolete now lol.
@Resourceful,
Unfortunately that won't be possible, DBPro and AppGameKit depend on two very different underlaying graphics APIs (DirectX9 vs OpenGL/OpenGLES). While I have no doubt that OpenGL is capable of everything this plugin provides, I'm not sure if AppGameKit supports external renderers and It would be much better if something were developed from the ground up with OpenGL in mind. I currently have no plans to release AppGameKit versions of my plugins.