pyvista.Plotter.set_environment_texture#
- Plotter.set_environment_texture( ) 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.
- パラメータ:
- texture
pyvista.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
Trueto downsample the texture to 1/16th of its original resolution. By default, the theme value forresample_environment_textureis used, which isFalsefor 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.
- texture
例
スカイボックスキューブマップを環境テクスチャとして追加し,テクスチャからの照明が球体データセットにマッピングされていることを示します.デフォルトのライトキットを無効にしても,シーンライティングがアクタにマッピングされることに注意してください.
>>> 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()