Client Scripting API - Pass
From Multiverse
Pass is a class in the Client Scripting API that represents a particular rendering pass for a Material.
See Passes for information on the passes section of a material script.
Contents |
[edit]
Constructor
None. Access existing passes on a technique by calling the method Technique.GetPass().
[edit]
Methods
[edit]
GetTextureUnit
textureUnit = GetTextureUnit(nameOrIndex)
Returns the specified texture unit of the rendering pass.
Returns
The specified TextureUnit of the pass.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| nameOrIndex | string or int | None | The name or index of the texture unit. |
[edit]
SetGPUParam
SetGPUParam(programType, nameOrIndex, value)
Sets the value of a GPU program parameter.
Returns
None.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| programType | GPUProgramType | None | Which GPU program the parameter is set for. Valid values are:
|
| nameOrIndex | string or int | None | The name or index of the parameter to set. |
| value | float, Vector3, Vector4, Matrix, ColorEx | None | The value that the parameter is set to. |
[edit]
Properties
| Property | Datatype | Description |
|---|---|---|
| Name | string | Name of the Pass. |
| NumTextureUnits | int | The number of texture units that this pass has. |
| Parent | Technique | The Technique that this pass is a part of. |
| FogOverride | bool | Whether this material overrides the scene fog settings with its own. |
| FogMode | ClientAPI.FogMode | Determines the method for computing fog density over distance. Valid values are:
Multiverse shaders currently only support FogMode.None and FogMode.Linear |
| FogColor | ColorEx | The color of the fog. |
| FogDensity | float | The density value used when computing fog for modes FogMode.Exp and FogMode.Exp2. Should be a value between 0 and 1. |
| FogStart | float | The distance from the camera at which the fog effect starts. Any objects closer to the camera than this distance will not have any fog effect. |
| FogEnd | float | The distance from the camera at which the fog effect ends. Any objects farther from the camera than this distance will be fully fogged out. |
| SourceBlendFactor | ClientAPI.SceneBlendFactor | The source blend factor for blending this pass with the existing framebuffer. Valid values are:
|
| DestBlendFactor | ClientAPI.SceneBlendFactor | The destination blend factor for blending this pass with the existing framebuffer. Valid values are:
|
| AlphaRejectFunction | ClientAPI.CompareFunction | The comparison function to use for alpha rejection. Valid values are:
|
| AlphaRejectValue | int | The value that the pixel alpha is compared to for alpha rejection. |
| DepthBiasConstant | float | The constant depth bias value for this pass. |
| DepthBiasSlopeScale | float | The slope bias value for this pass. |
| Ambient | ColorEx | Ambient surface color. |
| ColorWrite | bool | Whether color writing is enabled for this pass. If you want to only write to the depth buffer, you can enable DepthWrite and disable ColorWrite. |
| HardwareCullMode | ClientAPI.CullingMode | Sets the surface culling mode based on vertex order. This is used to cull the drawing of triangles whose back side is facing the camera. Valid values are:
|
| SoftwareCullMode | ClientAPI.CullingMode | Sets the surface culling mode based on vertex order. This is used to cull the drawing of triangles whose back side is facing the camera. Valid values are:
|
| DepthCheck | bool | Whether depth buffer checking (z-buffering) is enabled for this pass. |
| DepthFunction | ClientAPI.CompareFunction | The comparison function to use for depth buffer testing. Valid values are:
|
| DepthWrite | bool | Whether writing to the depth buffer is enabled for this pass.
|
| Diffuse | ColorEx | Diffuse surface color.
|
| Emissive | ColorEx | Emissive surface color. |
| IsProgrammable | bool | Whether this pass uses vertex or fragment programs. |
| IsTransparent | bool | Whether this pass uses transparency. |
| LightingEnabled | bool | Whether this pass does lighting. If false then all objects will be full brightness. |
| MaxLights | int | The maximum number of lights that will be used to light geometry in this pass. |
| StartLight | int | The index of the first light to use in the distance sorted light list for this pass. This property can be used for multi-pass techniques where each pass handles one or more lights. For example, the first pass might handle lights 0-3 and the second pass might handle lights 4-7. |
| SceneDetail | ClientAPI.SceneDetailLevel | Sets the type rendering primitive for this pass. Valid values are:
|
| ShadingMode | ClientAPI.Shading | Sets the triangle shading algorithm. Valid values are:
|
| Specular | ColorEx | The specular color of the surface. |
| Shininess | float | The specular shininess of the surface.
|
