Questions tagged [c++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
26 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: ...
0
votes
0answers
16 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 ...
-1
votes
1answer
21 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 ...
1
vote
1answer
77 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 ...
1
vote
1answer
84 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 "...
0
votes
1answer
61 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 ...
0
votes
0answers
24 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 ...
0
votes
0answers
16 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: ...
2
votes
1answer
63 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 ...
1
vote
2answers
68 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 ...
1
vote
1answer
57 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 ...
2
votes
1answer
95 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 ...
0
votes
0answers
24 views

Data from staging Texture2D incorrect (DirectX 11)

I'm trying to implement 3D picking in my engine. To do this I am rendering objects with different colours and getting the pixel at certain mouse position and extracting the colour value from a special ...
0
votes
1answer
141 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 ...
0
votes
1answer
58 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 ...
0
votes
0answers
73 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 ...
1
vote
1answer
616 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, ...
0
votes
0answers
24 views

How to read .gltx files using jansson JSON C library?

I am currently writing a program to parse the .gltf file using the jansson C library for reading JSON files. I want to show how that library is effective in reading .gltf files so that apps can use ...
0
votes
0answers
41 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 ...
0
votes
1answer
50 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 ...
0
votes
1answer
55 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 ...
0
votes
0answers
145 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 ...
0
votes
0answers
43 views

Path tracing: how to ensure the new direction vector is a valid direction vector with respect to a BSDF?

Given the BSDF function and the Normal vector of the intersection point in world space, how can I generate a new direction vector ...
0
votes
1answer
60 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 ...
0
votes
1answer
76 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 ...
0
votes
1answer
166 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 ...
0
votes
0answers
16 views

how to convert halfedge datastructure to work with GTS

I want to import an object with extension ".obj" as halfedge data structure. and simplify it using GTS (GNU Triangulated Surface Library. ) How to convert halfedge data structure to ...
0
votes
0answers
17 views

how to use half-edge data structure with gts gnu

There is any way to use GTS(GNU Triangulated Surface Library) with Half-edge or Combinatorial maps data structures ? I want to use GTS simplification with the above mentioned data structures I ...
0
votes
1answer
95 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 ...
0
votes
1answer
100 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 ...
2
votes
0answers
57 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 ...
0
votes
0answers
50 views

How to deallocate memory for vertex buffer objects

I have a class that handles loading buffers for a mesh: ...
0
votes
1answer
747 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 ...
0
votes
0answers
42 views

What do you do when the root skeleton is not defined in a gltf file?

Cross posting from stack overflow: Reading the source code of tinygltf I see this: ...
0
votes
0answers
58 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 ...
1
vote
1answer
30 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:...
2
votes
1answer
162 views

Max number of elements in a vertex attribute

I want to load a vertex buffer with vertices of struct Vertex: ...
0
votes
1answer
35 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 ...
1
vote
1answer
54 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 ...
3
votes
2answers
350 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. ...
2
votes
0answers
66 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 ...
2
votes
0answers
37 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 ...
1
vote
1answer
104 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 ...
0
votes
1answer
79 views

Hit group - export already defined

I am getting this error when creating RTPSO with multiple hit groups: ...
0
votes
1answer
48 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: ...
0
votes
2answers
407 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 ...
1
vote
2answers
118 views

Why negate z when constructing projection matrix OpenGL

I constructed an orthographic projection matrix from this article on scratchpixel.com: ...
2
votes
1answer
171 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 ...
1
vote
1answer
94 views

How do you loop through the contents of a buffer in DX11?

Okay, so I'm currently using the IAGetVertexBuffers() method and I'd like to loop through some of the returned buffers to verify the contents. However, I'm kind of new to DirectX and C++ in general. I ...