Skip to content

Commit

Permalink
Export explicit glTF minFilter and magFilter values
Browse files Browse the repository at this point in the history
  • Loading branch information
tordanik committed Oct 1, 2024
1 parent f6260c5 commit dac4207
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/org/osm2world/core/target/gltf/GltfTarget.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ private int createTexture(TextureData textureData) throws IOException {
if (textureIndexMap.containsKey(textureData)) return textureIndexMap.get(textureData);

GltfSampler sampler = new GltfSampler();
sampler.magFilter = GltfSampler.LINEAR;
sampler.minFilter = GltfSampler.LINEAR_MIPMAP_LINEAR;
switch (textureData.wrap) {
case CLAMP -> {
sampler.wrapS = GltfSampler.WRAP_CLAMP_TO_EDGE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ public class GltfSampler {
public static final int WRAP_MIRRORED_REPEAT = 33648;
public static final int WRAP_REPEAT = 10497;

public static final int NEAREST = 9728;
public static final int LINEAR = 9729;
public static final int NEAREST_MIPMAP_NEAREST = 9984;
public static final int LINEAR_MIPMAP_NEAREST = 9985;
public static final int NEAREST_MIPMAP_LINEAR = 9986;
public static final int LINEAR_MIPMAP_LINEAR = 9987;

public @Nullable Integer minFilter;
public @Nullable Integer magFilter;
public @Nullable Integer wrapS;
Expand Down

0 comments on commit dac4207

Please sign in to comment.