Skip to content

CubeCamera Render Target Displaying Random Texture #31169

@lambocorp

Description

@lambocorp

Description

My scene has a cube in it.
That cube's material.map is displaying a render target's texture.
A CubeCamera updates that texture every N frames.

// Add a cube to the scene
const box = new Mesh(new BoxGeometry(), new MeshStandardMaterial())
const rt = new WebGLCubeRenderTarget()
// Visualize the render target
box.map = rt.texture;

This is all in cube-camera-utils.js.
You can see the texture updating, but if you zoom around a bit, at a certain angle the texture displayed swaps to just be the plant texture -- which is not supplied to the box material in any way.

What exactly is happening here? It seems like when the object intersects the camera frustum's near plane it may cause this behavior.

Attached:
(1) The cube displaying the render from cube camera, as expected (6 faces and then mipmaps)
(2) The same cube after scrolling the mouse wheel to zoom when the image displayed switches.

r176, Chrome, Linux desktop

https://codesandbox.io/p/sandbox/pensive-moon-r8fm9c

Reproduction steps

Code

// code goes here

Live example

Screenshots

Image

Image

Version

0.176.0

Device

Desktop

Browser

Chrome

OS

Linux

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions