mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
PyGPU: call 'GPU_shader_bind' in 'GPUShader.uniform_' methods
This simplifies python code.
When we call a method like shader.uniform_float("color", (1,1,1,1)),
we expect the shader's uniform to be updated regardless of whether the
shader is bound or not.
And `batch.draw()` already calls `GPU_shader_bind` inside.
Differential Revision: https://developer.blender.org/D15929
This commit is contained in:
parent
2fffd7d7a8
commit
2ce8b01c59
11 changed files with 7 additions and 10 deletions
|
|
@ -41,7 +41,6 @@ batch = batch_for_shader(shader, 'TRIS', {"position": coords})
|
|||
|
||||
|
||||
def draw():
|
||||
shader.bind()
|
||||
matrix = bpy.context.region_data.perspective_matrix
|
||||
shader.uniform_float("viewProjectionMatrix", matrix)
|
||||
shader.uniform_float("brightness", 0.5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue