Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/gpu_extras/presets.py
| Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | with gpu.matrix.push_pop(): | ||||
| if isinstance(texture, int): | if isinstance(texture, int): | ||||
| # Call the legacy bgl to not break the existing API | # Call the legacy bgl to not break the existing API | ||||
| import bgl | import bgl | ||||
| bgl.glActiveTexture(bgl.GL_TEXTURE0) | bgl.glActiveTexture(bgl.GL_TEXTURE0) | ||||
| bgl.glBindTexture(bgl.GL_TEXTURE_2D, texture) | bgl.glBindTexture(bgl.GL_TEXTURE_2D, texture) | ||||
| shader.uniform_int("image", 0) | shader.uniform_int("image", 0) | ||||
| else: | else: | ||||
| shader.uniform_sampler("image", texture) | shader.uniform_sampler("image", texture, filter='NEAREST') | ||||
| batch.draw(shader) | batch.draw(shader) | ||||