Questions tagged [opengl]

OpenGL (Open Graphics Library) is a graphics standard and API which is platform-independent and available for desktop, workstation and mobile devices. It is designed to provide hardware-accelerated rendering, and hence gives greatly improved performance over traditional software rendering. OpenGL is used for applications like CAD software and computer games. The OpenGL standard, as well as OpenGL ES, is controlled by the Khronos group.

Filter by
Sorted by
Tagged with
2
votes
3answers
58 views

How to paint onto 3d models

I have searched this topic for very long time and have found basically no information on it. If we have a 3d model with a uv layout. What is the basic technique for 3d painting on said model with a ...
2
votes
2answers
156 views
+50

OpenGL - Recreate position in viewspace from depth values

Current state: I belive the reconstructed positions are correct. However, I still have the same problem as all the time. When I rotate around my single pointlight appears to be moving around also. I ...
1
vote
0answers
33 views

What is the simplest way to create basic 3d/isometric style images programatically like autocad/blender

I need the simplest route to programatically, via command line, through python or node, to create something like this using basic input of distance and 90 degree turn etc: https://i.imgur.com/SdY02gQ....
0
votes
0answers
53 views

Calculating of vectors in Phong Lighting Model

I'm learning about computer graphics and I have some questions about calculation of the vectors, so I will write the exercises that I have and I hope that someone can help me with the formulas that I ...
1
vote
1answer
48 views

Using buffers correctly in OpenGL compute shaders

I'm re-writing an algorithm that I first wrote using matrix/vector operation into OpenGL kernels in order to try to maximiz the performances. I have a basic knowledge of OpenGL, so I was able to get ...
0
votes
0answers
22 views

Implementing Feather feature of Photoshop

The "feather" in photo & video editing softwares like photoshop & Premiere Pro, I need to know whether it is simply a Gaussian blur around the edges of boundary or it is something ...
1
vote
1answer
42 views

How 3D painting software works

I am new to graphics programming and i'm learning opengl. I managed to make a really simple renderer where i can import models display theirs textures with all lighting. My goal is to make a simple ...
1
vote
1answer
19 views

Using original vertices coordinates after clipping

Clipping is down in homogeneous clip space, therefore after multiplying the vertices by the model-view matrix. But as we do clipping in clip space, the position of the new vertices that we interpolate ...
0
votes
0answers
37 views

GLSL asymmetric performance for point cloud

I'm currently using OpenTK (OpenGL binding for C#) to draw a lot of points (~17 million) - that very rarely change - in a cube (256 x 256 x 256) with different float "transparency weights". ...
0
votes
1answer
16 views

Get binding point of sampler/image in shader

I have an image and a sampler declared in a shader as follow layout(binding = 5) uniform isampler2D heightmap; layout(binding = 3) uniform writeonly uimage2D info; ...
0
votes
1answer
31 views

OpenGL shader introspection/interface queries for images

I've been looking at Interface queries in order to prevent common mistakes that are time consuming to debug, such as forgetting to bind a buffer, binding the wrong resource type, etc. However, I wasn'...
1
vote
1answer
47 views

Is it possible to send Texture Buffer to shader dynamically?

I want to send a series of integer to the geometry shader, while the data will be modified every frame. But when I try to retrive the sampleBuffer in geometry shader, it seems to keep output zero. Am ...
1
vote
1answer
64 views

Transfer the texture between two different sets of uv

Say I have a mesh with two sets of uvs. And I have a texture made for the first set of uvs. I would like to create a second texture that has the same relationship between its pixels and the second set ...
2
votes
0answers
54 views

How to retrieve data from Compute Shader to CPU?

I want to retrieve data that has created by the compute shader but have no clue how it works. After researching a few forums and articles on how it should work and this is what I came up with. Compute ...
1
vote
1answer
57 views

Does atomic functions on same memory location cause an performance issue?

is it worse to do for each invocation an atomicAdd on the same memory location than doing for each invocation an atomicAdd to a unique memory location? (I know, atomicAdd does not make sense when each ...
1
vote
0answers
51 views

Conditionals and branching in shaders

This is a quite wide subject which implies a lot of topics such as the platform or the compiler, but I think that it could be useful for everyone to know more about this. A common mistake is to think ...
1
vote
1answer
74 views

How are textures projected onto 3d models in texture painting applications

In most modeling software you can texture paint onto 3d models using so called stencil textures. They basically project a texture from the viewport view onto the model as seen for instance in the ...
1
vote
1answer
46 views

When unsetting a VAO, should you also unbind the associated VBOs?

I'm working with a js/wasm/c++ program that uses object oriented programming when updating the OpenGL state. There are corresponding c++ classes for VBOs (vertex buffer) and VAOs (vertex array). ...
1
vote
1answer
32 views

OpenGL Framebuffer with multiple Depthbuffers inside

I am trying to put multiple depthbuffers into one Framebuffer. I want to use VR and render both eyes at the same time: that means, in the geometry stage I want to clone the incoming triangle to two ...
0
votes
2answers
89 views

Why negate z when constructing projection matrix OpenGL

I constructed an orthographic projection matrix from this article on scratchpixel.com: ...
0
votes
0answers
45 views

Crystal ball rotation - I don't get why the code works

For context: I'm absolutely new to graphics programming and I've always had trouble getting the math. I had the task to write code for a crystal ball interface using OpenGL. There's an object in the ...
1
vote
1answer
95 views

How to scale signed distance field fonts properly?

I have a setup where I'm rendering a bunch of characters on a canvas with an SDF font. The users can zoom in to see the details of the smaller texts, but currently the smaller characters are quite ...
1
vote
0answers
61 views

OpenGL/D3D11 offscreen render multiple buffering

Recently I've been looking at Vulkan, and one thing that I noticed is that the application is responsible for choosing which buffer to render to in the case of multiple buffering. This got me thinking:...
2
votes
1answer
115 views

Dynamic Ray-Triangle Intersection

I am working on a small simulation software which has a 3D Renderer that is using OpenGL. I render objects to the screen as triangle meshes. To be able to select the triangles on the screen, I have ...
2
votes
1answer
73 views

Can the framebuffer in OpenGL jargon or its color buffer end up being the one and the same memory location as the one scanned by a display controller?

My understanding is: the 'framebuffer' in OpenGL is a collection of buffers: many (due to swapping or stereo rendering) color buffers, (only one?) z-buffer and (only one?) stencil buffer; each OpenGL ...
0
votes
0answers
18 views

Open GL mapping/hash function on hexagon grid, translating from a cell ID to pixel location on 1d texture

I've spent the last three days trying to figure this out, my intuition about this space has been thrown out of the window. The problem is this: I have a hexagon grid making function that returns an id ...
2
votes
1answer
57 views

Rendering moist/wet materials like human anatomies for surgical simulators

Real human anatomies look wet/ moist when operated. I am looking for some good methods for rendering anatomies in a virtual simulation, and hence I have done a literature survey on 'Rendering wet ...
2
votes
1answer
82 views

How to unproject cursor with orthographic projection

With perspective projection we can unproject screen space coordinates of the cursor to the near and far plane of the frustum and calculate the direction of the ray through the cursor. ...
1
vote
1answer
65 views

OpenGL task/mesh shader extension NV_mesh_shader not behaving as I expected

I am trying to get up to speed with the NV_mesh_shader extension from NVidia (on my RTX2080). Samples are rare, so I tried to come up with my own small sample. I am rendering a sphere (20 triangles) ...
0
votes
1answer
46 views

Force int array to compact memory

I have following structure which i use as an uniform buffer object. ...
2
votes
1answer
49 views

glutSolid* source code

I am trying to build a dedocohedron in OpenGL, and I know that there is a built-in function in GLUT for the purpose. I was wondering if there is a way to either see the sourcecode for those functions, ...
2
votes
1answer
55 views

With vsync enabled where does the wait happen in OpenGL?

When having vsync enabled I'm imagining that OpenGL has an explicit wait function to try and keep the frame rate constant. If so where is this function implemented exactly? After running some tests <...
3
votes
1answer
113 views

Shader that transforms a mercator projection to equirectangular?

I am new in the OpenGL - GLSL and trying to make a shader that taking a mercator projection texture as a source and converting it to an equirectangular projection texture. Sample input: (1024x1024) ...
0
votes
0answers
15 views

Custom Create Maps in OpenGL

I am trying to create some procedurally created terrains for which i need to create noise maps. How do I create a texture of noise map in OpenGL and then pass that in my vertex shader as a heightMap? ...
1
vote
0answers
34 views

What is the projection matrix of reverse (Byzantine) perspective?

I would like to construct a projection matrix for reverse perspective. I'm using OpenGL and tried to modify concepts from this excelent tutorial. I came up with: $$ \begin{bmatrix} 2\frac{(near-M)}{...
0
votes
1answer
25 views

OpenGL Render front and back faces with different shading for 3d modeller

I'm working on a simple 3d modeller and I would like to render the back facing triangles a bit darker, to easier differentiate between front and back faces. Like you can see in most modelling ...
1
vote
1answer
33 views

Do we have OpenGL shaders write out the intermediate *.o-esque file on first compile so that we can skip compiling them in run-time every single time?

Shaders get compiled during runtime every single time an app starts. I understand the reasoning for this is that there are so many GPU architectures out there that it does not make sense to ship pre-...
-1
votes
1answer
101 views

When do people need to work directly with a graphical API (eg: Direct3D) instead of using already made software?

I had this doubt in my head for several months and have been unable to find an answer anywhere on internet. I know what OpenGL, DirectX, Vulkan, Metal, etc... are, I already know what they are used ...
0
votes
0answers
97 views

Generate hardcoded texture data to pass to shaders

I'm trying to manually create a color data to load as a texture with OpenGl for learning purposes. I created an unsigned char array consisting of 4 pixels with 3 ...
0
votes
0answers
46 views

Why is my ray caster is running much faster as a fragment shader compared to a compute shader

I'm trying to write a simple ray caster in OpenGL with C++. Previously, I have been using the fragment shader of a quad that covers the entire screen to do all the ray calculations. Now, I want to do ...
1
vote
1answer
46 views

Passing mat4 array to GLSL succeeding but producing GL_INVALID_OPERATION

I'm currently passing an array of bone positions to GLSL for a skeletal animation shader; the positions are passing successfully but producing a GL_INVALID_OPERATION error. I'm passing the matrices ...
0
votes
0answers
34 views

imageStore to a 3D volume in a compute shader does not seem to be working

I am trying to have a compute shader write to a 2x2x2 image3D. It seems to work on ubuntu/mesa/openswr, but it fails on windows/igpu and windows/nvidia1080. It is really the simplest possible code to ...
0
votes
0answers
45 views

Best practices fo OpenGL static buffer data : what is best for performance?

My question is : to allocate static mesh data (vertex/index buffers that never change), is it best : To go the "obvious" way : "1 mesh = 1 VBO", submitting data using glBufferData with GL_STATIC_DRAW ...
1
vote
2answers
42 views

Older Api documentation

I am currently using a older IntelHd Gpu which supports Opengl3.1 (Glsl #version140). While trying to locate the relevant Api for this version ,the Khronos site only provides documentation for ...
1
vote
1answer
37 views

Implicit conversion in glsl shaders

When specifying member values for a structure consisting of float values like vec3 or mat3, is it guaranteed that if an integer ...
2
votes
1answer
55 views

Vector graphics output from shader program

I’m fairly new to shader programs in general but I have a question concerning vector graphics. I understand that a pixel shader can generate the color information to draw some sort of geometry on ...
0
votes
0answers
39 views

How to read illum value from mtl file using Assimp library?

I am loading an OBJ file using the ASSIMP library. Following is the MTL file associated with the obj file. ...
0
votes
0answers
21 views

Render to framebuffer > output color components greater than 1 in fragment shader

I am trying to render a scene to a framebuffer, then use the resulting texture to render my final scene. In my first render step, I am trying to use the alpha channel of my texture to store depth ...
0
votes
0answers
40 views

Specifying Fragment Shader Colors per Fragment (Instead of per Vertex)

I am learning about fragment shaders and have seen how by setting the colours of each vertex a triangle can be coloured via interpolation. However what if we want to use our own function to manually ...
2
votes
1answer
133 views

Texture loading- erratic working

I'm a noob to the OpenGL world and am picking up ideas through practice. I've been writing some code to build retro-arcade games recently and need to load textures to provide the graphic interface. I'...

1
2 3 4 5
11