Questions tagged [opengl]

For questions involving use of the OpenGL graphics library.

Filter by
Sorted by
Tagged with
1
vote
0answers
35 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
44 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
89 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
64 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
17 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
48 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 ...
1
vote
1answer
57 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
56 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
45 views

Force int array to compact memory

I have following structure which i use as an uniform buffer object. ...
0
votes
1answer
36 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
51 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
98 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
13 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
33 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
23 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
31 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
93 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
27 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
41 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
38 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
28 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
40 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
36 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
50 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
30 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
16 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
36 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
130 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'...
2
votes
2answers
68 views

Techniques for making tesselated shapes appear smoother?

What are some common techniques for making the edges on a tesselated shape less apparent without increasing the amount of tesselation which is actually carried out? As an example, I followed along ...
0
votes
0answers
19 views

Projective Texture Mapping when Texture Comes from a Framebuffer? Incorrect Texture Coordinates?

I am trying to perform a projective texture mapping using a texture which I generate by first drawing it to a framebuffer, so that I can dynamically generate a reflection which interacts with the ...
0
votes
1answer
61 views

glBindImageTexture returning INVALID_VALUE

I am currently having an issue with OpenGL as I am trying to load some vector information into a 3D texture. Currently, I am developing in OpenGL 4.6 which should support Image bindings. this my ...
0
votes
1answer
85 views

OpenGL Compute Shader Shared Maximum

I'm working on an OpenGL compute shader in which each work item results in a single number output I'll call x, as well as a struct output with more information, I'll call y. What I would like is a ...
0
votes
1answer
44 views

Keep constant number of visible circles in 3D animation

I have created a 3D animation with a perspective projection of white circles moving randomly in a fake 3D space projected on a 2D computer screen (GIF 1). Since I need to keep the same number of ...
0
votes
1answer
59 views

Wrong reflection

Here is a youtube video showing my problem: youtube.com/watch?v=y8J7VhS2pkM I think I'm either doing the texture lookup on the reflection texture wrong, or the reflection or view matrix is somehow ...
0
votes
0answers
23 views

Want to add strafe function

I’m trying add strafe function in my program, i tried everything i can but still i was unable to get desire output! Can anyone please tell me how can i add strafe function in my program?.. is there ...
1
vote
0answers
34 views

Sampling the depth component of a packed depth-stencil texture while rendering to its stencil component

I need to frequently perform depth testing for any given fragment at a different fragment location than the one rendered to. Since this isn't possible with normal builtin OpenGL depth testing ...
0
votes
0answers
80 views

Shader sampler2D uniforms instead of attributes

In the godot game engine (using opengl) it is not possible to define custom shader attributes. A workaround is creating a sampler2D texture uniform instead and use vertexId (or in fact UV since ...
1
vote
0answers
46 views

Implementing the derivation of the Smith Shadowing function for arbitrary distributions

I'm trying to implement the derivation of the masking function G_1 by Smith. The appendix of Walter et al 1, Hammons presentation 2 and this research paper 3 talk in detail about it and I feel as I do ...
2
votes
1answer
37 views

2D array texture with different filtering setting per texture?

Currently I have textures which need GL_NEAREST and some other need GL_LINEAR in the same texture2dArray. In the shader I perform a manual GL_NEAREST lookup via textureFetch(). To avoid this my ...
0
votes
2answers
61 views

How does graphics api like OpenGL determine which triangle is back face to cull?

When I was writing a software rasterizer for my university class, we did culling in eye coordinates. Essentially, we use cross product to get a normal from the 3 vertices (in eye coordinates), then ...
2
votes
1answer
149 views

Sampling the light vs. sampling the BRDF: difference in intensity

(possible duplicate) I'm trying to implement multiple importance sampling, as described in the PBRT book (no bouncing yet, I want to make MIS work first). What my problem is, that while the BRDF ...
1
vote
1answer
54 views

Point light illuminating only half of a scene

A point light is illuminating only a half of a scene in my small 3D renderer. It happens on every scene I've tried (conference room, cornell box, etc). How do I go about debugging this? What could ...
0
votes
0answers
30 views

After making any 3D model using Opengl how to export it's data in .dae file?

I'm trying to make simple 3d modeling program in c++ with Opengl. So I don't know how to transfer/convert/export or save data of 3D model in .dae file. NOTE:- 3d model is made using Opengl ...
0
votes
0answers
50 views

Problems with Cascaded Shadow Maps

I got basic shadow mapping with a single directional light working in a small voxel game I'm working on, and I've been trying to upgrade it to Cascaded Shadow Maps. I've looked at a few tutorials - ...
1
vote
1answer
50 views

Generating the end caps of a cylinder using triangle strips for use in a geometry shader

I know how to generate the walls of a cylinder with triangle strips and the caps with triangle fans, but since I am working inside a geometry shader, I can only output triangle strips, so I am kind of ...
2
votes
1answer
167 views

Implementing the example of Walter et al. (2007) paper

As the title suggests I'm trying to implement the last images of the "Microfacet Models for Refraction through Rough Surfaces" Paper by Walter et al. in OpenGL I "think" (I had to put that into ...
2
votes
0answers
93 views

Why there are calculation differences in WebGL and OpenGL

I am currently implementing the Mandelbrot fractal on the GPU. I wrote two programs: the first in OpenGL (desktop C++ application) and the second in WebGL (static webpage). The two programs use almost ...
1
vote
0answers
46 views

Apply transformation to single vertices in OpenGL in order to deform mesh

I'm making a 2D cell simulation game. The mesh for my cell is basically just a manually-generated triangle fan that looks like this. I would like to reproduce the wobbling/vibration effect on the ...
3
votes
0answers
67 views

Projective Texture / Shadow Mapping — Why is the perspective division performed in the fragment shader?

I've just worked my way through this OpenGL shadow mapping tutorial. While I understand the basic algorithm, one thing puzzles me: During the 2nd render pass all vertices are transformed into the clip ...

1
2 3 4 5
11