diff --git a/doc/python_api/examples/gpu.1.py b/doc/python_api/examples/gpu.1.py index 20798df9e60..7e60dc656e5 100644 --- a/doc/python_api/examples/gpu.1.py +++ b/doc/python_api/examples/gpu.1.py @@ -173,11 +173,13 @@ import gpu from gpu_extras.batch import batch_for_shader coords = [(1, 1, 1), (-2, 0, 0), (-2, -1, 3), (0, 1, 1)] -shader = gpu.shader.from_builtin('UNIFORM_COLOR') +shader = gpu.shader.from_builtin('POLYLINE_UNIFORM_COLOR') batch = batch_for_shader(shader, 'LINES', {"pos": coords}) def draw(): + shader.uniform_float("viewportSize", gpu.state.viewport_get()[2:]) + shader.uniform_float("lineWidth", 4.5) shader.uniform_float("color", (1, 1, 0, 1)) batch.draw(shader) diff --git a/doc/python_api/examples/gpu.3.py b/doc/python_api/examples/gpu.3.py index 06efb1f8dbe..ce05cb9b4ac 100644 --- a/doc/python_api/examples/gpu.3.py +++ b/doc/python_api/examples/gpu.3.py @@ -17,11 +17,13 @@ indices = ( (4, 5), (4, 6), (5, 7), (6, 7), (0, 4), (1, 5), (2, 6), (3, 7)) -shader = gpu.shader.from_builtin('UNIFORM_COLOR') +shader = gpu.shader.from_builtin('POLYLINE_UNIFORM_COLOR') batch = batch_for_shader(shader, 'LINES', {"pos": coords}, indices=indices) def draw(): + shader.uniform_float("viewportSize", gpu.state.viewport_get()[2:]) + shader.uniform_float("lineWidth", 4.5) shader.uniform_float("color", (1, 0, 0, 1)) batch.draw(shader)