pyvista.Plotter.set_environment_texture

pyvista.Plotter.set_environment_texture#

Plotter.set_environment_texture(
texture,
is_srgb=False,
resample: bool | float | None = None,
) None[ソース]#

イメージベースのライティングに使用する環境テクスチャを設定します.

This texture is supposed to represent the scene background. If it is not a cubemap, the texture is supposed to represent an equirectangular projection. If used with raytracing backends, the texture must be an equirectangular projection and must be constructed with a valid vtkImageData.

パラメータ:
texturepyvista.Texture

質感.

is_srgbbool, default: False

テクスチャがsRGBカラースペースの場合,テクスチャのカラーフラグを設定するか,このパラメータを True に設定してください.デフォルトでは,テクスチャはリニアカラースペースであると仮定されます.

resamplebool | float, optional

Resample the environment texture. Set this to a float to set the sampling rate explicitly or set to True to downsample the texture to 1/16th of its original resolution. By default, the theme value for resample_environment_texture is used, which is False for the standard theme.

Downsampling the texture can substantially improve performance for some environments, e.g. headless setups or if GPU support is limited.

注釈

This will resample the texture used for image-based lighting only, e.g. the texture used for rendering reflective surfaces. It does not resample the background texture.

Added in version 0.45.

スカイボックスキューブマップを環境テクスチャとして追加し,テクスチャからの照明が球体データセットにマッピングされていることを示します.デフォルトのライトキットを無効にしても,シーンライティングがアクタにマッピングされることに注意してください.

>>> from pyvista import examples
>>> import pyvista as pv
>>> pl = pv.Plotter(lighting=None)
>>> cubemap = examples.download_sky_box_cube_map()
>>> _ = pl.add_mesh(pv.Sphere(), pbr=True, metallic=0.9, roughness=0.4)
>>> pl.set_environment_texture(cubemap)
>>> pl.camera_position = 'xy'
>>> pl.show()
../../../_images/pyvista-Plotter-set_environment_texture-1_00_00.png