Skip to main content

All Questions

Tagged with
33 votes
1 answer
27k views

Multiple transparent textures on the same mesh face in Three.js

Is it possible to lay multiple textures on top of each other on the same face in Three.js so that the alpha blending is done GPU accelerated in webGL? The textures are (or should be) applied to the ...
Timo Kähkönen's user avatar
8 votes
2 answers
25k views

Three.js multiple materials on object loaded via OBJMTLLoader

I have ".obj" and ".mtl" files of a model and I'm loading it via OBJMTLLoader. ".mtl" specifies texture to apply to a model, and three.js loads model and renders it with applied texture just fine. ...
kangax's user avatar
  • 39.1k
10 votes
2 answers
9k views

How can I put two different textures on the front and back of a plane?

PRoblem: i'm trying to create (just for fun) a simple poker card (with a card back and a card front). I have two different images, for back and front. I easily created a Plane geometry with a single ...
user1561017's user avatar
1 vote
1 answer
3k views

Texture atlas offset/repeat works for meshes but is ignored for point system particles

I am using a texture atlas to hold a sequence of images. When mapping to a mesh with MeshLambertMaterial, using Texture.offset and Texture.repeat works beautifully to cut the subtexture out of the ...
jnm2's user avatar
  • 8,236
22 votes
2 answers
42k views

Three.js texture / image update at runtime

I am trying to change a cube image at run time by selecting an option from Select Form element. When running the code, the image changes after selecting, but the previous cube and image stays in the ...
Miloud Eloumri's user avatar
12 votes
1 answer
9k views

How to disable three.js to resize images in power of two?

three.js automatically resizes the texture image, if it is not power of two. In my case am using a custom canvas as texture , which is not power of two.while resizing makes the texture not appearing ...
ArUn's user avatar
  • 1,337
7 votes
1 answer
3k views

Retrieve Vertices Data in THREE.js

I'm creating a mesh with a custom shader. Within the vertex shader I'm modifying the original position of the geometry vertices. Then I need to access to this new vertices position from outside the ...
MickeyMouse's user avatar
6 votes
4 answers
16k views

THREE.js - Can't load texture locally

I have a local file in which I try to load texture like this: var texture = THREE.ImageUtils.loadTexture( 'image.jpg' ); var cubeGeo = new THREE.CubeGeometry( 50, 50, 50 ); var cubeMat = new THREE....
Daew's user avatar
  • 419
5 votes
1 answer
6k views

Extruding multiple polygons with multiple holes and texturing the combined shape

This question is related to this question. The answer shows very nice way to extrude polygons that have holes (see the excellent live example). The main learning of the answer was that paths in three....
Timo Kähkönen's user avatar
3 votes
2 answers
5k views

Can a three.js material have separate repeat values for a bump map and a texture map?

I'm trying to break up the repetition in my texture by applying a bump map which repeats much less frequently. Unfortunately, it seems to take on the repeat value of 'landTexture' below (64), instead ...
shino's user avatar
  • 4,684
13 votes
2 answers
35k views

Three.js Update Texture image

I'm using three.js to create a minecraft texture editor, similar to this. I'm just trying to get the basic click-and-paint functionality down, but I can't seem to figure it out. I currently have ...
shaqb4's user avatar
  • 283
9 votes
3 answers
14k views

How to repeat the texture map like GL_REPEAT?

I have a house model in my game, and I have some materials for the house geometry. There is a material for the wall of the house, and I have a texture-map-image to show the bricks. var mat = new ...
user1497753's user avatar
5 votes
1 answer
5k views

Three.js Efficiently Mapping Uvs to Plane

I'm working on a game where there are many walls of the same texture but at different lengths/heights. Currently I am cloning a base texture and setting the repeat values for each wall. This creates ...
Hobbes's user avatar
  • 791
5 votes
1 answer
7k views

Three.js - multiple material plane

I'm trying to have multiple materials on a single plane to make a simple terrain editor. So I create a couple of materials, and try to assign a material index to each vertex in my plane: var materials ...
David Menard's user avatar
  • 2,311
4 votes
1 answer
10k views

Is it possible to use a 2d canvas as a texture for a cube?

I want to add images to one face of a cube, possibly using a 2d canvas element as the face texture. Here is my code, but I can't get the result I want. The face using the canvas as a texture is blank, ...
user2326908's user avatar

15 30 50 per page
1
2 3 4 5