EDIT i just decided making 6 textures would be easiest, 1 texture would be less file space but images are massive so it’s fine.
So I have a 3D cube that has 6 different colors on each side.
I’ve decided to place a grid on each side of the cube to show where a “slot” is for later usage.
So instead of making 6 different textures and applying them to each side, I made 1 texture with a grid pattern with fully transparent blocks and slightly transparent blocks forming sort of a chess board,
EDIT the opacity on the grey dots color is rgba(0,0,0,24)
Using this grid I applied it like so
let textureLoader = new THREE.TextureLoader();
let gridTexture = new textureLoader.load("./../../textures/grid.png");
//later in a function called for all 6 sides
mesh = new THREE.Mesh(
new THREE.ShapeGeometry(shape),
new THREE.MeshPhongMaterial({
map:gridTexture,
color: main.cubeFaces[side].color || 0xFF0000 ,
}),
);
which creates all the semi-transparent to black… I know its the semi-transparent blocks by changing 1 block in the image to a different color
changing transparent: true
makes everything black with a super dark grey pattern
I’ve tried alphaTest:0.5
and opacity:0.5
and even tested around with normalMap:gridTexture
so far I cant get what i want… the closest being
mesh = new THREE.Mesh(
new THREE.ShapeGeometry(shape),
new THREE.MeshPhongMaterial({
normalMap:gridTexture,
color: main.cubeFaces[side].color || 0xFF0000 ,
}),
);
which looks like
but i need the semi-grey to be more transparent.
i made the shape using 6 2D planes if that makes a difference
EDIT after proof reading i didnt think my question was entirely clear, my question is
how to get the slight transparent squares to be slightly transparent as a texture and the fully transparent completely transparent as a texture