Hello Cesium team,
What I am doing: I am making my entire model transparent, but I want to make certain meshes/nodes not transparent. Also before you ask no there is not a way to split the one model into multiple pieces.
I get const gltf = primitive._cachedGltf._gltf
then I recurse through the gltf to get the root and it’s children:
const rootNode = getNodeHierarchy(gltf)
then using the id of the node I call my own get node to get the node via id:
const nodes = getNode( rootNode, idTag)
I also pass in the frame state and if there is one I regenerateShaders
my code to delete translucent command:
function setNodeOpaque(
primitive: CesiumPrimitive, node: CesiumNode | undefined,
affectChildren: boolean
): void {
if (node === null || node === undefined) {
return
}
if (node.mesh !== undefined) {
for (let index = 0; index < primitive._runtime.nodesByName[node.name].commands.length; index++) {
const runtimeNode = primitive._runtime.nodesByName[node.name]
const commands = runtimeNode.commands[index]
delete commands.translucentCommand
}
}
if (affectChildren) {
if (node.children !== undefined) {
for (const nodeChildren of node.children) {
setNodeOpaque(
primitive,
nodeChildren,
true
)
}
}
}
}
This code worked in 1.57 but whith 1.77 it no longer works
Is there a way to delete the translucent command for specific nodes/meshes? Or is there a way to ignore the translucent command/not do it at render? what changed?
Devon
P.s. this is needed asap so if a member of the cesium team can help @omar @dzung or know of anyone to check this out for me I would appreciate it.