Client Scripting API - Pass

From Multiverse

Jump to: navigation, search

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

Constructor

None. Access existing passes on a technique by calling the method Technique.GetPass().

Methods

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.

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:
  • ClientAPI.GPUProgramType.Vertex
  • ClientAPI.GPUProgramType.Fragment
  • ClientAPI.GPUProgramType.ShadowCasterVertex
  • ClientAPI.GPUProgramType.ShadowCasterFragment
  • ClientAPI.GPUProgramType.ShadowReceiverVertex
  • ClientAPI.GPUProgramType.ShadowReceiverFragment
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.

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:
  • ClientAPI.FogMode.None
  • ClientAPI.FogMode.Linear
  • ClientAPI.FogMode.Exp
  • ClientAPI.FogMode.Exp2

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:
  • ClientAPI.SceneBlendFactor.One
  • ClientAPI.SceneBlendFactor.Zero
  • ClientAPI.SceneBlendFactor.DestColor
  • ClientAPI.SceneBlendFactor.SourceColor
  • ClientAPI.SceneBlendFactor.OneMinusDestColor
  • ClientAPI.SceneBlendFactor.OneMinusSourceColor
  • ClientAPI.SceneBlendFactor.DestAlpha
  • ClientAPI.SceneBlendFactor.SourceAlpha
  • ClientAPI.SceneBlendFactor.OneMinusDestAlpha
  • ClientAPI.SceneBlendFactor.OneMinusDestAlpha
DestBlendFactor ClientAPI.SceneBlendFactor The destination blend factor for blending this pass with the existing framebuffer. Valid values are:
  • ClientAPI.SceneBlendFactor.One
  • ClientAPI.SceneBlendFactor.Zero
  • ClientAPI.SceneBlendFactor.DestColor
  • ClientAPI.SceneBlendFactor.SourceColor
  • ClientAPI.SceneBlendFactor.OneMinusDestColor
  • ClientAPI.SceneBlendFactor.OneMinusSourceColor
  • ClientAPI.SceneBlendFactor.DestAlpha
  • ClientAPI.SceneBlendFactor.SourceAlpha
  • ClientAPI.SceneBlendFactor.OneMinusDestAlpha
  • ClientAPI.SceneBlendFactor.OneMinusDestAlpha
AlphaRejectFunction ClientAPI.CompareFunction The comparison function to use for alpha rejection. Valid values are:
  • ClientAPI.CompareFunction.AlwaysFail
  • ClientAPI.CompareFunction.AlwaysPass
  • ClientAPI.CompareFunction.Less
  • ClientAPI.CompareFunction.LessEqual
  • ClientAPI.CompareFunction.Equal
  • ClientAPI.CompareFunction.NotEqual
  • ClientAPI.CompareFunction.GreaterEqual
  • ClientAPI.CompareFunction.Greater
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:
  • ClientAPI.CullingMode.None
  • ClientAPI.CullingMode.Clockwise
  • ClientAPI.CullingMode.CounterClockwise
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:
  • ClientAPI.CullingMode.None
  • ClientAPI.CullingMode.Clockwise
  • ClientAPI.CullingMode.CounterClockwise
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:
  • ClientAPI.CompareFunction.AlwaysFail
  • ClientAPI.CompareFunction.AlwaysPass
  • ClientAPI.CompareFunction.Less
  • ClientAPI.CompareFunction.LessEqual
  • ClientAPI.CompareFunction.Equal
  • ClientAPI.CompareFunction.NotEqual
  • ClientAPI.CompareFunction.GreaterEqual
  • ClientAPI.CompareFunction.Greater
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:
  • ClientAPI.SceneDetailLevel.Points
  • ClientAPI.SceneDetailLevel.Wireframe
  • ClientAPI.SceneDetailLevel.Solid
ShadingMode ClientAPI.Shading Sets the triangle shading algorithm. Valid values are:
  • ClientAPI.Shading.Flat
  • ClientAPI.Shading.Gouraud
  • ClientAPI.Shading.Phong
Specular ColorEx The specular color of the surface.
Shininess float The specular shininess of the surface.


Personal tools