mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-26 06:49:09 -06:00
Height mapping for chunked lod globe.
This commit is contained in:
@@ -58,8 +58,8 @@ namespace openspace {
|
||||
, maxSplitDepth(22)
|
||||
{
|
||||
auto geometry = std::shared_ptr<BasicGrid>(new BasicGrid(
|
||||
10,
|
||||
10,
|
||||
256,
|
||||
256,
|
||||
TriangleSoup::Positions::No,
|
||||
TriangleSoup::TextureCoordinates::Yes,
|
||||
TriangleSoup::Normals::No));
|
||||
|
||||
@@ -204,7 +204,7 @@ int ChunkNode::calculateDesiredLevelAndUpdateIsVisible(
|
||||
Scalar distance = glm::length(cameraToChunk);
|
||||
_owner.minDistToCamera = fmin(_owner.minDistToCamera, distance);
|
||||
|
||||
Scalar scaleFactor = 100 * minimumGlobeRadius;
|
||||
Scalar scaleFactor = 10 * minimumGlobeRadius;
|
||||
Scalar projectedScaleFactor = scaleFactor / distance;
|
||||
int desiredLevel = floor( log2(projectedScaleFactor) );
|
||||
return desiredLevel;
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace openspace {
|
||||
heightMapDictionary.getValue("FilePath", path);
|
||||
std::shared_ptr<TileProvider> heightMapProvider =
|
||||
std::shared_ptr<TileProvider>(new TileProvider(
|
||||
path, 5000, 512));
|
||||
path, 5000, 256));
|
||||
_tileProviderManager->addHeightMap(name, heightMapProvider);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ Fragment getFragment() {
|
||||
//frag.color = frag.color * 0.9 + 0.2*vec4(samplePos, 0, 1);
|
||||
|
||||
// Border overlay
|
||||
frag.color = frag.color + borderOverlay(fs_uv, vec3(0.5, 0.5, 0.5), 0.02);
|
||||
frag.color = frag.color;// + borderOverlay(fs_uv, vec3(0.5, 0.5, 0.5), 0.02);
|
||||
|
||||
frag.depth = vs_position.w;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ void main()
|
||||
|
||||
vec2 samplePos = heightSamplingScale*in_UV + heightSamplingOffset;
|
||||
float sampledHeight = texture(textureSamplerHeight, samplePos).r;
|
||||
pair.position += pair.normal * sampledHeight * 1e1;
|
||||
pair.position += pair.normal * sampledHeight * pow(2,15);
|
||||
|
||||
vec4 position = modelViewProjectionTransform * vec4(pair.position, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user