Skip to main content

Questions tagged [gpu-module]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
22 views

Add text (label) to colored bar created using gpu module

I've created a colored bar using the gpu module (see picture). Here is the code. Now I would like to add some text as displayed in the image with the labels 5 Kg and 100 kg. Any suggestion? ...
Alex Mekx's user avatar
0 votes
0 answers
41 views

Isolating a collection in an offscreen buffer without altering the viewport?

The goal of the script is to live-capture the scene from a camera POV but only have certain collections be visible in the texture. Some things I have tried - hiding objects before drawing and ...
Nyubug's user avatar
  • 1
3 votes
1 answer
146 views

Show Texture preview via Gpu module

We can show a image (bpy.types.Image) on viewport through the following python code. But how about a texture (bpy.types.Texture) ...
X Y's user avatar
  • 6,188
1 vote
1 answer
51 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
0 votes
1 answer
185 views

HIP binary kernel not found

I just got a MINISFORUM Venus UM790 Pro Mini PC AMD Ryzen 9 7940HS up to 5.2 GHz 64GB DDR5 1TB SSD with AMD Radeon 780M. I enabled HIP in system settings and selected the 780M GPU. I selected GPU ...
geswho22's user avatar
4 votes
1 answer
205 views

Batches are drawn on top of each other with GPU module

I've been attempting to write a custom RenderEngine for Blender, but have stumbled on a fundamental problem which is preventing me from going any further. To illustrate the issue I will include an ...
Midas's user avatar
  • 145
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
0 votes
0 answers
58 views

Copying the 3D view Framebuffer doesn't give me the current frame. Bug or expected behavior?

I'm writing an addon for which I need to extract information out of a cycles viewport render. In essence, I'm using a callback function in the SpaceView3D that gets called every time the 3D viewport ...
DerOrbiter1's user avatar
4 votes
0 answers
217 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
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
2 answers
303 views

How to implement bgl.glScissor with using gpu module?

As you know, bgl module has been deprecated and will be deleted in the future Blender release. So, I'm tackling to change my old code to use ...
nutti's user avatar
  • 459
1 vote
1 answer
152 views

Draw lines by 3d Cursor location and rotation

I want to draw lines using 3d cursor location and rotation (to draw it axis). How to calculate endpoint location for each axis? Example: ...
APEC's user avatar
  • 590
1 vote
0 answers
110 views

GPU Module equivalent to glDepthRange

I'm working to change my drawing code over from bgl calls to Blender's GPU module (as bgl calls are set to be depreciated) and can't seem to find an equivalent to the bgl.glDepthRange function in the ...
Dan's user avatar
  • 83
0 votes
1 answer
166 views

How to invoke draw_handler_add while running script?

I have a draw_handler_add like this: ...
cak3_lover's user avatar
0 votes
1 answer
185 views

poll() Missing 'window' in context

I'm trying to 'INVOKE_DEFAULT' using thread in the following code: ...
cak3_lover's user avatar
1 vote
1 answer
203 views

cannot set pixels to buffer image, incorrect sequence item type: B

I'm trying to run the script: ...
cak3_lover's user avatar
4 votes
3 answers
1k views

How to draw an outline with bpy gpu module?

is there a simple & efficient way to draw the outline of a mesh with the gpu module ? the script should be able to control the width of the outline line Defining outline: "A line indicating ...
Fox's user avatar
  • 1,942
0 votes
1 answer
79 views

Make geometry from GPUShader visible for F12 rendering

I'm using GPUModule with shaders to render some points in the 3D view: ...
j_re's user avatar
  • 1
1 vote
1 answer
299 views

Draw UI elements with the GPU module in the N-key panel?

In an add-on I'm developing, I'd like to draw elements (using the GPU module) to a N-key panel. I've looked extensively, but I haven't found a correct answer. https://blender.stackexchange.com/a/...
i7_macintosh's user avatar
2 votes
1 answer
543 views

Drawing to multiple render targets using the GPU module

Is there a way to draw to multiple render targets at once using the Blender's GPU module? I am looking for something similar to glDrawBuffers in OpenGL. Say, for example, my fragment shader looks like ...
QuantumCoderQC's user avatar
0 votes
0 answers
581 views

Why can't I import a specific class from the module?

I'm trying to retrieve a class from the module called draw_op. The problem is in the module, some of classes can be imported normally while some don't. Error: <...
sniffingdoggo's user avatar
1 vote
0 answers
582 views

Create box/rectangle shape based on two points/vector using python

I want to create a box/rectangle shape using two points while aligning to a given normal. The image below shows what I want to achieve. The left side shows the two points supplied by the selected ...
Blenderguppy's user avatar
2 votes
0 answers
294 views

Blender 3.0 GPU API and BGR colors

I want to use the new GPU API for Blender 3.0 to copy the content of a texture into a gpu.types.Buffer. Although this works fine with the following small code, I wonder how I can tell the API to copy ...
reg.cs's user avatar
  • 488
4 votes
1 answer
319 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
3 votes
3 answers
1k views

How to make rounded corners for 2d rectangle with a custom shader?

Does anyone know how to make rounded corners for a 2d rectangle with a custom shader? ...
Karan's user avatar
  • 2,381
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
2 votes
0 answers
287 views

How to remove drawing with gpu module in blender?

I have drawn some points with the GPU module of Blender and I need to draw other things in an empty window without closing Blender. But I don't know how to remove all these points with codes. It seems ...
Linda Fu's user avatar
  • 121
1 vote
1 answer
389 views

Display series of 2D squares using GPU Shader Module

My addon makes measurements on objects and assign a color to the objects according to the measured value. Now I would like to display a series of stacked coloured squares in the viewport to serve as a ...
amaizel's user avatar
  • 177
4 votes
1 answer
1k views

How can I make a 2d gpu polygon and text follow the cursor?

The code: ...
Retrax's user avatar
  • 1,520
5 votes
1 answer
2k views

How do you use the GPU offscreen render API in 2.8?

For a while now in blender there has been this GPU Off-screen renderer; however, I think it has changed a bit in 2.8, and plus, I never even knew how to use it before. Basically I want to be able to ...
B''H Bi'ezras -- Boruch Hashem's user avatar
2 votes
1 answer
643 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
5 votes
0 answers
541 views

Removing space draw callbacks after losing the handle?

A small edit of test code from GPU Shader Module (gpu) "Mesh with Random Vertex Colors" to save the handle to the driver namespace ... ...
batFINGER's user avatar
  • 84.6k
6 votes
1 answer
801 views

Transparency in Blender 2.8 GPU Python Module

I've been messing around with the new GPU python module in Blender 2.8. But I cannot find a way to make my lines and triangles transparent. The alpha channel is completely ignored. I even tried it ...
WalterTheModeler's user avatar
4 votes
2 answers
6k views

How to draw geometry in 3d View window with bgl

Since there isn't demo in API docs, so I tried simple script below: ...
NGE's user avatar
  • 347