I’m getting a warning from three.js - “THREE.WebGLRenderer.setTexture2D: don’t use render targets as textures. Use their .texture property instead.” and this is the code that’s causing the issue, a shader that’s applied to a mesh:
water = new THREE.Water( renderer, camera, scene, {
textureWidth: 256,
textureHeight: 256,
waterNormals: waterNormals,
side: THREE.Backside,
sunColor: 0xfcffb9,
waterColor: 0x01293e,
distortionScale: 100
} );
seaMesh = new THREE.Mesh( new THREE.CircleGeometry( 6000, 20 ), water.material );
The shader used is water-matrial.js from here: https://github.com/jbouny/ocean
I’ve compared the code in the demo with the shader with my own code and both match but I’m using three.js 0.93.0, it’s using 0.72.0. What’s the issue and how do I fix the warning?