Questions tagged [opengl]

Questions about OpenGL (Open Graphics Library) OpenGL is an API used to render real-time 2D and 3D graphics. Blender uses OpenGL for drawing the user interface, 3D view, and the game engine.

97 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
11
votes
1answer
1k views

Per-Vertex lighting in GLSL?

How can I achieve per-vertex lighting (like in single/multi-texture shading) in GLSL with all of the other GLSL features (like buffer shadows, texture layers, etc.)? Bonus points if it can be done in ...
7
votes
0answers
1k views

Does a model exporter embedding materials as GLSL scripts exist?

as described in Blender Shader in OpenGL/GLSL, it is possible to export the (unoptimized) GLSL code generated by Blender for a given material. Since the viewport can use such GLSL for real-time ...
5
votes
0answers
41 views

Copy framebuffer of 3D View into custom frame buffer

General question: Is there a reliable way to directly access the OpenGL framebuffer of a View3D for copying? (Please see the end of the post for more detailed questions) I need a very fast way to copy ...
5
votes
0answers
455 views

PyOpenGL and VBO Indexes

Long story short, I'm trying to do a modal handler that draws using OpenGL into the viewport. Immediate mode through BGL works fine, but is dog slow. I tried using VBOs through BGL but there seems to ...
4
votes
0answers
48 views

Blender won't start - GPUShader: compile error - AWS Elastic Graphics

I am looking to run a Blender workload in Amazon Web Services (AWS). I am testing on a Windows Server image on a non-GPU compute resource. Instead of GPU I am attaching AWS Elastic Graphics to the ...
4
votes
0answers
417 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 ...
4
votes
0answers
459 views

Viewport widgets with draw handler

Is it possible to create viewport widgets with draw handler? I have an operator which produces simple mesh geometry, I use operator redo properties panel to edit the result as shown in animation ...
3
votes
0answers
260 views

Rendering with OpenGL in Blender does not show the intended rendered image or animation

I am trying to render animations and images fast using the OpenGL feature in Blender but even though I want it to render a fully rendered image or animation, it only renders the solid image, or the ...
3
votes
0answers
88 views

How do I use Bgl?

So my question is: I understand nothing about openGl api, that's super confuse to me, Where do I start? I did get that I need to append a callback to a draw handler and remove it to enable/disable my ...
3
votes
1answer
105 views

How to apply two different materials in Blender Internal on front faces and back faces, *while involving transparency*

Basically, I want to see through the transparent front faces to the opaque back faces. This isn't the same as flipping all normals and executing backface culling because I want the front faces to be ...
3
votes
1answer
78 views

Is possible to keyframe a mask textures as a factor for two other textures in realtime?

Is possible to keyframe a mask textures as a factor for two other textures in realtime? I have set up a blender internal materials node setup, basically two distinct materials mixed with a Mix RGB ...
3
votes
0answers
149 views

Could not Render Loaded Texture in 3D View by bgl module

I wrote below scripts to render texture already loaded by blender. However, no images are rendered on 3D View. This code works correctly when I run this script on blender 2.70. But, this script ...
3
votes
0answers
387 views

.blend file size much larger after OpenGL Render

I am working on a detailed dialogue scene that is 600 mb. It is a very complex scene, with each part in single layers. I know that is a very big file size, but what my machine can handle it. What ...
2
votes
0answers
25 views

Custom shader script in compositor (de-linearize depth buffer)

Some months ago I wrote a minimal opengl 2.5d game engine with pre-rendered backgrounds (such old Resident evil, Alone in the dark and Final fantasy games). Depth is managed through a grayscale image ...
2
votes
0answers
23 views

Rendering depth buffer to texture using BGL fails on FBO drawing

I am writing a custom render engine for a level editor addon with GPU / bgl modules. I need to render a depth buffer to texture to later use in my shaders. I tried the way it is usually done with ...
2
votes
0answers
31 views

blg module not being detected

i just started using bgl with blender scripting and it's giving this error "AttributeError: module 'bgl' has no attribute 'GL_MODELVIEW_MATRIX" i just checked on API documentation and it's supposed to ...
2
votes
0answers
241 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
0answers
1k views

Custom Render Engine with bgl

I need to code my own Render Engine to do specific rendering passes. I don't want to build my own Blender app by coding in c/c++, so i try to make it work in Python. But i need OpenGL functions. ...
2
votes
0answers
253 views

Limit selection to visible doesn't work properly

I made a realistic aborygen bust portrait and wanted to make an OpenGL viewport render of it. But when I zoom out from the object the wireframe of the eyeball is getting more and more visible. I want ...
2
votes
0answers
133 views

How to activate smoothing in bgl (opengl)?

All is in the title. I'm not able to make smoothing work, when drawing on a texture. Here is the code before the drawing: ...
2
votes
0answers
528 views

Display Images with bgl

I'm trying to display an image external to blender in the 3d view with python and bgl. Is it possible not to load an image in data.images and display it? The following code display an image from the ...
2
votes
0answers
191 views

Modal operator to highlight

Ok. I'm a bit stuck on this. I accept defeat and am asking for advice. Here is a portion of the larger addon. The purpose of this snippet is to show the area user is working on. Basically, user inputs ...
2
votes
0answers
134 views

Combining OpenGL and Blender Render (For Lightsabers)

I'm working on another lightsaber video. For the clashes this time, I've decided to utilize a lens flare pack by cfirwin3 here and it's super awesome. However, it appears that they only render ...
2
votes
0answers
220 views

opengl flat shading in blender

i'm trying to render my scene from a script. i've got some objects with materials that are Shadeless, and when rendering with the blender renderer in my script, they show up as expected: no shading. ...
1
vote
0answers
23 views

Blender doesn't start up

Good evening, I've been having an issue where the program itself won't start up after the initial command prompt window has disappeared. The program fully closes, it doesn't show that it's not ...
1
vote
0answers
14 views

quick preview animation with animated material?

I am looking for a poor man's render of an animation in order to evaluate blocking, timing, camera movements etc. without the "cost" of a full render. I found Is there a way to make a quick ...
1
vote
1answer
24 views

OpenGL freezes and turns off blender

I've encountered this behavior several times that blender put random black and white points on the blender window then a message box appears and says "Too many errors occurred. Application must close ...
1
vote
0answers
34 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, ...
1
vote
0answers
18 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 ...
1
vote
0answers
19 views

Order of operations when calculating object transform matrix (matrix_world, viewport channels, OpenGL model matrix)

With its Python API, Blender allows us to directly assign the transforms of objects, using matrix_world attribute. Under the hood Blender renders objects via ...
1
vote
2answers
124 views

Preview in viewport using OpenGL shader

I am trying to apply a custom shader (OpenGL, but if that's not possible I can learn OSL) to a STL. I will not use any lights, cameras, I'm not going to render it eventually. I would like to have the ...
1
vote
0answers
73 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? ...
1
vote
0answers
87 views

Blender 2.81 OpenGL 3.3 Error

So recently I got a new computer since my old one was pretty bad and I needed an upgrade. This PC is incredibly fast and powerful but for some reason it's having trouble running Blender 2.81. I've ...
1
vote
0answers
48 views

How do I find the final pose matrix for every bone to send to the shader?

Hello any advice would really be appreciated. I know there are lots of threads on this already but I have read many of them and I am still having trouble. I want to export a simple skeletal ...
1
vote
0answers
300 views

Where are the settings to increase cycles threads?

I am trying to adapt the cycles render code to allow me to use the full threading power of my GPU (Radeon RX750 8Gb, 2048 OpenGL threads). There seems to be a limit from some time ago of 1024 threads, ...
1
vote
0answers
118 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 ...
1
vote
1answer
526 views

blender 2.8 beta doesn't find opengl

Blender 2.8 doesn't load on my windows 7 notebook. It only says several times: "Warning! Ignoring untested OpenGL context profile mask bits. Warning! OpenGL core profile not available." I already ...
1
vote
0answers
821 views

Big problem when exporte normal map from Substance Painter to Blender

I need help. I have this problem when I export a normal map from Substance Painter to use in Blender. As you can see in the images it show some dark spots in the object, and it looks worse at ...
1
vote
1answer
948 views

Running Blender under Virtualbox

I setup a VirtualBox machine under Windows for dev related stuff (python, visual studio etc), everything works except that I cant run Blender :( it crashes with ...
1
vote
0answers
217 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 ...
1
vote
0answers
213 views

Is there a way to make Blender 2.8 STOP checking my OpenGL version?

My OpenGL version is just fine, but when Blender checks, it gets a bad result because I'm running via Remote Desktop. This wasn't too bad in previous versions because Blender only checked once on ...
1
vote
0answers
201 views

How do I set output video file name using python script?

I'm using a python script to render my scene using the OpenGL render to get more speed, as the quality I'm getting is enough for my purposes. I'm using this script: ...
1
vote
0answers
53 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
1answer
368 views

Python Opengl Render doesn't show texture

when I click opengl render button in the GUI of the 3D view, the rendered image contains texture. However, when I use python script to render the same thing, I only get solid image without texture. <...
1
vote
0answers
194 views

Apply 2D filters to camera output in the Game Engine

is it possible to apply custom GLSL shader like the shaders you can set in the logic bricks called "Filter2D" to a camera that is not the main camera? I am rendering the output of a camera in the ...
1
vote
0answers
106 views

Mouse event program freezes my Blender

recently I am trying this code for handling some clicks, mixed by bpy and bgl. However when I "Run script", then select it from ...
1
vote
0answers
125 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 ...
1
vote
0answers
223 views

Convert materials from cycles to bge as visible in viewport material shading mode

In 2.78 the material viewport shading mode of cycles is greatly improved. In fact it is even better than BI in some aspects - for example it now correctly displays cube projection textures, something ...
1
vote
0answers
191 views

Python BGL Draw text in the node editor

I have an operator (MyOperatorTest). How can I make it so that when this operator is run, text is printed on the screen to the top left corner of the node editor? (The operator is in the node editor)
1
vote
0answers
2k views

How to correctly export from blender to opengl with a texture?

I am learning opengl from here and we are given an obj file for blender of crysis nanosuit. When I load this with opengl, it just loads fine. But then I imported the file to blender and added some ...