MCPcopy Create free account
hub / github.com/galacean/engine / constructor

Method constructor

packages/core/src/shader/ShaderProgram.ts:71–84  ·  view source on GitHub ↗
(engine: Engine, vertexSource: string, fragmentSource: string)

Source from the content-addressed store, hash-verified

69 }
70
71 constructor(engine: Engine, vertexSource: string, fragmentSource: string) {
72 this._engine = engine;
73 this._gl = engine._hardwareRenderer.gl;
74 this._glProgram = this._createProgram(vertexSource, fragmentSource);
75
76 if (this._glProgram) {
77 this._isValid = true;
78 this._recordLocation();
79 } else {
80 this._isValid = false;
81 }
82
83 this.id = ShaderProgram._counter++;
84 }
85
86 /**
87 * Upload all shader data in shader uniform block.

Callers

nothing calls this directly

Calls 2

_createProgramMethod · 0.95
_recordLocationMethod · 0.95

Tested by

no test coverage detected