diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-19 23:32:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-19 23:38:20 +0300 |
commit | 3c8c9760865d14c8dffa3a4cd091e4027b1501e3 (patch) | |
tree | 50639787a78d9bc592d8235c14655bc535ca0349 /doc/python_api/examples/gpu.8.py | |
parent | 5f21030a81fa306f807be5bee8bb1df8dd93a98e (diff) |
Cleanup: gpu docs
Diffstat (limited to 'doc/python_api/examples/gpu.8.py')
-rw-r--r-- | doc/python_api/examples/gpu.8.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/doc/python_api/examples/gpu.8.py b/doc/python_api/examples/gpu.8.py index 28964d2e6b2..56cbb93c61a 100644 --- a/doc/python_api/examples/gpu.8.py +++ b/doc/python_api/examples/gpu.8.py @@ -2,10 +2,10 @@ Generate a texture using Offscreen Rendering -------------------------------------------- -1. Create an :class:`gpu.types.GPUOffScreen` object. -2. Draw some circles into it. -3. Make a new shader for drawing a planar texture in 3D. -4. Draw the generated texture using the new shader. +#. Create an :class:`gpu.types.GPUOffScreen` object. +#. Draw some circles into it. +#. Make a new shader for drawing a planar texture in 3D. +#. Draw the generated texture using the new shader. """ import bpy import gpu @@ -63,9 +63,13 @@ fragment_shader = ''' ''' shader = gpu.types.GPUShader(vertex_shader, fragment_shader) -batch = batch_for_shader(shader, 'TRI_FAN', - {"position" : ((-1, -1), (1, -1), (1, 1), (-1, 1)), - "uv" : ((0, 0), (1, 0), (1, 1), (0, 1))}) +batch = batch_for_shader( + shader, 'TRI_FAN', + { + "position": ((-1, -1), (1, -1), (1, 1), (-1, 1)), + "uv": ((0, 0), (1, 0), (1, 1), (0, 1)), + }, +) def draw(): @@ -78,4 +82,5 @@ def draw(): shader.uniform_float("image", 0) batch.draw(shader) -bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
\ No newline at end of file + +bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW') |