ray-tracing-renderer icon indicating copy to clipboard operation
ray-tracing-renderer copied to clipboard

Background rotation

Open VinAr22 opened this issue 4 years ago • 10 comments

Hello! Is it possible to replace the HDR scene with a black background, but keep hdr`s reflectivity on the object?

VinAr22 avatar Jan 29 '20 15:01 VinAr22

Yes it is! We just recently added support for this. Just set your scene.background to a THREE.Color, and your background should use that color. I've updated the docs with this new information.

jaxry avatar Jan 29 '20 19:01 jaxry

Fantastic! Can i use texture as background in the same way?

VinAr22 avatar Jan 30 '20 04:01 VinAr22

Sorry for the late response. I hadn't seen your reply until now :(

A 2D texture overlaid on the background doesn't work at the moment, but if you give scene.background a EnvironmentLight, the renderer will use that as the background (independent of lighting for the scene). Since Three.js officially supports textures as backgrounds, it's on my list to get it working for the ray tracing renderer too.

jaxry avatar Feb 27 '20 08:02 jaxry

All is ok, dont worry about that. Thanks for the information!

VinAr22 avatar Feb 27 '20 09:02 VinAr22

@jaxry hi! Can you explain to me is it possible to rotate the environment around the 'y' axis?

VinAr22 avatar Mar 05 '20 04:03 VinAr22

Hi @VinAr22 . Rotating an environment light directly is not supported right now, similar to how you can't rotate cubemaps in Three.js either. But you can effectively rotate the light by rotating the entire scene instead.

e.g. scene.rotateY(0.5)

Would that work for you?

jaxry avatar Mar 05 '20 04:03 jaxry

Thanks for the quick reply @jaxry! Im tried this solution. This does not correctly work if i pan my camera using orbit controls

VinAr22 avatar Mar 05 '20 04:03 VinAr22

I think I ran into this issue too. Are you adding the camera to the scene object? If so, does removing the camera from the scene work?

jaxry avatar Mar 05 '20 05:03 jaxry

Yes, it does

VinAr22 avatar Mar 05 '20 05:03 VinAr22

@jaxry I also tried to add object3d to the scene and attach an orbit pivot to it, but that didn't work either

VinAr22 avatar Mar 05 '20 06:03 VinAr22