-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE SUGGESTION] A pre-formatted file format for fast loading into data textures #1213
Comments
/ping @tmarti ! |
I had an idea (see ea86f96):
mySceneModel.createDTXLayer({
id: "myDTXLayer1",
primitive: "triangles",
origin,
positionsCompressed,
metallicRoughness,
indices8Bits,
indices16Bits,
indices32Bits,
edgeIndices8Bits,
edgeIndices16Bits,
edgeIndices32Bits,
perEntityColors,
perEntityPickColors,
perEntitySolid,
perEntityOffsets,
perEntityPositionsDecodeMatrices,
perEntityInstancePositioningMatrices,
perEntityVertexBases,
perEntityIndexBaseOffsets,
perEntityEdgeIndexBaseOffsets,
perTriangleNumberPortionId8Bits,
perTriangleNumberPortionId16Bits,
perTriangleNumberPortionId32Bits,
perEdgeNumberPortionId8Bits,
perEdgeNumberPortionId16Bits,
perEdgeNumberPortionId32Bits
});
mySceneModel.createMesh({
id: "myMesh1",
dtxLayerId: "myDTXLayer1",
dtxLayerPortion: 3
});
mySceneModel.createEntity({
id: "myEntity1",
meshIds: ["myMesh1"]
}; Each The meshes would still need to retain certain JavaScript flag values ('visible', `highlighted' etc), but may be able to extract them from the appropriate data texture arrays, perhaps on-demand on the first time they're queried with the getter methods, then caching them in JavaScript memory. Or the This would require the DTX layers to be created by the converter. The benefit this approach would be:
Each mesh (or entity) would still need to know it's AABB though. That could be an extra array in the These DTX layers could even be added to the XKT format, and the layer creation functions could be moved into |
Currently
SceneModel
class provides a set of builder methods,createGeometry
,createMesh
,createEntity
etc.SceneModel
createsTrianglesDataTextureLayers
, that pack the geometries, meshes and entities into data textures, which get rendered by our data texture shaders.Idea
SceneModel
andTrianglesDataTextureLayer
logic into a NodeJS-based converterSceneModel
(or a new class, maybeDTXSceneModel
) load that XKT/DTX and just transfer the data arrays straight into a set of data texturesUsing this strategy, we offload things like geometry bucketing, array processing (all the concatenation of arrays etc) onto the converter.
The XKT/DTX would also have "layers" which split the data arrays into portions that will fit into data textures on the viewer's size. These layers could also fit with LoD/streaming somehow.
The text was updated successfully, but these errors were encountered: