pyvista.Renderer.set_environment_texture#
- Renderer.set_environment_texture( ) None [ソース]#
イメージベースのライティングに使用する環境テクスチャを設定します.
このテクスチャはシーンのバックグラウンドを表すものとみなされます.立方体マップでない場合,テクスチャは等角投影を表すものとみなされます.レイトレーシングバックエンドで使用する場合,テクスチャは等角投影である必要があり,有効な
vtk.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
True
to downsample the texture to 1/16th of its original resolution. By default, the theme value forresample_environment_texture
is used, which isFalse
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.
- 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()