Skip to content

Commit

Permalink
Support vec2, vec3, and vec4 as distinct types
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jan 6, 2017
1 parent 7726151 commit d76dade
Show file tree
Hide file tree
Showing 4 changed files with 470 additions and 167 deletions.
9 changes: 4 additions & 5 deletions Apps/Sandcastle/gallery/3D Tiles Point Cloud Styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
pointSize : "5"
});

// secondaryColor is originally a vec3 - so add vec4(0.0, 0.0, 0.0, 1.0) to make the point cloud opaque
addStyle('Clamp and Mix', {
color : "color() * clamp(${temperature}, 0.1, 0.2)",
pointSize : "mix(${temperature}, 2.0, 0.5) * 0.2"
Expand All @@ -143,9 +142,9 @@
addStyle('Secondary Color', {
color : {
conditions : [
["${id} < 250", "${secondaryColor} + vec4(0.0, 0.0, 0.0, 1.0)"],
["${id} < 500", "${secondaryColor} * ${secondaryColor} + vec4(0.0, 0.0, 0.0, 1.0)"],
["${id} < 750", "${secondaryColor} / 5.0 + vec4(0.0, 0.0, 0.0, 1.0)"],
["${id} < 250", "vec4(${secondaryColor}, 1.0)"],
["${id} < 500", "vec4(${secondaryColor} * ${secondaryColor}, 1.0)"],
["${id} < 750", "vec4(${secondaryColor} / 5.0, 1.0)"],
["${id} < 1000", "rgb(0, 0, Number(${secondaryColor}.x < 0.5) * 255)"]
]
}
Expand All @@ -161,7 +160,7 @@

// POSITION contains 0 as its last component, so add 1.0 to make the point cloud opaque
addStyle('Color based on position', {
color : "${POSITION} + vec4(0.0, 0.0, 0.0, 1.0)"
color : "vec4(${POSITION}, 1.0)"
});

addStyle('Style point size', {
Expand Down
Loading

0 comments on commit d76dade

Please sign in to comment.