Cleanup: gpu docs

This commit is contained in:
2018-11-20 07:32:49 +11:00
parent 5f21030a81
commit 3c8c976086
12 changed files with 130 additions and 86 deletions

View File

@@ -32,7 +32,8 @@ fragment_shader = '''
coords = [(1, 1, 1), (2, 0, 0), (-2, -1, 3)]
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(shader, 'TRIS', {"position" : coords})
batch = batch_for_shader(shader, 'TRIS', {"position": coords})
def draw():
shader.bind()
@@ -41,4 +42,5 @@ def draw():
shader.uniform_float("brightness", 0.5)
batch.draw(shader)
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')