mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-27 07:18:57 -06:00
Failed experiment with anisotropic filtering.
This commit is contained in:
@@ -167,9 +167,11 @@ namespace openspace {
|
||||
tileData->glType,
|
||||
Texture::FilterMode::Linear,
|
||||
Texture::WrappingMode::ClampToEdge);
|
||||
|
||||
|
||||
// The texture should take ownership of the data
|
||||
std::shared_ptr<Texture> texture = std::shared_ptr<Texture>(texturePtr);
|
||||
//texture->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap);
|
||||
|
||||
texture->uploadTexture();
|
||||
|
||||
MetaTexture metaTexture = { texture, tileIOResult->error };
|
||||
|
||||
@@ -59,10 +59,28 @@ Fragment getFragment() {
|
||||
colorTilesParent2[#{i}].uvTransform.uvScale * fs_uv +
|
||||
colorTilesParent2[#{i}].uvTransform.uvOffset;
|
||||
|
||||
|
||||
/*
|
||||
vec4 colorSample =
|
||||
w1 * textureLod(colorTiles[#{i}].textureSampler, samplePos, 0) +
|
||||
w2 * textureLod(colorTilesParent1[#{i}].textureSampler, samplePosParent1, 0) +
|
||||
w3 * textureLod(colorTilesParent2[#{i}].textureSampler, samplePosParent2, 0);
|
||||
*/
|
||||
|
||||
/*
|
||||
vec4 colorSample =
|
||||
w1 * textureGrad(colorTiles[#{i}].textureSampler, samplePos, vec2(0), vec2(0)) +
|
||||
w2 * textureGrad(colorTilesParent1[#{i}].textureSampler, samplePosParent1, vec2(0), vec2(0)) +
|
||||
w3 * textureGrad(colorTilesParent2[#{i}].textureSampler, samplePosParent2, vec2(0), vec2(0));
|
||||
*/
|
||||
|
||||
vec4 colorSample =
|
||||
w1 * texture(colorTiles[#{i}].textureSampler, samplePos) +
|
||||
w2 * texture(colorTilesParent1[#{i}].textureSampler, samplePosParent1) +
|
||||
w3 * texture(colorTilesParent2[#{i}].textureSampler, samplePosParent2);
|
||||
|
||||
|
||||
|
||||
frag.color = blendOver(frag.color, colorSample);
|
||||
}
|
||||
#endfor
|
||||
|
||||
@@ -93,11 +93,25 @@ void main()
|
||||
heightTilesParent2[#{i}].uvTransform.uvScale * in_uv +
|
||||
heightTilesParent2[#{i}].uvTransform.uvOffset;
|
||||
|
||||
|
||||
/*
|
||||
float sampledValue =
|
||||
w1 * textureLod(heightTiles[#{i}].textureSampler, samplePos, 0).r +
|
||||
w2 * textureLod(heightTilesParent1[#{i}].textureSampler, samplePosParent1, 0).r +
|
||||
w3 * textureLod(heightTilesParent2[#{i}].textureSampler, samplePosParent2, 0).r;
|
||||
*/
|
||||
/*
|
||||
float sampledValue =
|
||||
w1 * textureGrad(heightTiles[#{i}].textureSampler, samplePos, vec2(0), vec2(0)).r +
|
||||
w2 * textureGrad(heightTilesParent1[#{i}].textureSampler, samplePosParent1, vec2(0), vec2(0)).r +
|
||||
w3 * textureGrad(heightTilesParent2[#{i}].textureSampler, samplePosParent2, vec2(0), vec2(0)).r;
|
||||
*/
|
||||
float sampledValue =
|
||||
w1 * texture(heightTiles[#{i}].textureSampler, samplePos).r +
|
||||
w2 * texture(heightTilesParent1[#{i}].textureSampler, samplePosParent1).r +
|
||||
w3 * texture(heightTilesParent2[#{i}].textureSampler, samplePosParent2).r;
|
||||
|
||||
|
||||
|
||||
// TODO : Some kind of blending here. Now it just writes over
|
||||
height = (sampledValue *
|
||||
heightTiles[#{i}].depthTransform.depthScale +
|
||||
|
||||
@@ -61,10 +61,24 @@ Fragment getFragment() {
|
||||
colorTilesParent2[#{i}].uvTransform.uvScale * fs_uv +
|
||||
colorTilesParent2[#{i}].uvTransform.uvOffset;
|
||||
|
||||
|
||||
/*
|
||||
vec4 colorSample =
|
||||
w1 * textureLod(colorTiles[#{i}].textureSampler, samplePos, 0) +
|
||||
w2 * textureLod(colorTilesParent1[#{i}].textureSampler, samplePosParent1, 0) +
|
||||
w3 * textureLod(colorTilesParent2[#{i}].textureSampler, samplePosParent2, 0);
|
||||
*/
|
||||
vec4 colorSample =
|
||||
w1 * texture(colorTiles[#{i}].textureSampler, samplePos) +
|
||||
w2 * texture(colorTilesParent1[#{i}].textureSampler, samplePosParent1) +
|
||||
w3 * texture(colorTilesParent2[#{i}].textureSampler, samplePosParent2);
|
||||
/*
|
||||
vec4 colorSample =
|
||||
w1 * textureGrad(colorTiles[#{i}].textureSampler, samplePos, vec2(0), vec2(0)) +
|
||||
w2 * textureGrad(colorTilesParent1[#{i}].textureSampler, samplePosParent1, vec2(0), vec2(0)) +
|
||||
w3 * textureGrad(colorTilesParent2[#{i}].textureSampler, samplePosParent2, vec2(0), vec2(0));
|
||||
*/
|
||||
|
||||
frag.color = blendOver(frag.color, colorSample);
|
||||
}
|
||||
#endfor
|
||||
|
||||
@@ -96,11 +96,25 @@ void main()
|
||||
heightTilesParent2[#{i}].uvTransform.uvScale * in_uv +
|
||||
heightTilesParent2[#{i}].uvTransform.uvOffset;
|
||||
|
||||
|
||||
/*
|
||||
float sampledValue =
|
||||
w1 * textureLod(heightTiles[#{i}].textureSampler, samplePos, 0).r +
|
||||
w2 * textureLod(heightTilesParent1[#{i}].textureSampler, samplePosParent1, 0).r +
|
||||
w3 * textureLod(heightTilesParent2[#{i}].textureSampler, samplePosParent2, 0).r;
|
||||
*/
|
||||
/*
|
||||
float sampledValue =
|
||||
w1 * textureGrad(heightTiles[#{i}].textureSampler, samplePos, vec2(1), vec2(1)).r +
|
||||
w2 * textureGrad(heightTilesParent1[#{i}].textureSampler, samplePosParent1, vec2(1), vec2(1)).r +
|
||||
w3 * textureGrad(heightTilesParent2[#{i}].textureSampler, samplePosParent2, vec2(1), vec2(1)).r;
|
||||
*/
|
||||
float sampledValue =
|
||||
w1 * texture(heightTiles[#{i}].textureSampler, samplePos).r +
|
||||
w2 * texture(heightTilesParent1[#{i}].textureSampler, samplePosParent1).r +
|
||||
w3 * texture(heightTilesParent2[#{i}].textureSampler, samplePosParent2).r;
|
||||
|
||||
|
||||
|
||||
// TODO : Some kind of blending here. Now it just writes over
|
||||
height = (sampledValue *
|
||||
heightTiles[#{i}].depthTransform.depthScale +
|
||||
|
||||
Reference in New Issue
Block a user