forked from playcanvas/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshader-input.js
More file actions
29 lines (22 loc) · 774 Bytes
/
shader-input.js
File metadata and controls
29 lines (22 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
pc.extend(pc, function () {
'use strict';
var ShaderInput = function (graphicsDevice, name, type, locationId) {
// Set the shader attribute location
this.locationId = locationId;
// Resolve the ScopeId for the attribute name
this.scopeId = graphicsDevice.scope.resolve(name);
// Create the version
this.version = new pc.Version();
// Set the data type
if (type===pc.UNIFORMTYPE_FLOAT) {
if (name.substr(name.length - 3)==="[0]") type = pc.UNIFORMTYPE_FLOATARRAY;
}
this.dataType = type;
this.value = [null, null, null, null];
// Array to hold texture unit ids
this.array = [];
};
return {
ShaderInput: ShaderInput
};
}());