All Questions
1,980
questions
0
votes
0
answers
46
views
How do i pass uniforms to my glsl code at compile and during run time in three js?
I have a three js scene where i render meshes from a sdf glsl shader. I want to create uniforms on these shaders to adjust the distance field via sliders in the UI. Passing the shaders in from another ...
0
votes
0
answers
49
views
How to make completely white floor with shadows?
Please help. I want white floor and shadows on it, but all I get is lightgray floor with very thin shadow:
lightgray floor
My floor and light configuration:
const ModelSceneEnvironment = () => {
...
0
votes
0
answers
42
views
Implementing 3D Object Animation with Bouncing and Color Change in WebGL/Three.js
I need to create a 3D object (cube, sphere, or torus knot) that moves around the viewport, changes direction upon hitting the edges (bouncing effect), and changes color each time it bounces. I'm using ...
0
votes
0
answers
50
views
ThreeJS ShaderMaterial WebGL conversion
I'm working to convert the SplaTV WebGL library to use ThreeJS and I'm struggling to get it converted. The code in the original repo is challenging to understand as it's not documented and while I ...
0
votes
0
answers
14
views
Clearing multiple attachments on a target with different colors in three.js
I make a WebGLTarget with several attachments. I would like to clear them with different colors. So far the only solution i found was provided by ChatGPT and it basically does it on the webgl level ...
0
votes
0
answers
23
views
Wrapping 2D mesh on top of another 3D mesh (BabylonJS/ThreeJS)
Is there a way to wrap (not just position and rotate) a 2D mesh (mesh with no depth - monogram) on top of some 3D mesh in BabylonJS or ThreeJS in a way that would distort the 2D mesh that would fit ...
1
vote
1
answer
216
views
Why is WebGPU performance so bad in my benchmark compared to WebGL?
Here's the code of my benchmark, tested it on Latest Chrome Canary on Win11 (with vsync disabled and fps unlocked).
WebGPU has around 1/3 the FPS of WebGL bench, I can't figure out why is that.
Code:
...
0
votes
0
answers
32
views
re upload same texture into the object make the object texture different and low quality
i tried to update the texture on my glb file with some texture images and same texture image, but it was always like has some striped on my texture after update map texture
here is my current texture ...
0
votes
0
answers
29
views
Using VideoTexture with ShaderMaterial
I'm currently trying to implement a scroll effect with THREE.js that meets the following conditions.
When the page is loaded the three element should be scaled down to 0.3.
When the page is scrolled ...
0
votes
1
answer
54
views
How to make 2 objects to collide each other?
Description
I am trying to make 2 objects to collide each other. The collision I am trying to make detects weather the 2 objects are touching / intersecting each other by first calculating their Box3(...
0
votes
1
answer
52
views
Three.js Cube Render displays nothing
I'm trying to render a cube with Three.js. I wrote the code exactly as stated in the tutorial from tutorialspoint and I'm getting a blank screen.
I'm trying to render the code, but nothing displays ...
1
vote
1
answer
58
views
How to extrude a certain triangle in a mesh in three.js
Description:
My three.js scene is based upon a selection tool in which if we click and drag over the mesh it colors the triangles of the mesh red, I want to create a function that when runs checks the ...
0
votes
0
answers
26
views
R3F exported NodeToy shader is invisible
I am unable to get my glsl NodeToy dark pink shader to show up on the the arms and legs of the models of the caution symbol and X symbol. The flat dark pink shader that is currently visible is not the ...
0
votes
1
answer
85
views
Threejs splited torus is showing black dotted
my goal is to split the shape e.g. like a torus but it could be a circle triangle etc. I want to split the shape by using a custom plane. Once the torus is split-into two parts both parts need to be ...
1
vote
0
answers
60
views
GLSL shader difference between desktop and mobile - varyings or noise function?
Context
I'm building a WebGL GLSL shader using a 3d Perlin Noise function to warp the vertices as well as color the fragments so they line up with the vertices.
I'm running the Perlin Noise function ...