Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is There a way to add an HDRI image as sky for better light? #177

Open
LUK3D opened this issue Dec 1, 2022 · 1 comment
Open

Is There a way to add an HDRI image as sky for better light? #177

LUK3D opened this issue Dec 1, 2022 · 1 comment

Comments

@LUK3D
Copy link

LUK3D commented Dec 1, 2022

No description provided.

@LUK3D LUK3D changed the title Is There a way to add an HDI image as sky for better light? Is There a way to add an HDRI image as sky for better light? Dec 1, 2022
@damonsong
Copy link

damonsong commented Apr 2, 2023

I'm learning troisjs now and can't find the HDRI image API so far.
I'm using the JS function to create the HDR env for the scene.

`
function createHDRenvMap(scene, renderer, hdrFile) {
const pmremGenerator = new PMREMGenerator(renderer)
pmremGenerator.compileEquirectangularShader()

const rgbeLoader = new RGBELoader()

rgbeLoader.load(hdrFile, (texture) => {
    const envMap = pmremGenerator.fromEquirectangular(texture).texture
    pmremGenerator.dispose()
    
    scene.environment =  envMap
})
// return envMap

}

`

scene and renderer is the parameters, hdrFile is the entire path and file name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants