本文整理匯總了TypeScript中gloo2.Program.set_shaders方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Program.set_shaders方法的具體用法?TypeScript Program.set_shaders怎麽用?TypeScript Program.set_shaders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gloo2.Program
的用法示例。
在下文中一共展示了Program.set_shaders方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: init
init() {
const { gl } = this;
const frag = this.FRAG.replace(/MARKERCODE/, this.MARKERCODE);
this.last_trans = {}; // Keep track of transform
// The program
this.prog = new Program(gl);
this.prog.set_shaders(this.VERT, frag);
// Real attributes
this.vbo_x = new VertexBuffer(gl);
this.prog.set_attribute('a_x', 'float', this.vbo_x);
this.vbo_y = new VertexBuffer(gl);
this.prog.set_attribute('a_y', 'float', this.vbo_y);
this.vbo_s = new VertexBuffer(gl);
this.prog.set_attribute('a_size', 'float', this.vbo_s);
this.vbo_a = new VertexBuffer(gl);
this.prog.set_attribute('a_angle', 'float', this.vbo_a);
// VBO's for attributes (they may not be used if value is singleton)
this.vbo_linewidth = new VertexBuffer(gl);
this.vbo_fg_color = new VertexBuffer(gl);
this.vbo_bg_color = new VertexBuffer(gl);
return this.index_buffer = new IndexBuffer(gl);
}
示例2: init
init(): void {
const {gl} = this;
this._scale_aspect = 0; // keep track, so we know when we need to update segment data
// The program
this.prog = new Program(gl);
this.prog.set_shaders(this.VERT, this.FRAG);
this.index_buffer = new IndexBuffer(gl);
// Buffers
this.vbo_position = new VertexBuffer(gl);
this.vbo_tangents = new VertexBuffer(gl);
this.vbo_segment = new VertexBuffer(gl);
this.vbo_angles = new VertexBuffer(gl);
this.vbo_texcoord = new VertexBuffer(gl);
// Dash atlas
this.dash_atlas = new DashAtlas(gl);
}
示例3: init
protected init(): void {
const {gl} = this
const vert = vertex_shader
const frag = fragment_shader(this._marker_code)
// The program
this.prog = new Program(gl)
this.prog.set_shaders(vert, frag)
// Real attributes
this.vbo_x = new VertexBuffer(gl)
this.prog.set_attribute('a_x', 'float', this.vbo_x)
this.vbo_y = new VertexBuffer(gl)
this.prog.set_attribute('a_y', 'float', this.vbo_y)
this.vbo_s = new VertexBuffer(gl)
this.prog.set_attribute('a_size', 'float', this.vbo_s)
this.vbo_a = new VertexBuffer(gl)
this.prog.set_attribute('a_angle', 'float', this.vbo_a)
// VBO's for attributes (they may not be used if value is singleton)
this.vbo_linewidth = new VertexBuffer(gl)
this.vbo_fg_color = new VertexBuffer(gl)
this.vbo_bg_color = new VertexBuffer(gl)
this.index_buffer = new IndexBuffer(gl)
}