I have one material with shader code and I tried to make that shader inside a function so that it can be used for another material
I have two planes with the same characteristics only difference is what color to pass in each plane Mesh.
I am creating material with beforeCompileShader and both of them are using same function
const beforeCompileShader = (shader) => {};
const tankGeometry = new THREE.PlaneGeometry(50, 90);
tankMaterial = new THREE.MeshBasicMaterial({
onBeforeCompile: (shader) => {
},
});
I was expecting different color in two plane but i am getting same color
Any help please
I realised that i need colormap texture rather than few color values so i tried to pass that into shader but i am not able to. I am trying for last 4/5 hours but not able to find what is wrong in this
I am sorry for bugging you but i am so lost in this
I have passed the texture with uniform and am also sampling that inside the fragment shader.
Do I have to do something more because when i use rawshader, i only do this.
Is there anything extra that i need to do in beforeCompile?
What simulation? What particles with the colors? What code? Any working live code examples and/or explanatory pics/vids?
Sorry, I’m not that good at telepathy ¯\_(ツ)_/¯
Depents on your goal and needs. Use THREE.Points(), or a plane mesh with a matrial with an animated looped texture with small circles, or a modified material, where you draw small circles in shaders.