Questions tagged [c++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
51 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
46 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
51 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 ...
1
vote
1answer
65 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
19 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
94 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
52 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
48 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
386 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
18 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
40 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
49 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
52 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
106 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
41 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
52 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
65 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
111 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
15 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
65 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
92 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
44 views

How to deallocate memory for vertex buffer objects

I have a class that handles loading buffers for a mesh: ...
0
votes
1answer
413 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
36 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
56 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
26 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
137 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
52 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
235 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
58 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
98 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
64 views

Hit group - export already defined

I am getting this error when creating RTPSO with multiple hit groups: ...
0
votes
0answers
186 views

How to use RWStructuredBuffer

Edit: I managed to get code compiling, but it doesn't work, so I changed question a little bit. Below code is working fine as read buffer, but I cannot make it to work as read-write buffer (...
0
votes
1answer
43 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
305 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
115 views

Why negate z when constructing projection matrix OpenGL

I constructed an orthographic projection matrix from this article on scratchpixel.com: ...
2
votes
1answer
151 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
90 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 ...
3
votes
1answer
735 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
0answers
47 views

What modern C++ Unit Testing Framework do you use for highly parallel image, 3D and higher dimensional matrix processing workloads? [closed]

Most of the existing open-source libraries such as OpenCV, Tensorflow, and Pytorch use Google Test. I would like to know about strong alternative testing frameworks that thrive under a similar ...
3
votes
1answer
290 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) ...
1
vote
0answers
67 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)}{...
1
vote
1answer
40 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
vote
1answer
164 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 ...
2
votes
1answer
70 views

Off by one error when creating face indices

I seem to have an off by one error when creating the indices for the faces of a sphere and I can't understand where. The exact problem is that when I try to calculate the normals of each face a dark ...