glsl限定符

glsl限定符

Attribute

Vertex attribute data.

Example

attribute vec4 v_color;

Description

attribute read-only variables containing data shared from WebGL/OpenGL environment to the vertex shader.

Because the vertex shader is executed one time for each vertex, attributes are specify per vertex data typically with information such as: space position, color, normal direction and texture coordinates of a vertex.




Const

Constant qualifier

Example

const float PI = 3.14159265359;

Description

const qualifier can be applied to the declaration of any variable to specify that its value will not be changed.




Uniform

Uniform variable qualifier.

Example

uniform vec4 direction;

Description

uniform variables contain read-only data shared from WebGL/OpenGL environment to a vertex or fragment shader.

The value is per primitive, so is useful for variables which remain constant along a primitive, frame or scene.




Varying

Varying variable qualifier.

Example

varying vec3 position;

Description

varying variables contain data shared from a vertex shader to a fragment shader.

The variable must be written in the vertex shader and the read-only value in the fragment shader is then interpolated from the vertices which make up the fragment.




precision

highp

mediump




in

out

inout

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值