Skip to main content

All Questions

Tagged with
1 vote
1 answer
52 views

Unable to read depth from buffer when offscreen rendering

I'm trying to read the depth buffer from a frame buffer during offscreen rendering using the gpu.types.GPUFrameBuffer.read_depth() function from the gpu module. No ...
Sandroid's user avatar
2 votes
1 answer
95 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
4 votes
3 answers
422 views

How to draw a specific color with gpu shader

This is a bulid-in shader of gpu module to display a 2D rectangle in viewport, if you check the color of the rectangle via photoshop/MSpaint or use ...
X Y's user avatar
  • 6,213
1 vote
0 answers
218 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
0 votes
1 answer
326 views

How to force draw_handler_add?

I have a draw function inspired from this answer: ...
cak3_lover's user avatar
9 votes
1 answer
781 views

Anti-Aliasing in GPU shader Module(OpenGL)

How to smooth the bound of the shape? If you run the following script in blender, you can see the Jagged Edge in that shape. ...
X Y's user avatar
  • 6,213
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
0 votes
0 answers
407 views

capture data from different cameras

I need this for my video game that I want to start on in Blender Game Engine. I have not figured out how to use multiple cameras and make them give data out without them being active cams or without ...
user104998's user avatar
1 vote
1 answer
709 views

Fast streaming camera view to video for linux (v4l) system device

What i'm trying to achieve is to stream an arbitrary camera view in blender to a v4l device. What i've done so far After reading the community post about streaming the Eevee view on Windows and linux, ...
g3n35i5's user avatar
  • 63
4 votes
1 answer
1k views

Is there a way to render depth buffer into a texture with GPU/bgl python modules?

I need to render depth buffer of Blender's scene into a texture to further use it my shaders. I tried using the common OpenGL recipes for doing that, but none of them worked as it seems there is ...
D. Skarn's user avatar
  • 695
2 votes
1 answer
644 views

How to draw RGBA 2D image in 3d_view with gpu module (or without)?

I just copied and pasted from https://docs.blender.org/api/current/gpu.html#d-image: ...
Cyril Blake's user avatar
1 vote
0 answers
351 views

Render order of triangles is wrong with custom draw handler

Example code from GPU Shader Module (gpu) "Mesh with Random Vertex Colors" renders faces in wrong/weird order, what might be the cause? ...
KJS's user avatar
  • 237
6 votes
1 answer
507 views

How to make voronoi move like living ants?

In Twitter link below, I saw this work by Joe Gatling a few days ago. His voronoi moves like live bugs. How do you create that in Blender? Moving ants with voronoi. Edit. I'm back. I've just ...
Rita Geraghty's user avatar
-3 votes
1 answer
268 views

blf is a module or a parameter?

blf is a module or a parameter? I have read the documentation of blender, and I do not understand well what blf matters, or if it is only a parameter. I ...
user avatar
1 vote
1 answer
1k views

For Blender, which is the better language to learn - OpenGl or OSL? And why?

I have only yesterday started to learn OSL. Since OSL tutorials are scarce in Youtube, I am beginning to wonder if OSL is becoming obsolete as I get the impression that it is overshadowed by OpenGl. I ...
Rita Geraghty's user avatar
1 vote
0 answers
228 views

bgl Hello Triangle Blank Screen

This code should draw the "Hello Triangle" (1) that everyone starts off with but it's not showing up. Since it's in Blender, I used (3) as a reference for when to draw. That's why the code itself ...
Guilty Ghost's user avatar
2 votes
0 answers
363 views

blender 2.8 glRectf() not there

I'm trying to convert a 2.79 add-on to 2.80. I'm running into a problem with openGL function glRectf(). The code that's currently in the add-on draws the menu as follows ...
Eternity Tomorrow's user avatar
2 votes
0 answers
454 views

How to draw custom, complicated ui element

Is it possible to add custom drawn elements to UI? e.g. access OpenGL and draw shapes from code, create some "canvas" in UI and draw on it. e.g. I'd like to create a complicated interface, something ...
Kowalski Paweł's user avatar
4 votes
0 answers
609 views

How to use bgl?

I want to render simple lines on the 3D viewport through a modal operator but not using glBegin/End because those commands are deprecated in opengl 3.3 and will not be avaliable on 2.8 leaving me ...
StackOverflowToxicityVictim's user avatar
1 vote
2 answers
821 views

How to align modal draw to the middle of the 3d viewport?

I have a question about the opengl modal draw : How to align text from a modal draw to the middle of the viewport and and keep it automatic between Tool Shelf and Property Shelf, when i changing them?...
MKB's user avatar
  • 78
1 vote
0 answers
84 views

How to handle drawing with multiple views

I want to draw in the screen space of each ImageEditor. The drawing itself works pretty good, each space has its own draw handle registerd with the correct "view_to_region" functions passed ...
kio's user avatar
  • 41
1 vote
3 answers
2k views

Draw a 2d box using Bgl in viewport

I have been trying read up a lot on opengl drawing using python and have been trying to create a script which display a text and a 2d shape on the viewport (a rectangle or square). From reading the ...
Retrax's user avatar
  • 1,520
3 votes
1 answer
1k views

How can I add a new object on mouse click?

I am looking for a code, that adds an uv sphere on a mesh when a mouse click happens. I saw the topic: Adding new object on mouse click? but there are no answers ...
Ilian Zapryanov's user avatar
1 vote
0 answers
180 views

Modal operator and opengl drawing update issue

For this question, I've coded a little script that draws mesh's elements indices with opengl. All is working well, except when in edit mode, some grab, scale, rotate is done. In these cases the ...
lemon's user avatar
  • 60.5k
8 votes
1 answer
4k views

How do you remove a draw handler after it's been added?

I'm making an attempt to use batFINGER's method from this answer for drawing some text on screen without a modal operator, but I'm finding I can't get the text to go away once it's been drawn. ...
andyV's user avatar
  • 623
3 votes
2 answers
3k views

How to draw shapes in the node editor with python bgl

I want to draw a diagram using shapes such as triangles and squares in the node editor. How can I do this?
John Roper's user avatar
1 vote
0 answers
176 views

Get error when python script in use bgl is running

My script got error when it ran python script in use blender opengl(bgl). Below python script. ...
tomoyaigarashi's user avatar
0 votes
2 answers
306 views

shader.setSample invalid uniform value

I'm having troubles with my "clouds" texture while trying to sample it into my shader, the error is "invalid uniform value: clouds" ...
Yvain's user avatar
  • 722
3 votes
1 answer
272 views

How get drawing area in callback for quadview?

I need help with Quadview drawing. I know how get the quad using the mouse position, but the problem is get the drawing area in the callback. I have some code like this: ...
Antonioya's user avatar
  • 492
8 votes
1 answer
2k views

Render specific frames with opengl via python

When I run the following script, current_frame is set AFTER the render.opengl(): ...
Erik Bongers's user avatar
1 vote
0 answers
417 views

How can I get a list with the 2D screen coordinates of visible Vertices in 3D view without having to convert 3D to 2D? [duplicate]

The bgl module allows us to obtain various information displayed in 3D Blender view. For example, I made a script that gets the 3D coordinate where the mouse cursor hits a object: ...
Mano-Wii's user avatar
  • 426