目录

VolumeFogRenderAPI

Class Info

VolumeFogRenderAPI

用来进行体积雾渲染的类,包含环境初始化、参数传递、体积雾渲染以及数据释放等功能。

Public Constructor Summary

Constructor Name

VolumeFogRenderAPI()

默认构造函数。

Public Destructor Summary

Destructor Name

~VolumeFogRenderAPI()

析构函数,释放内存。

Public Method Summary

Qualifier and Type

Method Name and Description

bool

CreateResources()

创建渲染所需要的环境和资源。

void

RenderFogFrameTexture(void* FogTexHandle, int textureWidth, int textureHeight, int textureDepth)

进行体积雾的绘制渲染,将体积雾绘制在纹理FogTexHandle上。

bool

SetRenderFogParas(BaseParas &baseParas, DirLightParas &dirLight, PointLightParas pointLights[], SpotLightParas spotLights[])

设置渲染参数,传入渲染过程中必须的参数。

void

ReleaseData()

释放环境和资源。

Public Constructors

[h2]VolumeFogRenderAPI

Constructor

VolumeFogRenderAPI()

无参构造函数。

Public Destructors

[h2]~VolumeFogRenderAPI

Destructor

~VolumeFogRenderAPI()

析构函数。

Public Methods

[h2]CreateResources

Method

bool CreateResources()

创建渲染需要的环境和资源。

Returns

Type

Description

bool

判断环境和资源创建是否成功。

  • true:成功。
  • false:失败。

[h2]RenderFogFrameTexture

Method

void RenderFogFrameTexture(void* FogTexHandle, int textureWidth, int textureHeight, int textureDepth)

进行体积雾的绘制渲染,将体积雾绘制在纹理FogTexHandle上。

Parameters

Name

Description

FogTexHandle

用于绘制的纹理内存。

textureWidth

纹理内存的宽度,最大宽度为300。(该值与tileSize的乘积为屏幕像素宽)

textureHeight

纹理内存的高度,最大高度为300。(该值与tileSize的乘积为屏幕像素高)

textureDepth

纹理内存的深度,最大深度为64。

[h2]SetRenderFogParas

Method

bool SetRenderFogParas(BaseParas &baseParas, DirLightParas &dirLight, PointLightParas pointLights[], SpotLightParas spotLights[])

设置渲染参数,传入渲染过程中必须的参数。

Parameters

Name

Description

baseParas

体积雾渲染所需要的基础参数,包含高度雾、噪声雾、相机参数等。

dirLight

平行光及阴影相关参数。

pointLights

点光源相关参数。支持传入长度8以内的结构体数组。

spotLights

聚光源相关参数。支持传入长度8以内的结构体数组。

Returns

Type

Description

bool

判断参数传递是否成功。

  • true:成功。
  • false:失败。

[h2]ReleaseData

Method

void ReleaseData()

释放内存资源。