OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::Graphics3D Namespace Reference

Functions

BlendState GetBlendState ()
 現在適用されているブレンドステートを返します。 More...
 
RasterizerState GetRasterizerState ()
 現在適用されているラスタライザーステートを返します。 More...
 
DepthStencilState GetDepthStencilState ()
 現在適用されているデプス・ステンシルステートを返します。 More...
 
SamplerState GetSamplerState (ShaderStage shaderStage=ShaderStage::Pixel, uint32 slot=0)
 現在適用されているサンプラーステートを返します。 More...
 
void SetScissorRect (const Rect &rect)
 シザー矩形を設定します。 More...
 
Rect GetScissorRect ()
 現在設定されているシザー矩形を返します。 More...
 
Optional< RectGetViewport ()
 現在適用されているビューポートを返します。 More...
 
Optional< VertexShaderGetCustomVertexShader ()
 現在適用されている頂点シェーダを返します。 More...
 
Optional< PixelShaderGetCustomPixelShader ()
 現在適用されているピクセルシェーダを返します。 More...
 
void SetCameraTransform (const Mat4x4 &matrix, const Float3 &eyePosition)
 
void SetCameraTransform (const BasicCamera3D &camera3D)
 
const Mat4x4GetCameraTransform ()
 
Float3 GetEyePosition ()
 
const Mat4x4GetLocalTransform ()
 
Optional< RenderTextureGetRenderTarget ()
 現在のレンダーターゲットになっているレンダーテクスチャを返します。 More...
 
Size GetRenderTargetSize ()
 現在のレンダーターゲットのサイズ(ピクセル)を返します More...
 
void SetVSTexture (uint32 slot, const Optional< Texture > &texture)
 2D 描画の頂点シェーダのテクスチャスロットにテクスチャをアタッチします。 More...
 
void SetPSTexture (uint32 slot, const Optional< Texture > &texture)
 2D 描画のピクセルシェーダのテクスチャスロットにテクスチャをアタッチします。 More...
 
void SetGlobalAmbientColor (const ColorF &color)
 グローバル環境光の色を設定します。 More...
 
ColorF GetGlobalAmbientColor ()
 
void SetSunDirection (const Vec3 &direction)
 メイン平行光源への方向を設定します。 More...
 
Vec3 GetSunDirection ()
 
void SetSunColor (const ColorF &color)
 メイン平行光源の色を設定します。 More...
 
ColorF GetSunColor ()
 
void Flush ()
 現在までの 3D 描画を実行します。 More...
 
template<class Type >
void SetVSConstantBuffer (uint32 slot, const ConstantBuffer< Type > &buffer)
 頂点シェーダの定数バッファを設定します。 More...
 
template<class Type >
void SetPSConstantBuffer (uint32 slot, const ConstantBuffer< Type > &buffer)
 ピクセルシェーダの定数バッファを設定します。 More...
 
template<class Type >
void SetConstantBuffer (ShaderStage stage, uint32 slot, const ConstantBuffer< Type > &buffer)
 定数バッファを設定します。 More...
 

Variables

constexpr ColorF DefaultGlobalAmbientColor { 0.5 }
 
constexpr ColorF DefaultSunColor { 1.0 }
 
constexpr Vec3 DefaultSunDirection { 0.4082482904638631, 0.4082482904638631, -0.8164965809277261 }
 

Function Documentation

◆ Flush()

void s3d::Graphics3D::Flush ( )

現在までの 3D 描画を実行します。

Remarks
MSRenderTexture のリゾルブ前に必要です。

◆ GetBlendState()

BlendState s3d::Graphics3D::GetBlendState ( )

現在適用されているブレンドステートを返します。

Returns
現在適用されているブレンドステート

◆ GetCameraTransform()

const Mat4x4& s3d::Graphics3D::GetCameraTransform ( )

◆ GetCustomPixelShader()

Optional<PixelShader> s3d::Graphics3D::GetCustomPixelShader ( )

現在適用されているピクセルシェーダを返します。

Returns
現在適用されているピクセルシェーダ。デフォルトの場合は none

◆ GetCustomVertexShader()

Optional<VertexShader> s3d::Graphics3D::GetCustomVertexShader ( )

現在適用されている頂点シェーダを返します。

Returns
現在適用されている頂点シェーダ。デフォルトの場合は none

◆ GetDepthStencilState()

DepthStencilState s3d::Graphics3D::GetDepthStencilState ( )

現在適用されているデプス・ステンシルステートを返します。

Returns
現在適用されているデプス・ステンシルステート

◆ GetEyePosition()

Float3 s3d::Graphics3D::GetEyePosition ( )

◆ GetGlobalAmbientColor()

ColorF s3d::Graphics3D::GetGlobalAmbientColor ( )

◆ GetLocalTransform()

const Mat4x4& s3d::Graphics3D::GetLocalTransform ( )

◆ GetRasterizerState()

RasterizerState s3d::Graphics3D::GetRasterizerState ( )

現在適用されているラスタライザーステートを返します。

Returns
現在適用されているラスタライザーステート

◆ GetRenderTarget()

Optional<RenderTexture> s3d::Graphics3D::GetRenderTarget ( )

現在のレンダーターゲットになっているレンダーテクスチャを返します。

Returns
現在のレンダーターゲットになっているレンダーテクスチャ。デフォルトのシーンの場合 none

◆ GetRenderTargetSize()

Size s3d::Graphics3D::GetRenderTargetSize ( )

現在のレンダーターゲットのサイズ(ピクセル)を返します

Returns
現在のレンダーターゲットのサイズ(ピクセル)

◆ GetSamplerState()

SamplerState s3d::Graphics3D::GetSamplerState ( ShaderStage  shaderStage = ShaderStage::Pixel,
uint32  slot = 0 
)

現在適用されているサンプラーステートを返します。

Parameters
shaderStageシェーダステージ
slotテクスチャスロット
Returns
現在適用されているサンプラーステート

◆ GetScissorRect()

Rect s3d::Graphics3D::GetScissorRect ( )

現在設定されているシザー矩形を返します。

Returns
現在設定されているシザー矩形

◆ GetSunColor()

ColorF s3d::Graphics3D::GetSunColor ( )

◆ GetSunDirection()

Vec3 s3d::Graphics3D::GetSunDirection ( )

◆ GetViewport()

Optional<Rect> s3d::Graphics3D::GetViewport ( )

現在適用されているビューポートを返します。

Returns
現在適用されているビューポート。シーンと一致する場合は none

◆ SetCameraTransform() [1/2]

void s3d::Graphics3D::SetCameraTransform ( const BasicCamera3D camera3D)

◆ SetCameraTransform() [2/2]

void s3d::Graphics3D::SetCameraTransform ( const Mat4x4 matrix,
const Float3 eyePosition 
)

◆ SetConstantBuffer()

template<class Type >
void s3d::Graphics3D::SetConstantBuffer ( ShaderStage  stage,
uint32  slot,
const ConstantBuffer< Type > &  buffer 
)
inline

定数バッファを設定します。

Template Parameters
Type定数バッファの構造体
Parameters
stageシェーダステージ
slotスロット
buffer定数バッファ
Remarks
予約されているスロットは使用できません。詳しくはドキュメントを読んでください

◆ SetGlobalAmbientColor()

void s3d::Graphics3D::SetGlobalAmbientColor ( const ColorF color)

グローバル環境光の色を設定します。

Parameters
colorグローバル環境光の色

◆ SetPSConstantBuffer()

template<class Type >
void s3d::Graphics3D::SetPSConstantBuffer ( uint32  slot,
const ConstantBuffer< Type > &  buffer 
)
inline

ピクセルシェーダの定数バッファを設定します。

Template Parameters
Type定数バッファの構造体
Parameters
slotスロット
buffer定数バッファ
Remarks
予約されているスロットは使用できません。詳しくはドキュメントを読んでください。

◆ SetPSTexture()

void s3d::Graphics3D::SetPSTexture ( uint32  slot,
const Optional< Texture > &  texture 
)

2D 描画のピクセルシェーダのテクスチャスロットにテクスチャをアタッチします。

Parameters
slotスロット。最大 (SamplerState::MaxSamplerCount - 1)
textureアタッチするテクスチャ。none の場合テクスチャのアタッチを解除します。

◆ SetScissorRect()

void s3d::Graphics3D::SetScissorRect ( const Rect rect)

シザー矩形を設定します。

Parameters
rectシザー矩形
Remarks
シザー矩形は RasterizerState で scissorEnable を true にすることで有効になります。

◆ SetSunColor()

void s3d::Graphics3D::SetSunColor ( const ColorF color)

メイン平行光源の色を設定します。

Parameters
colorメイン平行光源の色

◆ SetSunDirection()

void s3d::Graphics3D::SetSunDirection ( const Vec3 direction)

メイン平行光源への方向を設定します。

Parameters
directionメイン平行光源への方向

◆ SetVSConstantBuffer()

template<class Type >
void s3d::Graphics3D::SetVSConstantBuffer ( uint32  slot,
const ConstantBuffer< Type > &  buffer 
)
inline

頂点シェーダの定数バッファを設定します。

Template Parameters
Type定数バッファの構造体
Parameters
slotスロット
buffer定数バッファ
Remarks
予約されているスロットは使用できません。詳しくはドキュメントを読んでください。

◆ SetVSTexture()

void s3d::Graphics3D::SetVSTexture ( uint32  slot,
const Optional< Texture > &  texture 
)

2D 描画の頂点シェーダのテクスチャスロットにテクスチャをアタッチします。

Parameters
slotスロット。最大 (SamplerState::MaxSamplerCount - 1)
textureアタッチするテクスチャ。none の場合テクスチャのアタッチを解除します。

Variable Documentation

◆ DefaultGlobalAmbientColor

constexpr ColorF s3d::Graphics3D::DefaultGlobalAmbientColor { 0.5 }
inlineconstexpr

◆ DefaultSunColor

constexpr ColorF s3d::Graphics3D::DefaultSunColor { 1.0 }
inlineconstexpr

◆ DefaultSunDirection

constexpr Vec3 s3d::Graphics3D::DefaultSunDirection { 0.4082482904638631, 0.4082482904638631, -0.8164965809277261 }
inlineconstexpr