Currently, I am tackling a project that involves working with scenes containing objects ranging from 10 to 1000000 in size. A recurring issue I have encountered is that when dealing with the larger end of this size spectrum, the objects seem to 'shimmer'. This shimmering effect only occurs when objects intersect, and it becomes more pronounced as the camera moves away from the object.
An image showcasing the problem can be viewed here: https://i.sstatic.net/wu1lz.jpg
While I am unsure of the root cause of this problem, I have come up with a couple of possible explanations:
Firstly, it is possible that I am working with sizes that are too large for three.js / webgl to handle efficiently.
The second potential issue could be related to the camera controls that I have implemented:
if(mouseIsDown == true){
if(this.movementSpeed < this.maxSpeed){
this.movementSpeed += this.acceleration
}else{
this.movementSpeed = this.maxSpeed
}
}else{
if(this.movementSpeed > this.minSpeed){
this.movementSpeed = this.movementSpeed/this.deceleration
}else{
this.movementSpeed = this.minSpeed
}
}
Here, this.minSpeed is set to 0, and the camera movement is controlled by this.movementSpeed through the following actions:
var actualSpeed = delta * this.movementSpeed;
this.object.translateZ( -actualSpeed * forwardOrAuto );
this.object.translateX( actualSpeed * sideSpeed );
this.object.translateY( actualSpeed * upSpeed );
Although I initially dismissed this as the cause, it is worth noting that the shimmering persists even when the movement speed is at extremely low values like 10^-20 or -30.
Additionally, it should be mentioned that I am using r.55 version.