Three js, block textures are blured

Antoine Duval

I'm trying to make a 3D block with the three.js library.
I've done it. Now i wan't to put a texture on it. I did that and it's working :

var textureHerbe = [
     new THREE.MeshBasicMaterial({map:THREE.ImageUtils.loadTexture('img/texture/herbe/border.gif')}),
     new THREE.MeshBasicMaterial({map:THREE.ImageUtils.loadTexture('img/texture/herbe/border.gif')}),
     new THREE.MeshBasicMaterial({map:THREE.ImageUtils.loadTexture('img/texture/herbe/top.gif')}),
     new THREE.MeshBasicMaterial({map:THREE.ImageUtils.loadTexture('img/texture/herbe/bottom.gif')}),
     new THREE.MeshBasicMaterial({map:THREE.ImageUtils.loadTexture('img/texture/herbe/border.gif')}),
     new THREE.MeshBasicMaterial({map:THREE.ImageUtils.loadTexture('img/texture/herbe/border.gif')})
];

Thats the result :
enter image description here
But look at this, it's blured !
So i looked at this this link. And i don't know how to mix my code with his solution's code :/
Do you jnow how i can do it ? Thx and have a good day.

gaitat

First of all you are loading the same texture several times. So assign it to a variable and then make the textures resolution-independent and render without blurriness.

var border_tex = new THREE.ImageUtils.loadTexture('img/texture/herbe/border.gif');
border_tex.magFilter = THREE.NearestFilter;
border_tex.minFilter = THREE.LinearMipMapLinearFilter;

var top_tex = new THREE.ImageUtils.loadTexture('img/texture/herbe/top.gif');
top_tex.magFilter = THREE.NearestFilter;
top_tex.minFilter = THREE.LinearMipMapLinearFilter;

var bottom_tex = new THREE.ImageUtils.loadTexture('img/texture/herbe/bottom.gif');
bottom_tex.magFilter = THREE.NearestFilter;
bottom_tex.minFilter = THREE.LinearMipMapLinearFilter;

var textureHerbe = [
    new THREE.MeshBasicMaterial( { map: border_tex } ),
    new THREE.MeshBasicMaterial( { map: border_tex } ),
    new THREE.MeshBasicMaterial( { map: top_tex } ),
    new THREE.MeshBasicMaterial( { map: bottom_tex } ),
    new THREE.MeshBasicMaterial( { map: border_tex } ),
    new THREE.MeshBasicMaterial( { map: border_tex } ),
];

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

three.js: BufferGeometry and textures

From Dev

Textures are Black in Three.JS

From Dev

three.js mesh with many textures

From Dev

Rotating textures using canvas with Three.js

From Dev

User uploaded textures in three.js

From Dev

Three js transparency issue with PointClouds and textures

From Dev

Three.js Merge objects and textures

From Dev

Two canvases as textures for plane in three.js

From Dev

Export from Blender to Three js with Textures

From Dev

square textures for circular particles in three.js

From Dev

Is three.js ObjectLoader capable of loading textures?

From Dev

Three.js: Passing array of textures to shaderMaterial

From Dev

preloading multiple textures in with Three.js THREE.textureLoader

From Dev

Load textures from Base64 in Three.js

From Dev

Applying Textures to Non-Cube Polyhedra with Three.js

From Dev

Changing textures for specific faces on the fly in three.js

From Dev

Managing z-buffering with transparent textures in Three.js

From Dev

Three.js Multiple textures and images in one scene

From Dev

How to import model and associated textures into three.js from Blender?

From Dev

How do I repeat textures without stretching in Three.js?

From Dev

THREE.js Imported model doesn't apply face textures

From Dev

Cloning textures without causing duplicate card memory in THREE.js

From Dev

Can you reflect geometry (not textures) in three.js?

From Dev

Is there a way to make a custom transition between textures in three.js

From Dev

How to add front and Back textures in Three.js shape geometry?

From Dev

Three.js Multiple textures and images in one scene

From Dev

Cloning textures without causing duplicate card memory in THREE.js

From Dev

Three.js Cube - Different textures didn't work

From Dev

Voxelizing in three.js — particle materials from Textures

Related Related

  1. 1

    three.js: BufferGeometry and textures

  2. 2

    Textures are Black in Three.JS

  3. 3

    three.js mesh with many textures

  4. 4

    Rotating textures using canvas with Three.js

  5. 5

    User uploaded textures in three.js

  6. 6

    Three js transparency issue with PointClouds and textures

  7. 7

    Three.js Merge objects and textures

  8. 8

    Two canvases as textures for plane in three.js

  9. 9

    Export from Blender to Three js with Textures

  10. 10

    square textures for circular particles in three.js

  11. 11

    Is three.js ObjectLoader capable of loading textures?

  12. 12

    Three.js: Passing array of textures to shaderMaterial

  13. 13

    preloading multiple textures in with Three.js THREE.textureLoader

  14. 14

    Load textures from Base64 in Three.js

  15. 15

    Applying Textures to Non-Cube Polyhedra with Three.js

  16. 16

    Changing textures for specific faces on the fly in three.js

  17. 17

    Managing z-buffering with transparent textures in Three.js

  18. 18

    Three.js Multiple textures and images in one scene

  19. 19

    How to import model and associated textures into three.js from Blender?

  20. 20

    How do I repeat textures without stretching in Three.js?

  21. 21

    THREE.js Imported model doesn't apply face textures

  22. 22

    Cloning textures without causing duplicate card memory in THREE.js

  23. 23

    Can you reflect geometry (not textures) in three.js?

  24. 24

    Is there a way to make a custom transition between textures in three.js

  25. 25

    How to add front and Back textures in Three.js shape geometry?

  26. 26

    Three.js Multiple textures and images in one scene

  27. 27

    Cloning textures without causing duplicate card memory in THREE.js

  28. 28

    Three.js Cube - Different textures didn't work

  29. 29

    Voxelizing in three.js — particle materials from Textures

HotTag

Archive