All Questions
64
questions
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 ...
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.
...
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 ...
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 ...
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 ...
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 ...
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 ...
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....
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....
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...