dimanche 17 janvier 2016

Custom Shader Not Being Reflected by CubeCamera in ThreeJS

ThreeJS Version 72

Picture of the Problem

Why is the sphere reflecting the ocean plane without it's normal and specular maps?

It does reflect the vertex displacement motion.

Lines involved with the cube camera:

// creates cc
aBoxRef = new THREE.CubeCamera(1, 600, 1024);
scene.add(aBoxRef);

// runs every other frame
aBox.visible = false;       
aBoxRef.updateCubeMap( renderer, ocean );
aBox.visible = true;

If I change

aBoxRef.updateCubeMap( renderer, ocean );

to

aBoxRef.updateCubeMap( renderer, scene );

it reflects one single normal and specular map directly under the sphere, but the rest of the ocean reflection is flat like in the picture.





Aucun commentaire:

Enregistrer un commentaire