Closed RELNO closed 1 year ago
@Pessimistress since tile3d is composite of ScenegraphLayer (in this case), I wonder if https://github.com/visgl/deck.gl/pull/5214 might be related.
Further investigation shows that getShaders
has no impact on extended Tile3DLayer
:
import { Tile3DLayer } from "@deck.gl/geo-layers";
export default class ExtendedTile3DLayer extends Tile3DLayer {
initializeState(state) {
super.initializeState();
console.log("This will be logged");
}
getShaders() {
console.log("This will not be logged")
return Object.assign({}, super.getShaders, {
fs: "color = vec4(1.0, 0.0, 0.0, 1.0);",
});
getLoadOptions() {
console.log("This won't as well :( ");
}
}
}
@RELNO Regarding your last comment, composite layers never call getShaders
. The Tile3DLayer renders ScenegraphLayer, which calls its own getShaders
. Extensions should theoretically work, though, I'll need to investigate.
@Pessimistress thanks, makes total sense. In terms of the sublayer (Scenegraph), two things to note:
{
key: "_make3DModelLayer",
value: function _make3DModelLayer(tileHeader) {
var _tileHeader$content2 = tileHeader.content,
gltf = _tileHeader$content2.gltf,
instances = _tileHeader$content2.instances,
cartographicOrigin = _tileHeader$content2.cartographicOrigin,
modelMatrix = _tileHeader$content2.modelMatrix;
// => here we can log the state/props and see that `extensions` are passed
LayerExtension
(as mentioned above) to a non-google source (such as archgis) on the very first load (i.e, before the texture parser warms up), it seems the shader does get passed down to the layer. This hints that the issue is with the lazy load nature of this data. Fixed in v8.9.20.
works great, thanks @Pessimistress!
Description
When using LayerExtension with simple frag shader, most layers are impacted, besides Tile3DLayer. Example below shows
Tile3DLayer
andTileLayer
.LayerExtension
only impactsTileLayer
(https://codesandbox.io/p/sandbox/small-water-fkrzcm) Note: this applies to all Tile3DLayer sources, regardless if its google 3d tiles, archgis, etc.Where Extension is:
Flavors
Expected Behavior
LayerExtension frag shader should apply to all layers
Steps to Reproduce
add LayerExtension with shader to Tile3DLayer. See here https://codesandbox.io/p/sandbox/small-water-fkrzcm
Environment
Logs
No response