mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
Auto merge of #9107 - ecoal95:webgl-uniforms-and-nits, r=simartin
webgl: Track the current program, implement some uniform functions, and nits Was done while implementing sequence arguments. Depends on #9056. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9107) <!-- Reviewable:end -->
This commit is contained in:
commit
c13e84010d
8 changed files with 196 additions and 47 deletions
|
@ -11,6 +11,8 @@
|
|||
</style>
|
||||
<canvas id="c" width="512" height="512"></canvas>
|
||||
<script id="vertex_shader" type="x-shader/x-vertex">
|
||||
precision mediump float;
|
||||
|
||||
attribute vec2 a_position;
|
||||
|
||||
void main() {
|
||||
|
@ -19,6 +21,8 @@ void main() {
|
|||
</script>
|
||||
|
||||
<script id="fragment_shader" type="x-shader/x-fragment">
|
||||
precision mediump float;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = vec4(0, 1, 0, 1); // green
|
||||
}
|
||||
|
@ -67,5 +71,5 @@ void main() {
|
|||
|
||||
gl.enableVertexAttribArray(position);
|
||||
gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);
|
||||
gl.drawArrays(gl.TRIANGLES, 0, square_data.length);
|
||||
gl.drawArrays(gl.TRIANGLES, 0, square_data.length / 2);
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue