Add existing to tracked
This commit is contained in:
Generated
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
in vec3 v_positionEC;
|
||||
in vec3 v_normalEC;
|
||||
in vec3 v_tangentEC;
|
||||
in vec3 v_bitangentEC;
|
||||
in vec2 v_st;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 positionToEyeEC = -v_positionEC;
|
||||
mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);
|
||||
|
||||
vec3 normalEC = normalize(v_normalEC);
|
||||
#ifdef FACE_FORWARD
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
|
||||
#endif
|
||||
|
||||
czm_materialInput materialInput;
|
||||
materialInput.normalEC = normalEC;
|
||||
materialInput.tangentToEyeMatrix = tangentToEyeMatrix;
|
||||
materialInput.positionToEyeEC = positionToEyeEC;
|
||||
materialInput.st = v_st;
|
||||
czm_material material = czm_getMaterial(materialInput);
|
||||
|
||||
#ifdef FLAT
|
||||
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
||||
#else
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
||||
#endif
|
||||
}
|
||||
Generated
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 v_positionEC;\n\
|
||||
in vec3 v_normalEC;\n\
|
||||
in vec3 v_tangentEC;\n\
|
||||
in vec3 v_bitangentEC;\n\
|
||||
in vec2 v_st;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec3 positionToEyeEC = -v_positionEC;\n\
|
||||
mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\n\
|
||||
\n\
|
||||
vec3 normalEC = normalize(v_normalEC);\n\
|
||||
#ifdef FACE_FORWARD\n\
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\
|
||||
#endif\n\
|
||||
\n\
|
||||
czm_materialInput materialInput;\n\
|
||||
materialInput.normalEC = normalEC;\n\
|
||||
materialInput.tangentToEyeMatrix = tangentToEyeMatrix;\n\
|
||||
materialInput.positionToEyeEC = positionToEyeEC;\n\
|
||||
materialInput.st = v_st;\n\
|
||||
czm_material material = czm_getMaterial(materialInput);\n\
|
||||
\n\
|
||||
#ifdef FLAT\n\
|
||||
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\
|
||||
#else\n\
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n\
|
||||
#endif\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
in vec3 position3DHigh;
|
||||
in vec3 position3DLow;
|
||||
in vec3 normal;
|
||||
in vec3 tangent;
|
||||
in vec3 bitangent;
|
||||
in vec2 st;
|
||||
in float batchId;
|
||||
|
||||
out vec3 v_positionEC;
|
||||
out vec3 v_normalEC;
|
||||
out vec3 v_tangentEC;
|
||||
out vec3 v_bitangentEC;
|
||||
out vec2 v_st;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 p = czm_computePosition();
|
||||
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
||||
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
||||
v_tangentEC = czm_normal * tangent; // tangent in eye coordinates
|
||||
v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates
|
||||
v_st = st;
|
||||
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
||||
}
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 position3DHigh;\n\
|
||||
in vec3 position3DLow;\n\
|
||||
in vec3 normal;\n\
|
||||
in vec3 tangent;\n\
|
||||
in vec3 bitangent;\n\
|
||||
in vec2 st;\n\
|
||||
in float batchId;\n\
|
||||
\n\
|
||||
out vec3 v_positionEC;\n\
|
||||
out vec3 v_normalEC;\n\
|
||||
out vec3 v_tangentEC;\n\
|
||||
out vec3 v_bitangentEC;\n\
|
||||
out vec2 v_st;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec4 p = czm_computePosition();\n\
|
||||
\n\
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n\
|
||||
v_normalEC = czm_normal * normal; // normal in eye coordinates\n\
|
||||
v_tangentEC = czm_normal * tangent; // tangent in eye coordinates\n\
|
||||
v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates\n\
|
||||
v_st = st;\n\
|
||||
\n\
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
in vec3 v_positionEC;
|
||||
in vec3 v_normalEC;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 positionToEyeEC = -v_positionEC;
|
||||
|
||||
vec3 normalEC = normalize(v_normalEC);
|
||||
#ifdef FACE_FORWARD
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
|
||||
#endif
|
||||
|
||||
czm_materialInput materialInput;
|
||||
materialInput.normalEC = normalEC;
|
||||
materialInput.positionToEyeEC = positionToEyeEC;
|
||||
czm_material material = czm_getMaterial(materialInput);
|
||||
|
||||
#ifdef FLAT
|
||||
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
||||
#else
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
||||
#endif
|
||||
}
|
||||
Generated
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 v_positionEC;\n\
|
||||
in vec3 v_normalEC;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec3 positionToEyeEC = -v_positionEC;\n\
|
||||
\n\
|
||||
vec3 normalEC = normalize(v_normalEC);\n\
|
||||
#ifdef FACE_FORWARD\n\
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\
|
||||
#endif\n\
|
||||
\n\
|
||||
czm_materialInput materialInput;\n\
|
||||
materialInput.normalEC = normalEC;\n\
|
||||
materialInput.positionToEyeEC = positionToEyeEC;\n\
|
||||
czm_material material = czm_getMaterial(materialInput);\n\
|
||||
\n\
|
||||
#ifdef FLAT\n\
|
||||
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\
|
||||
#else\n\
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n\
|
||||
#endif\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
in vec3 position3DHigh;
|
||||
in vec3 position3DLow;
|
||||
in vec3 normal;
|
||||
in float batchId;
|
||||
|
||||
out vec3 v_positionEC;
|
||||
out vec3 v_normalEC;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 p = czm_computePosition();
|
||||
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
||||
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
||||
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
||||
}
|
||||
Generated
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 position3DHigh;\n\
|
||||
in vec3 position3DLow;\n\
|
||||
in vec3 normal;\n\
|
||||
in float batchId;\n\
|
||||
\n\
|
||||
out vec3 v_positionEC;\n\
|
||||
out vec3 v_normalEC;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec4 p = czm_computePosition();\n\
|
||||
\n\
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n\
|
||||
v_normalEC = czm_normal * normal; // normal in eye coordinates\n\
|
||||
\n\
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
in vec3 v_positionMC;
|
||||
in vec3 v_positionEC;
|
||||
in vec2 v_st;
|
||||
|
||||
void main()
|
||||
{
|
||||
czm_materialInput materialInput;
|
||||
|
||||
vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
|
||||
#ifdef FACE_FORWARD
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
|
||||
#endif
|
||||
|
||||
materialInput.s = v_st.s;
|
||||
materialInput.st = v_st;
|
||||
materialInput.str = vec3(v_st, 0.0);
|
||||
|
||||
// Convert tangent space material normal to eye space
|
||||
materialInput.normalEC = normalEC;
|
||||
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
|
||||
|
||||
// Convert view vector to world space
|
||||
vec3 positionToEyeEC = -v_positionEC;
|
||||
materialInput.positionToEyeEC = positionToEyeEC;
|
||||
|
||||
czm_material material = czm_getMaterial(materialInput);
|
||||
|
||||
#ifdef FLAT
|
||||
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
||||
#else
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
||||
#endif
|
||||
}
|
||||
Generated
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 v_positionMC;\n\
|
||||
in vec3 v_positionEC;\n\
|
||||
in vec2 v_st;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
czm_materialInput materialInput;\n\
|
||||
\n\
|
||||
vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n\
|
||||
#ifdef FACE_FORWARD\n\
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\
|
||||
#endif\n\
|
||||
\n\
|
||||
materialInput.s = v_st.s;\n\
|
||||
materialInput.st = v_st;\n\
|
||||
materialInput.str = vec3(v_st, 0.0);\n\
|
||||
\n\
|
||||
// Convert tangent space material normal to eye space\n\
|
||||
materialInput.normalEC = normalEC;\n\
|
||||
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n\
|
||||
\n\
|
||||
// Convert view vector to world space\n\
|
||||
vec3 positionToEyeEC = -v_positionEC;\n\
|
||||
materialInput.positionToEyeEC = positionToEyeEC;\n\
|
||||
\n\
|
||||
czm_material material = czm_getMaterial(materialInput);\n\
|
||||
\n\
|
||||
#ifdef FLAT\n\
|
||||
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\
|
||||
#else\n\
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n\
|
||||
#endif\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
in vec3 position3DHigh;
|
||||
in vec3 position3DLow;
|
||||
in vec2 st;
|
||||
in float batchId;
|
||||
|
||||
out vec3 v_positionMC;
|
||||
out vec3 v_positionEC;
|
||||
out vec2 v_st;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 p = czm_computePosition();
|
||||
|
||||
v_positionMC = position3DHigh + position3DLow; // position in model coordinates
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
||||
v_st = st;
|
||||
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
||||
}
|
||||
Generated
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 position3DHigh;\n\
|
||||
in vec3 position3DLow;\n\
|
||||
in vec2 st;\n\
|
||||
in float batchId;\n\
|
||||
\n\
|
||||
out vec3 v_positionMC;\n\
|
||||
out vec3 v_positionEC;\n\
|
||||
out vec2 v_st;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec4 p = czm_computePosition();\n\
|
||||
\n\
|
||||
v_positionMC = position3DHigh + position3DLow; // position in model coordinates\n\
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n\
|
||||
v_st = st;\n\
|
||||
\n\
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
in vec3 v_positionEC;
|
||||
in vec3 v_normalEC;
|
||||
in vec4 v_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 positionToEyeEC = -v_positionEC;
|
||||
|
||||
vec3 normalEC = normalize(v_normalEC);
|
||||
#ifdef FACE_FORWARD
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
|
||||
#endif
|
||||
|
||||
vec4 color = czm_gammaCorrect(v_color);
|
||||
|
||||
czm_materialInput materialInput;
|
||||
materialInput.normalEC = normalEC;
|
||||
materialInput.positionToEyeEC = positionToEyeEC;
|
||||
czm_material material = czm_getDefaultMaterial(materialInput);
|
||||
material.diffuse = color.rgb;
|
||||
material.alpha = color.a;
|
||||
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
||||
}
|
||||
Generated
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 v_positionEC;\n\
|
||||
in vec3 v_normalEC;\n\
|
||||
in vec4 v_color;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec3 positionToEyeEC = -v_positionEC;\n\
|
||||
\n\
|
||||
vec3 normalEC = normalize(v_normalEC);\n\
|
||||
#ifdef FACE_FORWARD\n\
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\
|
||||
#endif\n\
|
||||
\n\
|
||||
vec4 color = czm_gammaCorrect(v_color);\n\
|
||||
\n\
|
||||
czm_materialInput materialInput;\n\
|
||||
materialInput.normalEC = normalEC;\n\
|
||||
materialInput.positionToEyeEC = positionToEyeEC;\n\
|
||||
czm_material material = czm_getDefaultMaterial(materialInput);\n\
|
||||
material.diffuse = color.rgb;\n\
|
||||
material.alpha = color.a;\n\
|
||||
\n\
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
in vec3 position3DHigh;
|
||||
in vec3 position3DLow;
|
||||
in vec3 normal;
|
||||
in vec4 color;
|
||||
in float batchId;
|
||||
|
||||
out vec3 v_positionEC;
|
||||
out vec3 v_normalEC;
|
||||
out vec4 v_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 p = czm_computePosition();
|
||||
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
||||
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
||||
v_color = color;
|
||||
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
||||
}
|
||||
Generated
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 position3DHigh;\n\
|
||||
in vec3 position3DLow;\n\
|
||||
in vec3 normal;\n\
|
||||
in vec4 color;\n\
|
||||
in float batchId;\n\
|
||||
\n\
|
||||
out vec3 v_positionEC;\n\
|
||||
out vec3 v_normalEC;\n\
|
||||
out vec4 v_color;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec4 p = czm_computePosition();\n\
|
||||
\n\
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n\
|
||||
v_normalEC = czm_normal * normal; // normal in eye coordinates\n\
|
||||
v_color = color;\n\
|
||||
\n\
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
in vec4 v_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
out_FragColor = czm_gammaCorrect(v_color);
|
||||
}
|
||||
Generated
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec4 v_color;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
out_FragColor = czm_gammaCorrect(v_color);\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
in vec3 position3DHigh;
|
||||
in vec3 position3DLow;
|
||||
in vec4 color;
|
||||
in float batchId;
|
||||
|
||||
out vec4 v_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 p = czm_computePosition();
|
||||
|
||||
v_color = color;
|
||||
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
||||
}
|
||||
Generated
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 position3DHigh;\n\
|
||||
in vec3 position3DLow;\n\
|
||||
in vec4 color;\n\
|
||||
in float batchId;\n\
|
||||
\n\
|
||||
out vec4 v_color;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec4 p = czm_computePosition();\n\
|
||||
\n\
|
||||
v_color = color;\n\
|
||||
\n\
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
in vec3 position3DHigh;
|
||||
in vec3 position3DLow;
|
||||
in vec3 prevPosition3DHigh;
|
||||
in vec3 prevPosition3DLow;
|
||||
in vec3 nextPosition3DHigh;
|
||||
in vec3 nextPosition3DLow;
|
||||
in vec2 expandAndWidth;
|
||||
in vec4 color;
|
||||
in float batchId;
|
||||
|
||||
out vec4 v_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
float expandDir = expandAndWidth.x;
|
||||
float width = abs(expandAndWidth.y) + 0.5;
|
||||
bool usePrev = expandAndWidth.y < 0.0;
|
||||
|
||||
vec4 p = czm_computePosition();
|
||||
vec4 prev = czm_computePrevPosition();
|
||||
vec4 next = czm_computeNextPosition();
|
||||
|
||||
float angle;
|
||||
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
|
||||
gl_Position = czm_viewportOrthographic * positionWC;
|
||||
|
||||
v_color = color;
|
||||
}
|
||||
Generated
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 position3DHigh;\n\
|
||||
in vec3 position3DLow;\n\
|
||||
in vec3 prevPosition3DHigh;\n\
|
||||
in vec3 prevPosition3DLow;\n\
|
||||
in vec3 nextPosition3DHigh;\n\
|
||||
in vec3 nextPosition3DLow;\n\
|
||||
in vec2 expandAndWidth;\n\
|
||||
in vec4 color;\n\
|
||||
in float batchId;\n\
|
||||
\n\
|
||||
out vec4 v_color;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
float expandDir = expandAndWidth.x;\n\
|
||||
float width = abs(expandAndWidth.y) + 0.5;\n\
|
||||
bool usePrev = expandAndWidth.y < 0.0;\n\
|
||||
\n\
|
||||
vec4 p = czm_computePosition();\n\
|
||||
vec4 prev = czm_computePrevPosition();\n\
|
||||
vec4 next = czm_computeNextPosition();\n\
|
||||
\n\
|
||||
float angle;\n\
|
||||
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\n\
|
||||
gl_Position = czm_viewportOrthographic * positionWC;\n\
|
||||
\n\
|
||||
v_color = color;\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
in vec3 position3DHigh;
|
||||
in vec3 position3DLow;
|
||||
in vec3 prevPosition3DHigh;
|
||||
in vec3 prevPosition3DLow;
|
||||
in vec3 nextPosition3DHigh;
|
||||
in vec3 nextPosition3DLow;
|
||||
in vec2 expandAndWidth;
|
||||
in vec2 st;
|
||||
in float batchId;
|
||||
|
||||
out float v_width;
|
||||
out vec2 v_st;
|
||||
out float v_polylineAngle;
|
||||
|
||||
void main()
|
||||
{
|
||||
float expandDir = expandAndWidth.x;
|
||||
float width = abs(expandAndWidth.y) + 0.5;
|
||||
bool usePrev = expandAndWidth.y < 0.0;
|
||||
|
||||
vec4 p = czm_computePosition();
|
||||
vec4 prev = czm_computePrevPosition();
|
||||
vec4 next = czm_computeNextPosition();
|
||||
|
||||
float angle;
|
||||
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
|
||||
gl_Position = czm_viewportOrthographic * positionWC;
|
||||
|
||||
v_width = width;
|
||||
v_st.s = st.s;
|
||||
v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
|
||||
v_polylineAngle = angle;
|
||||
}
|
||||
Generated
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 position3DHigh;\n\
|
||||
in vec3 position3DLow;\n\
|
||||
in vec3 prevPosition3DHigh;\n\
|
||||
in vec3 prevPosition3DLow;\n\
|
||||
in vec3 nextPosition3DHigh;\n\
|
||||
in vec3 nextPosition3DLow;\n\
|
||||
in vec2 expandAndWidth;\n\
|
||||
in vec2 st;\n\
|
||||
in float batchId;\n\
|
||||
\n\
|
||||
out float v_width;\n\
|
||||
out vec2 v_st;\n\
|
||||
out float v_polylineAngle;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
float expandDir = expandAndWidth.x;\n\
|
||||
float width = abs(expandAndWidth.y) + 0.5;\n\
|
||||
bool usePrev = expandAndWidth.y < 0.0;\n\
|
||||
\n\
|
||||
vec4 p = czm_computePosition();\n\
|
||||
vec4 prev = czm_computePrevPosition();\n\
|
||||
vec4 next = czm_computeNextPosition();\n\
|
||||
\n\
|
||||
float angle;\n\
|
||||
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\n\
|
||||
gl_Position = czm_viewportOrthographic * positionWC;\n\
|
||||
\n\
|
||||
v_width = width;\n\
|
||||
v_st.s = st.s;\n\
|
||||
v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);\n\
|
||||
v_polylineAngle = angle;\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
in vec3 v_positionEC;
|
||||
in vec3 v_normalEC;
|
||||
in vec2 v_st;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 positionToEyeEC = -v_positionEC;
|
||||
|
||||
vec3 normalEC = normalize(v_normalEC);
|
||||
#ifdef FACE_FORWARD
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
|
||||
#endif
|
||||
|
||||
czm_materialInput materialInput;
|
||||
materialInput.normalEC = normalEC;
|
||||
materialInput.positionToEyeEC = positionToEyeEC;
|
||||
materialInput.st = v_st;
|
||||
czm_material material = czm_getMaterial(materialInput);
|
||||
|
||||
#ifdef FLAT
|
||||
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
||||
#else
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
||||
#endif
|
||||
}
|
||||
Generated
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 v_positionEC;\n\
|
||||
in vec3 v_normalEC;\n\
|
||||
in vec2 v_st;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec3 positionToEyeEC = -v_positionEC;\n\
|
||||
\n\
|
||||
vec3 normalEC = normalize(v_normalEC);\n\
|
||||
#ifdef FACE_FORWARD\n\
|
||||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\
|
||||
#endif\n\
|
||||
\n\
|
||||
czm_materialInput materialInput;\n\
|
||||
materialInput.normalEC = normalEC;\n\
|
||||
materialInput.positionToEyeEC = positionToEyeEC;\n\
|
||||
materialInput.st = v_st;\n\
|
||||
czm_material material = czm_getMaterial(materialInput);\n\
|
||||
\n\
|
||||
#ifdef FLAT\n\
|
||||
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\
|
||||
#else\n\
|
||||
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n\
|
||||
#endif\n\
|
||||
}\n\
|
||||
";
|
||||
Generated
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
in vec3 position3DHigh;
|
||||
in vec3 position3DLow;
|
||||
in vec3 normal;
|
||||
in vec2 st;
|
||||
in float batchId;
|
||||
|
||||
out vec3 v_positionEC;
|
||||
out vec3 v_normalEC;
|
||||
out vec2 v_st;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 p = czm_computePosition();
|
||||
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
||||
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
||||
v_st = st;
|
||||
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
||||
}
|
||||
Generated
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
//This file is automatically rebuilt by the Cesium build process.
|
||||
export default "in vec3 position3DHigh;\n\
|
||||
in vec3 position3DLow;\n\
|
||||
in vec3 normal;\n\
|
||||
in vec2 st;\n\
|
||||
in float batchId;\n\
|
||||
\n\
|
||||
out vec3 v_positionEC;\n\
|
||||
out vec3 v_normalEC;\n\
|
||||
out vec2 v_st;\n\
|
||||
\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
vec4 p = czm_computePosition();\n\
|
||||
\n\
|
||||
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n\
|
||||
v_normalEC = czm_normal * normal; // normal in eye coordinates\n\
|
||||
v_st = st;\n\
|
||||
\n\
|
||||
gl_Position = czm_modelViewProjectionRelativeToEye * p;\n\
|
||||
}\n\
|
||||
";
|
||||
Reference in New Issue
Block a user