本文整理汇总了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)
}