Questions tagged [c++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
37 views

Why is there a straight line between my bezier paths?

I have created a bezier curve tool and each time I draw a bezier curve segment I get a straight line between each mouse click. I don't understand why this is happening and was wondering if someone ...
user avatar
  • 2,415
1 vote
1 answer
48 views

Defining the proper sdf for this structure

I am making a procedural sdf (just a bunch of cubes) based of an image. The idea is very simple. We have a stencil image: Each texel in the image corresponds to a 3D cube. So to ray trace what I am ...
user avatar
  • 1,447
0 votes
1 answer
50 views

3D head mesh morphing from one mesh into another using coding

I have 2 3D head images and want to morph one into the other (animation) without using blender etc. I want to do it using coding preferably using C++, C# or python(libraries are ok). I have done 2D ...
user avatar
0 votes
0 answers
23 views

Improving dual contouring convergence

I have my own implementation of dual contouring. Right now I am getting the following output: This is decent, but I am trying to get a better result (i.e. try to reduce the low level voxel noise as ...
user avatar
  • 1,447
0 votes
0 answers
31 views

How to delete a face using open mesh?

Pretty much the title I am trying to delete a few faces of a mesh using open mesh, like this: ...
user avatar
  • 1,447
0 votes
1 answer
34 views

Question about using glVertexAttribArray

After defining an attribute pointer, why can't I just reuse it? I have a VAO bound so shouldn't it just accept the AttributePointer I defined with the last VAO? ...
user avatar
0 votes
0 answers
45 views

ray triangle mesh intersection triangles inverted

I'm trying to render a dodecahedron triangle mesh and the triangles seem flipped or mirrored somehow. The first picture is what I should be getting, the second picture is what I'm getting and the last ...
user avatar
  • 1
0 votes
0 answers
39 views

16 bit SNORM format not correctly storing Z component?

I generate a normal GBuffer in my engine, and I store it using a R16G16B16A16_SNORM format like this: ...
user avatar
  • 125
0 votes
0 answers
22 views

obj to grd sdf generators?

I am trying to generate sdfs from objs but when I try to use the only tool I find online it segfaults on even the simplest inputs, such as the blender cube. Does anyone know of a tool to generate grid ...
user avatar
  • 1,447
-1 votes
1 answer
55 views

Passing non-interleaved data to glBufferStorage without using glBufferSubData

I would like to use glBufferStorage to load data once into the vertex buffer. However sometimes I want to pass non-interleaved data from separate arrays like shown ...
user avatar
1 vote
1 answer
86 views

Stripping unnecessary data from C++ data structures before sending to GPU

I've recently been working on a particle system in my renderer and I've encountered a situation where my particle class on the C++ side has data I need to maintain my particle on that end, but that I ...
user avatar
  • 45
1 vote
1 answer
222 views

What is the Viewport?

Can someone please explain to me what the Viewport is. I've read the OpenGL wiki and doc.gl but they give me a definition that I don't understand at all. The definition they gave me is "...
user avatar
  • 11
0 votes
1 answer
83 views

Understanding how gradient noise generation works

When attempting to compute the gradient noise derivatives I've seen the use of a function named "hash" and I don't understand its purpose (nor why they have commented that it should be ...
user avatar
0 votes
0 answers
59 views

Missing from cmake QT project

I'm attempting to create a basic QT cmake (either in VS or QTCreator) project but I'm getting a rather larger linker error. I imagine I'm missing something in the cmake as I'm getting a lot of ...
user avatar
  • 243
0 votes
0 answers
46 views

D3D11 How to re-use queries?

I'm trying to use queries in D3D11 to profile my program. Here is how I do it: ...
user avatar
  • 125
3 votes
1 answer
117 views

Problem when performing IFFT for Tessendorf's ocean waves

I am implementing Jerry Tessendorf's ocean waves as described in his paper in c++ and OpenGL. I implemented two compute shaders, one for the h_tilde_0 and its conjugate, and one for the frequency ...
user avatar
1 vote
2 answers
131 views

Reducing Cascaded Shadow Mapping Artifacts

I've been trying to get my cascaded shadow maps looking right for a while. I managed to fix the shimmering and most of the quantization artifacts, but for some reason the shadows still look really ...
user avatar
0 votes
1 answer
266 views

Can I write histogram equalization, blurring, sharpening grayscale image etc.. as shader programs with openGL?

...
user avatar
1 vote
1 answer
93 views

How to use trackball for rotating an camera matrix in eye frame

I have a QOpenGLWidget where I use camera transformation matrix(4,4), FOV and vectors Position(4), Up(4), Forward(4). I also have an ArcBall which I can use. I managed to implement zoom and pan by ...
user avatar
  • 111
2 votes
1 answer
132 views

Environment map importance sampling (beginner)

beginner here. I am implementing importance sampling for environment maps in Scotty3D, a CMU CS project (but I am not a student). The task can be found here I have a problem with the sample's pdf, it ...
user avatar
  • 21
1 vote
1 answer
233 views

Half-Edge Data Structure with holes

I am trying to implement next/prev of edges in half-edge data structure. But I ran into this question. If there are two holes with a common vertex, will the closed loop of the edges run as in the ...
user avatar
0 votes
1 answer
137 views

My OpenGL program is not drawing filled polygons

I'm trying to learn OpenGL in c++ (I used it in Java) but I have a problem, I make a triangle, but it doesn't draw on GL_FILL and in GL_LINE it just draw a line, I can't find my mistake, I guess my ...
user avatar
0 votes
0 answers
137 views

Weird PIX behavior with DXC

Recently I've switched from FXC to DXC to compile shader model 6.0. It compiles well without errors (and runs well) but I can't debug shaders because on my netbook PIX says "failed to load PDB ...
user avatar
  • 1
1 vote
1 answer
1k views

Understanding fragment shader coordinate system

I'm trying to create an infinitely panable grid using fragment shaders (C++/OpenGL/GLSL), and I'm having a bit of difficulty understanding the coordinate system. This is my fragment shader code, ...
user avatar
0 votes
0 answers
43 views

Under what conditions does a mesh operation cause the mesh become non-manifold and how to avoid it?

I'm implementing some mesh operations (e.g. edge collapse, edge split, edge flip etc) and need to ensure applying such operations does not cause the mesh to become non-manifold. However, I'm not sure ...
user avatar
  • 241
0 votes
1 answer
54 views

Buggy behavior when applying specular reflection

I'm very new to computer graphics and trying to implement a raytracer based on the book Computer Graphics from Scratch. When I tried to add specular reflection, I don't get the output that look like ...
user avatar
0 votes
1 answer
57 views

(Ray tracing) Trouble converting to screen coordinates, objects being stretched

I followed along with Ray Tracing in One Weekend and managed to get the final output but I wanted to understand more about creating a camera and "painting" the screen since he didn't go over ...
user avatar
0 votes
0 answers
180 views

Using multiple textures in a shader

Background: I am extracting the textures for a model with Assimp and sampling those textures in the fragment shader. I have multiple uniform sampler2D textureN ...
user avatar
0 votes
1 answer
102 views

How to link Intel Open Image Denoise in Qt Creator and use it to denoise noisy Monte Carlo path tracing renderings?

I've been trying to link my the Intel Open Image Denoise libraries for about a week and still have no luck as of now. This could partly be because I am also novice in C++ stuff. So I need some help in ...
user avatar
  • 241
0 votes
1 answer
135 views

Spline interpolation library in cpp

Have been searching a lot for a good spline interpolation library in cpp, came across one, which is the famous Eigen library , having the unsupported counterpart for spline fitting.<Here>. I ...
user avatar
0 votes
1 answer
364 views

Vulkan clear color is wrong

I am following https://vulkan-tutorial.com/Introduction to get myself familiar with the Vulkan API. I have gotten to the point where my application is able to draw a triangle. But for some reason the ...
user avatar
  • 101
0 votes
1 answer
171 views

Efficiently transferring only needed parts of the vertex data to the GPU (C++/OpenGL)

I have a situation, where I have an array of vertices on the CPU side, for which, besides rendering-relevant data, like their position, I have a lot of other data at each vertex. All vertex data is ...
user avatar
0 votes
1 answer
125 views

Render fragments with uvs outside (0,1) range as transparent

I'm rendering an image onto a mesh. And I need to render fragments with uv coordinates that fall outside (0,1) range with full transparency. In the code below I'm specifying a border color with zero ...
user avatar
2 votes
0 answers
70 views

Atmospheric scattering band/seperation artifact

I am currently experimenting with some atmospheric scattering in glsl in my OpenGL engine. I am experiencing a strange phenomena where a strange band / separation artifact appears along the middle of ...
user avatar
0 votes
0 answers
80 views

How to deallocate memory for vertex buffer objects

I have a class that handles loading buffers for a mesh: ...
user avatar
0 votes
1 answer
2k views

Drawing a square using glDrawArrays with GL_TRIANGLES

I used a version of the following code to draw a triangle using glDrawArrays with GL_TRIANGLES, per Anton Gerdelan's very nice tutorial here: Hello Triangle ! It draws a nice triangle. I have modified ...
user avatar
  • 177
0 votes
0 answers
68 views

Different OpenGL behaviour on Windows and Ubuntu

While porting this project with slightly modified code to Linux I ran into some weird behaviour. On Windows it runs just fine (https://youtu.be/xH6Dc6xOuow). But on Ubuntu it shows some weird ...
user avatar
1 vote
1 answer
35 views

Why are these 2 buffers joint while extracting glTF information?

I am using tinyGLTF to parse gltf files and then render them in my program. I am currently during the third example in this page. In particular I am trying to extract the 2 animation buffers: My code:...
user avatar
  • 1,447
2 votes
1 answer
241 views

Max number of elements in a vertex attribute

I want to load a vertex buffer with vertices of struct Vertex: ...
user avatar
0 votes
1 answer
37 views

In place sorting of a half edge DS?

Cross posting from SO because I didn;t know where to put this question. I have an implementation of the half edge and I am trying to sort the edges such that edge n+1 is the pair of edge n. Setup I ...
user avatar
  • 1,447
1 vote
1 answer
110 views

draw on cubemap with help of geometry shader each triangle covers each cubemap face (why??)

I want to do some complicated stuff but have problems with my geometry shader / FBO bindings. To hold it as easy as possible I reduced the code to a minimum. If this works, I could continue the hard ...
user avatar
  • 519
3 votes
2 answers
595 views

Using array of textures in DX12

I managed to create code, working correctly as Texture2DArray in hlsl by using single ID3D12Resource and binding it as D3D12_SRV_DIMENSION_TEXTURE2DARRAY with constant array size. ...
user avatar
3 votes
0 answers
99 views

Global root signature crash

I have a problem with RTPSO creation. Using local root signatures for each of rgs (ray generation shader), chs (closest hit), miss is working correctly. However, for performance sake, I want to use ...
user avatar
2 votes
0 answers
43 views

multiple Quaternion slerp inverse to calculate relative coordinates

I am creating a 3D spherical curved display (only a part of a sphere). The camera usually is inside of this sphere. This display has texture coordinates. The image below shows the display with its ...
user avatar
  • 519
1 vote
1 answer
114 views

Raytracer help - Background color writing over some colors?

I'm implementing Peter Shirley's "Raytracer in a Weekend: The next week" and I'm having some trouble with rendering a scene with a light. I'm not sure if the issue is the background color or ...
user avatar
0 votes
1 answer
90 views

Hit group - export already defined

I am getting this error when creating RTPSO with multiple hit groups: ...
user avatar
0 votes
1 answer
69 views

Paint pixels on the image around the cursor for painting application

I'm trying to create a simple painting application. And I was wondering about an efficient way to draw pixels on the screen. I have a pixel struct: ...
user avatar
0 votes
2 answers
628 views

Get normalized device coordinate of an image pixel

I have an image rendered to the screen, and based on the normalized device coordinates of the cursor I would like to pick the pixel of the image under the cursor. Say the image has four channels, I ...
user avatar
1 vote
2 answers
146 views

Why negate z when constructing projection matrix OpenGL

I constructed an orthographic projection matrix from this article on scratchpixel.com: ...
user avatar
2 votes
1 answer
213 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 ...
user avatar
  • 23