You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added a MeshPhysicalMaterial cube, set transparent=true,opacity=0.3.
Reproduction steps
1.render error
Code
<scripttype="module">
import * as THREE from 'three';
import {OrbitControls} from 'three/addons/controls/OrbitControls.js';
import {RGBELoader} from 'three/addons/loaders/RGBELoader.js';
import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js';
import {RenderPass} from 'three/addons/postprocessing/RenderPass.js';
import {OutputPass} from 'three/addons/postprocessing/OutputPass.js';
import {GUI} from 'three/addons/libs/lil-gui.module.min.js';
const params = {add_RenderPass_OutputPass: true};
let gui;
let camera, scene, renderer;
let composer;
init();
function init() {constcontainer=document.createElement('div');document.body.appendChild(container);camera=newTHREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight,0.25,20);camera.position.set(-1.8,0.6,2.7);scene=newTHREE.Scene();newRGBELoader().setPath('textures/equirectangular/').load('royal_esplanade_1k.hdr',function(texture){texture.mapping=THREE.EquirectangularReflectionMapping;scene.background=texture;});constambientLight=newTHREE.AmbientLight(0xffffff,1);scene.add(ambientLight);constgeometry=newTHREE.BoxGeometry(1,1,1);constmaterial=newTHREE.MeshPhysicalMaterial({color: 0x00ff00,transparent: true,opacity: 0.3});constcube=newTHREE.Mesh(geometry,material);scene.add(cube);renderer=newTHREE.WebGLRenderer();renderer.setPixelRatio(window.devicePixelRatio);renderer.setSize(window.innerWidth,window.innerHeight);renderer.setAnimationLoop(animate);container.appendChild(renderer.domElement);composer=newEffectComposer(renderer);composer.setPixelRatio(window.devicePixelRatio);composer.setSize(window.innerWidth,window.innerHeight);composer.addPass(newRenderPass(scene,camera));composer.addPass(newOutputPass());constcontrols=newOrbitControls(camera,renderer.domElement);controls.minDistance=2;controls.maxDistance=10;controls.target.set(0,0,-0.2);controls.update();gui=newGUI();gui.width=350;gui.add(params,'add_RenderPass_OutputPass');window.addEventListener('resize',onWindowResize);}
function onWindowResize() {camera.aspect=window.innerWidth/window.innerHeight;camera.updateProjectionMatrix();renderer.setSize(window.innerWidth,window.innerHeight);composer.setSize(window.innerWidth,window.innerHeight);}
//
function animate() {if(params.add_RenderPass_OutputPass){composer.render();} else {renderer.render(scene,camera);}}</script>
Live example
Screenshots
Version
r166
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered:
Description
Added a MeshPhysicalMaterial cube, set transparent=true,opacity=0.3.
Reproduction steps
1.render error
Code
Live example
Screenshots
Version
r166
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: