Am I correct in understanding that imagery_layers will support e.g. tiled png image overlays with transparency as generated by maptiler [0] etc. Is there a sample in sandcastle that demonstrates that?
I saw a non-tiled image example in sandcastle 'materials' (for which the texture wasn't working for me when I run locally).
./Tools/apache-ant-1.8.2/bin/ant runServer
I also noticed OpenStreetMapImageryProvider.js which seemed to be forming a url in the appropriate way, but didn't see an example of usage as an overlay.
Am I correct in understanding terrain is tessellated and displaced on the javascript side rather than in a vertex shader as per webglearth?
I figured it would still be possible to push an area down in altitude via the vertex shader. The intent would be that it could then be interactive without having to rebuild terrain. I tried modifying e.g. position3DWC in CentralBodyVS.glsl but that didn't appear to do what I expected.
Is there an approximate timeline for when terrain and imagery_layers will be merged into master?
I noticed in the terrain sample there's often a step edge around where land meets sea. Is this just due to the altitude data used?
Assuming earth geometry can be pushed out of the way easily, what other problems do you foresee in rendering geometry several km below the earth surface?
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To post to this group, send email to cesiu...@googlegroups.com.
To unsubscribe from this group, send email to cesium-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cesium-dev?hl=en.
Hi Chris,I can answer a few of these. Kevin and Scott will probably provide more details.Am I correct in understanding that imagery_layers will support e.g. tiled png image overlays with transparency as generated by maptiler [0] etc. Is there a sample in sandcastle that demonstrates that?
I believe so. You would use SingleTileProvider. I don't know if there is an example with overlaps yet, but there is a Sandcastle example with just a single image. When running a local web server, browse to http://localhost:8080/Apps/Sandcastle/index.html?src=Imagery.html
I also noticed OpenStreetMapImageryProvider.js which seemed to be forming a url in the appropriate way, but didn't see an example of usage as an overlay.There is is Sandcastle example for using the provider. When running your local web server, browse to http://localhost:8080/Apps/Sandcastle/index.html?src=Imagery.html
Am I correct in understanding terrain is tessellated and displaced on the javascript side rather than in a vertex shader as per webglearth?Yes. Among other issues, if the vertex shader is reading from textures, not all hardware supports that (well WebGL guarantees that it is supported, but the guaranteed minimum number of textures we can read from is zero).
I figured it would still be possible to push an area down in altitude via the vertex shader. The intent would be that it could then be interactive without having to rebuild terrain. I tried modifying e.g. position3DWC in CentralBodyVS.glsl but that didn't appear to do what I expected.Kevin will know better than me, but I suspect you'll be able to displace the vertices along the opposite of their geodetic surface normals.
Is there an approximate timeline for when terrain and imagery_layers will be merged into master?imagery_layers will come in first, followed by terrain. Since I'm not doing the work, I won't put words in anyone's mouth.
I noticed in the terrain sample there's often a step edge around where land meets sea. Is this just due to the altitude data used?Kevin can confirm but I suspect this is the nature of the SRTM data used.
Assuming earth geometry can be pushed out of the way easily, what other problems do you foresee in rendering geometry several km below the earth surface?The terrain code may need some tweaks. For example, to prevent cracks between tiles, we drop down skirts to the WGS84 ellipsoid. If these tiles are below the ellipsoid, we need to be careful not to "drop" skirts up to the ellipsoid, and we may want adjacent tiles that are not subterranean to drop their skirts all the way down to the subterranean tiles, not just the ellipsoid. These are things we need to handle eventually - if we don't already - to support undersea terrain. I can't say they are on the short-term radar though, but contributions are always welcome.
As a follow on, I've been able to make a bit of progress with pushing
the ground down (see attached image). I've only noticed a couple of
artefacts so far...
- Tile on bottom right of image is being frustum culled since the
un-displaced tile is outside the view frustum. In the past I've used
a modified frustum (eg greater fov and/or push it back slightly) for
culling than for rendering to get around this sort of issue.
- Atmosphere stops at un-displaced globe surface resulting in a black
band on the horizon. I assume this should be straightforward for me
to address.
This is the modification I made to CentralBodyVS. Is it ok to be
using position3DWC to generate a normal since position3D is in tile
space? Is the offset I'm applying in metres?
vec4 getPosition3DMode(vec3 position3DWC)
{
float os = -10000.0; // altitude push (units?)
vec3 geodeticNormal = normalize(position3DWC); // use incoming
position as geodetic normal
vec2 txCoord = czm_ellipsoidWgs84TextureCoordinates(geodeticNormal);
float mx = 0.906; // cutoff point in texture coords
v_push = smoothstep(mx, mx + 0.00005, txCoord.x); // to push
or not to push
vec3 pmod = position3D + v_push * geodeticNormal * os;
return u_modifiedModelViewProjection * vec4(pmod, 1.0);
}
Btw it might be more intuitive (for me at least :-) ) if the
heightScale/heightOffset values in the terrain providers were
multipliers rather than divisors. At the moment you make the scale
smaller to get larger mountains.
I'm located in Australia so it was night time in the USA when I was testing. This makes most of the 'materials' examples turn black ;-) Maybe it's worth exposing the illumination toggle for that example?
scene.setSunPosition(Cesium.computeSunPosition(new Cesium.JulianDate()));
scene.setSunPosition(scene.getCamera().position);
Is there another sphere rendered as black that sits below the surface that I'd also need to displace? What I'm seeing may just be the way the atmosphere renders.
Tile on bottom right of image is being frustum culled since the un-displaced tile is outside the view frustum. In the past I've used a modified frustum (eg greater fov and/or push it back slightly) for culling than for rendering to get around this sort of issue.
Maybe you've already considered using an approach that also applies a distance attenuation (fog) to scene geometry? If the current atmosphere model doesn't support it, this one [0] does a nice job.
I'm really impressed with what I've seen so far of Cesium in terms of functionality, documentation, license and support.
Maybe in the meantime someone can tell me how to set a view as per the 'camera reference frames' example, but retain the ability to pan across the earth rather than be locked looking at the one location?
var extent = new Cesium.Extent(west, south, east, north);scene.viewExtent(extent, Cesium.Ellipsoid.WGS84);
An investigation of their geometry tile technique [2] sounded similar to something you mention in the Cesium terrain roadmap.
Kevin, I managed to get a MapTiler based image layer working using the
latest imagery_layers branch and setting up a
TileMapServiceImageryProvider.js. The only differences from
OpenStreetMapImageryProvider.js were...
- flipping the y tile index
- limiting the extent
At the moment I set up a separate _extent member var as I wasn't sure
whether it was safe to modify the one in _tilingScheme. I've attached
the code and an example for your consideration though I thought it
might make more sense to combine the code of TMS and OSM. For this
reason I have only done the minimum effort required to get it working.
Also, is it possible to determine an imagery layer id within e.g.
sampleAndBlend() of CentralBodyFS.glsl? e.g. I have a Bing map layer,
and a custom TMS layer overlayed and I want to apply a fragment shader
operation just to the TMS layer. I have a workaround at the moment
based on texture ids but it has some rendering artefacts.