Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [bgl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
25 views

Add text information directly to the viewport for 5 sec

I am trying to add text information directly to the viewport so that it would be displayed for 5 seconds after the button is pressed and then disappear. I have not been able to realize this using ...
Andrew's user avatar
  • 83
2 votes
1 answer
98 views

Drawing a circle that faces towards the view with GPU/BGL?

Im trying to draw a circle using the GPU/BGL module that appears on a given certain 3D position (in my example, the cursor's location) and, when drawing, it points towards the current view. I'm using: ...
Ommadawn's user avatar
  • 648
5 votes
1 answer
106 views

with bgl deprecated in b3.5+ how to compensate for loss of GL_POLYGON_OFFSET_FILL and bgl.glPolygonOffset

I'm wondering how others have solved this problem now bgl is being deprecated. We have a few places in the Sverchok drawing code where we avoid zfighting between ...
zeffii's user avatar
  • 39.7k
4 votes
0 answers
218 views

Migrating geometry shaders to Metal

I'm working on BlenderBIM (architecture addon for Blender) and we have a bunch of shaders to support plan annotations in viewports. Mainly it's simple shapes based of lines - lines, segment based ...
FamousSnake's user avatar
4 votes
0 answers
381 views

Drawing non-polyline smoothed lines with `gpu` module

Backstory: Since bgl module will soon to be deprecated and it's doesn't work on Metal already I was trying to move code to gpu ...
FamousSnake's user avatar
0 votes
1 answer
1k views

Addon stopped working on Mac/Metal in v3.5+ due to shader compile error. Console spam errors about bgl.glEnable calls

My addon that works on blender 3.3 up to blender 3.6 on windows does not compile anymore on Mac/Metal computers, with the error: Exception: Shader Compile Error ...
JulienH's user avatar
  • 171
1 vote
0 answers
220 views

Custom render engine - creating material previews with OpenGL?

I'm working on a custom render engine through a Python addon that uses the bgl module for most of its rendering. bl_use_preview ...
hayden0729's user avatar
1 vote
1 answer
523 views

Get view and perspective matrices of the current 3D viewport (not camera)

I'm making a script allowing me to apply fragment shaders to the 3D Viewport real-time. However, I don't know how to get view and perspective matrices of the current point of view. I know how to get ...
Wojtek Pachowiak's user avatar
0 votes
1 answer
213 views

How to get started with the code for drawing Blender’s user interface?

I’m interested in working with the drawing code responsible for the user interface in the Dope Sheet & Graph Editors (not the Python code for menus/panels, but rather the actual timeline, ...
Dr. Pontchartrain's user avatar
3 votes
1 answer
270 views

Script to draw lines within scene rather than over top of it?

Taking as an example this simple script to display an object's global bounding box: Is there any way to make lines display in such a way that they are overlapped by the appropriate geometry? I am ...
Malkalypse's user avatar
5 votes
1 answer
254 views

Correct display of blf-text in Blender 3D viewport

Hello to all Blender enthusiasts! I have some questions about rendering text in viewports using the blf module. Here is my code: ...
miloslavsky's user avatar
1 vote
0 answers
90 views

Render to float texture using Python API

Is there a way to render to a floating point texture format using blender's python api? Ideally I'd like to render to a RGBA32F. The suggested way to render to texture appears to be gpu.types....
Logan Gilmour's user avatar
4 votes
1 answer
322 views

Plot grid points on normal vector

I like to create virtual set of 3d grid points plotted/aligned on a normal vector. I'm planning to draw these points or lines using the GPU code. I've been experimenting with ...
Blenderguppy's user avatar
4 votes
2 answers
2k views

Fastest way copying from bgl.Buffer() to numpy array

I have some rendered or processed pixel data in a bgl.Buffer() object and need it in a numpy array but that proccess seems to take very long. Here is what I have tried so far: ...
Gottfried Hofmann's user avatar
0 votes
1 answer
87 views

why bgl meshes flip when nothing is selected?

As described in API the following script will create a mesh from active object using bgl module: ...
MohammadHossein Jamshidi's user avatar