diff options
Diffstat (limited to 'doc/python_api/examples/gpu.4.py')
-rw-r--r-- | doc/python_api/examples/gpu.4.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/python_api/examples/gpu.4.py b/doc/python_api/examples/gpu.4.py index e05290a9442..b1a1ba827db 100644 --- a/doc/python_api/examples/gpu.4.py +++ b/doc/python_api/examples/gpu.4.py @@ -4,7 +4,6 @@ Mesh with Random Vertex Colors """ import bpy import gpu -import bgl import numpy as np from random import random from gpu_extras.batch import batch_for_shader @@ -31,9 +30,10 @@ batch = batch_for_shader( def draw(): - bgl.glEnable(bgl.GL_DEPTH_TEST) + gpu.state.depth_test_set('LESS_EQUAL') + gpu.state.depth_mask_set(True) batch.draw(shader) - bgl.glDisable(bgl.GL_DEPTH_TEST) + gpu.state.depth_mask_set(False) bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW') |