Questions tagged [bgl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
60 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
  • 598
5 votes
1 answer
91 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.5k
0 votes
0 answers
10 views

Using BGL to color lit an Object from the Viewport objects

I am figuring out a way to Color lit a object using BGL, but I have never encountered with BGL, so I would like to figure out how you could lit this object let's say obj from this code ...
NamanDeep's user avatar
  • 461
4 votes
0 answers
186 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
2 votes
0 answers
276 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
941 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
  • 161
1 vote
0 answers
180 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
2 votes
1 answer
381 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
181 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
244 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
0 answers
212 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: ...
eugenefrunze's user avatar
1 vote
0 answers
88 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
301 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
1k 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