Skip to main content

Interface: ProgramOptions

Hierarchy

Table of contents

Properties

Properties

cullFace

cullFace: number

指定正面或背面多边形是否可以剔除 可能的值:gl.FRONTgl.FRONT_AND_BACKgl.BACK

Inherited from

ProgramRenderState.cullFace

Defined in

src/core/Program.ts:84


frontFace

frontFace: number

指定图形顶点以顺时针是正面还是逆时针方向是正面: 可能的值:gl.CWgl.CCW

Inherited from

ProgramRenderState.frontFace

Defined in

src/core/Program.ts:90


depthTest

depthTest: boolean

是否启用深度测试,默认启用

Inherited from

ProgramRenderState.depthTest

Defined in

src/core/Program.ts:95


depthWrite

depthWrite: boolean

是否开启深度值写入

Inherited from

ProgramRenderState.depthWrite

Defined in

src/core/Program.ts:100


depthFunc

depthFunc: number

指定深度检测的参数,即什么情况算失败、什么情况算作通过,默认是 gl.LESS。 可能的值:

  • gl.NEVER (总不通过)
  • gl.LESS(如果新值小于缓冲区中的值则通过)
  • gl.EQUAL(如果新值等于缓冲区中的值则通过)
  • gl.LEQUAL(如果新值小于等于缓冲区中的值则通过)
  • gl.GREATER(如果新值大于缓冲区中的值则通过)
  • gl.NOTEQUAL(如果新值不等于缓冲区中的值则通过)
  • gl.GEQUAL(如果新值大于等于缓冲区中的值则通过)
  • gl.ALWAYS(总通过)

Inherited from

ProgramRenderState.depthFunc

Defined in

src/core/Program.ts:114


blending

blending: BlendType

blend 类型

Inherited from

ProgramRenderState.blending

Defined in

src/core/Program.ts:119


blendFunc

blendFunc: Object

指定颜色混合算法 可能的值可以参考:https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/blendFunchttps://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/blendFuncSeparate

Type declaration

NameType
srcnumber
dstnumber
srcAlpha?number
dstAlpha?number

Inherited from

ProgramRenderState.blendFunc

Defined in

src/core/Program.ts:125


blendEquation

blendEquation: Object

指定颜色混合方程式 可能的值可以参考:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/blendEquationhttps://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/blendEquationSeparate

Type declaration

NameType
modeRGBnumber
modeAlpha?number

Inherited from

ProgramRenderState.blendEquation

Defined in

src/core/Program.ts:136


id

id: string

指定 id

Overrides

ResourceOptions.id

Defined in

src/core/Program.ts:146


vertexShader

vertexShader: string | VertexShader

顶点着色器

Defined in

src/core/Program.ts:151


fragmentShader

fragmentShader: string | FragmentShader

片段着色器

Defined in

src/core/Program.ts:156


uniforms

Optional uniforms: any

uniform

Defined in

src/core/Program.ts:161


transparent

Optional transparent: boolean

配置是否是透明渲染

Defined in

src/core/Program.ts:166


defines

Optional defines: string[]

指定着色的宏定义

Defined in

src/core/Program.ts:171


includes

Optional includes: Object

着色器模块,会在着色器中遇到 #include <xxx> 会自动替换此配置项对应的着色器片段。

Index signature

▪ [key: string]: string

Defined in

src/core/Program.ts:176


name

name: string

Inherited from

ResourceOptions.name

Defined in

src/core/Resource.ts:11


handle

handle: any

Inherited from

ResourceOptions.handle

Defined in

src/core/Resource.ts:12


userData

userData: any

Inherited from

ResourceOptions.userData

Defined in

src/core/Resource.ts:13