-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Draping Imagery on 3D Tiles #12567
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
Draping Imagery on 3D Tiles #12567
Changes from 14 commits
af6a769
0b67e70
d9907b3
927d55d
76a4f9a
9defb46
b59b323
2bd118a
6c1791d
f1c5768
34680af
8590207
61dcb2a
6bc30cf
96a2524
a5821d6
f1034d6
4c3a45b
d1f2593
7053786
7fed864
ff41e22
9865317
74adba5
19fe968
9ece74d
1b2a151
59e691b
99e7003
40b25d3
19969bc
fa09975
b6d0156
99a44d8
89fb5c6
f7be876
2d972b4
4fe3c9a
b381139
1d16174
483d0e3
0292545
59f3603
ca3a8c3
341e0e2
7d8eaa9
b960dd7
ed87411
c65f2c5
ed35a61
9d5f8e9
2d987c2
47c872b
8d49670
b0d22cf
8678b6c
1f0b0d1
3b873c1
d33ef0b
8abec54
7ab376c
2694de3
373e02a
71fbb0f
f29a182
017b160
59e2b03
5ae1be1
7cf03b4
28c6458
2d01840
e159ecd
df4570d
3f998aa
b4b522f
5e71bb4
f08887f
0e3a836
baa2145
275c8ed
0faeb6c
6b95f87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* A class containing a the values that affect the appearance of | ||
* an <code>ImageryLayer</code>. | ||
* | ||
* This is used in the <code>ModelImagery</code> to detect changes in | ||
* the imagery settings: The <code>ModelImagery</code> stores one | ||
* instance per imagery layer. During the <code>update</code> | ||
* call, it checks whether any of the settings was changed. | ||
* If this is the case, the draw commands of the model are reset. | ||
*/ | ||
class ImageryConfiguration { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a simple, flat object intended to group properties, would it make sense to define this with a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should also be marked There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment above |
||
constructor(imageryLayer) { | ||
this.alpha = imageryLayer.alpha; | ||
this.brightness = imageryLayer.brightness; | ||
this.contrast = imageryLayer.contrast; | ||
this.hue = imageryLayer.hue; | ||
this.saturation = imageryLayer.saturation; | ||
this.gamma = imageryLayer.gamma; | ||
this.colorToAlpha = imageryLayer.colorToAlpha; | ||
} | ||
} | ||
|
||
export default ImageryConfiguration; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* A structure containing information about a piece of imagery. | ||
* | ||
* This represents the result of computing the imagery tiles that | ||
* are covered by a given <code>Rectangle</code> (and which part | ||
* of that imagery is covered, in terms of texture coordinates). | ||
* | ||
* It is used by the <code>ModelPrimitiveImagery</code>, to | ||
* represent the imagery tiles that are covered by the cartographic | ||
* bounding rectangle of the primitive positions. | ||
* | ||
* TODO_DRAPING: Implementation note for ImageryCoverage: | ||
* This roughly corresponds to the <code>TileImagery</code> that is | ||
* created in my favorite draping-related time sink, namely in | ||
* <code>ImageryLayer._createTileImagerySkeletons</code>. | ||
* But in contrast to the <code>TileImagery</code>, this describes | ||
* <i>which</i> imagery tile is used, does not store the ("loading" | ||
* and "ready"...) imagery <i>itself</i>. | ||
*/ | ||
class ImageryCoverage { | ||
javagl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/** | ||
* Creates a new instance | ||
* | ||
* @param {number} x x-coordinate of the imagery tile | ||
* @param {number} y y-coordinate of the imagery tile | ||
* @param {number} level level of the imagery tile | ||
* @param {Cartesian4} textureCoordinateRectangle The texture coordinate | ||
* rectangle from the imagery tile that is covered, i.e. the | ||
* (minU, minV, maxU, maxV) coordinate range. | ||
*/ | ||
constructor(x, y, level, textureCoordinateRectangle) { | ||
/** | ||
* The x-coordinate of the imagery tile | ||
javagl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* @type {number} | ||
* @readonly | ||
javagl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
this.x = x; | ||
|
||
/** | ||
* The x-coordinate of the imagery tile | ||
javagl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* @type {number} | ||
* @readonly | ||
*/ | ||
this.y = y; | ||
|
||
/** | ||
* The x-coordinate of the imagery tile | ||
javagl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* @type {number} | ||
* @readonly | ||
*/ | ||
this.level = level; | ||
|
||
/** | ||
* The texture coordinate range that is covered from the | ||
* imagery tile. | ||
* | ||
* This is a <code>Cartesian4</code> that contains the | ||
* (minU, minV, maxU, maxV) coordinate range. | ||
* | ||
* @type {Cartesian4} | ||
* @readonly | ||
*/ | ||
this.textureCoordinateRectangle = textureCoordinateRectangle; | ||
javagl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
||
export default ImageryCoverage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an
@example
here? And add a 3D Tiles@example
to the documentation forImageryLayer
as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GeoJSON should work. (I just tried it with basic examples, and... these are just
Model
instances, eventually). Not sure about vector data. I3DM is tricky.... it ""works"", but all instances have the same texture, so it's not really "draped" (based on the instance position).I now listed the types explicitly:
"The imagery will be draped over glTF, B3DM, PNTS, or GeoJSON tile content."
I'm not sure whether this is the right place. It's may not be "relevant" for users insofar that they cannot change the behavior. One could say something like
"The imagery level will be picked based on the bounding box size of the cartographic positions of the model primitives"
or so, but ... I think that those who understand this information don't really need it 😆
I have added an
@example
here. But theImageryLayer
has nothing to do with theCesium3DTileset
. (Yes, the tileset can use the imagery layers, but ... I'm thinking about the "direction of dependency" here...).One could consider to change the existing examples in
ImageryLayer
fromscene.imageryLayers.add(imageryLayer);
to
imageryLayers.add(imageryLayer);
or even
imageryLayerCollection.add(imageryLayer);
Otherwise, that change would be to just duplicate one of the existing examples, and replacing
scene.
withtileset.
....Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. That @example was not intentional. I know your pain. One of my GitHub names is "gpu", and there are often things that are happening @gpu ("at the GPU")....