All Questions
31
questions
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 ...
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:
...
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 ...
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 ...
0
votes
1
answer
326
views
How to force draw_handler_add?
I have a draw function inspired from this answer:
...
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.
...
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:
...
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 ...
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, ...
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 ...
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:
...
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?
...
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 ...
-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 ...
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 ...
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 ...
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
...
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 ...
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 ...
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?...
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 ...
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 ...
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 ...
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 ...
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.
...
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?
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.
...
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"
...
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:
...
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():
...
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:
...