Is itr possible to hard code a very low polygon count for a Cesium3DTileset that doesnt change as I zoom in?
To effectively force an low poly effect that doesn’t change as you get closer, a bit like this:
Is itr possible to hard code a very low polygon count for a Cesium3DTileset that doesnt change as I zoom in?
To effectively force an low poly effect that doesn’t change as you get closer, a bit like this:
Welcome to the Cesium community Graham!
I love that aesthetic - I think achieving this would require you create that low poly look in your source data (like by using modifiers in Blender or similar tools). When you upload your 3D models to Cesium ion, you do get a “low poly” version when you’re zoomed out, but it’s still designed to approximate the original surface so you won’t get the same aesthetic.
What kind of project are you working on? What format is your source data? Or are you trying to do this on the Cesium World Terrain that’s already on Cesium ion?
It is for an art project - the only source data is world terrain.
What I was wondering was if any part of the renderer had a parameter that allowed the quality of the polygons generated to be configured right down to very low.
By coincidence, ESRI have released something similar but not with streaming data -
https://developers.arcgis.com/javascript/latest/sample-code/geometry-mesh-elevation/index.html
You can indeed change the quality setting, by increasing the maximum screen space error on the globe (see https://cesium.com/docs/cesiumjs-ref-doc/Globe.html?classFilter=globe#maximumScreenSpaceError). If you use the Cesium inspector (see https://sandcastle.cesium.com/index.html?src=Cesium%20Inspector.html) and trigger “Terrain > Wireframe” or “Terrain > show tile coordinates” you can see the exact tiles loading in.
But then a second piece to this is you’d need the right shading. From the article you linked, by default it’s going to look like the image on the right side, even if you get this low poly geometry:
Here’s what this looks like in CesiumJS. Move the timeline slider to change the lighting.
Flat shading isn’t actually supported in WebGL as far as I’m aware. You’d need to implement one of the solutions in this post, which I think requires modifying the source code. If you’re comfortable doing that, you can modify GlobeFS.glsl here: https://github.com/CesiumGS/cesium/blob/bb9f245cef5659b2d7020ce70cf072b9f6add92e/Source/Shaders/GlobeFS.glsl#L231.
First add #extension GL_OES_standard_derivatives : enable
at the very top of the file. Then your new main function would look like this:
void main()
{
vec3 U = dFdx(v_positionEC);
vec3 V = dFdy(v_positionEC);
vec3 N = normalize(cross(U,V));
gl_FragColor = vec4(N, 1.0);
return;
Here’s what the globe looks like this with this view:
And at the grand canyon:
Of course this is just visualizing the normal. You could apply any custom lighting equation here, or base it on the sun position etc. Let me know if you end up using this - I’d love to see how this art project turns out! It’s kind of fun playing with this stylized view of the global terrain.
that looks great! ill report back with what i come up with