Questions tagged [c++]

The tag has no usage guidance.

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

Max number of elements in a vertex attribute

I want to load a vertex buffer with vertices of struct Vertex: ...
0
votes
1answer
20 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
31 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 ...
2
votes
2answers
47 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
30 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
33 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
75 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
34 views

Hit group - export already defined

I am getting this error when creating RTPSO with multiple hit groups: ...
0
votes
0answers
31 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
35 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
63 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
93 views

Why negate z when constructing projection matrix OpenGL

I constructed an orthographic projection matrix from this article on scratchpixel.com: ...
2
votes
1answer
116 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
75 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 ...
2
votes
1answer
88 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
46 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
139 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
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)}{...
1
vote
1answer
35 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
48 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
67 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 ...
0
votes
0answers
61 views

Queue from a family queue that supports presentation doesn't work [Vulkan]

I'm following this tutorial on Vulkan and I tried to see if it actually worked with different queues for drawing and presenting the image of the triangle. My GPU supports presentation with every queue ...
0
votes
1answer
124 views

Feeding acceleration structure to the GPU then raytracing it in a compute shader?

I want to use Vulkan's rasterization to solve for the visibility problem, but once that is done I want to do shading, reflection and transmission through a raytracer which also runs on the GPU. With a ...
1
vote
0answers
57 views

How do I produce a metallic surface in ray tracing?

I can't manage to produce a metallic looking sphere despite trying many things. I have the basics working, i.e shadows, refraction etc. but I'm not sure what combination of these will allow me to ...
0
votes
0answers
32 views

Write CPP program, DFA and NFA diagram for DFA accepting string with length 5 and starting at 0 , ending at 1 input(0, 1)

I am having trouble in making this program and DFA:- Write CPP program, DFA and NFA diagram for DFA accepting string with length 5 and starting at 0 , ending at 1 input(0, 1).
1
vote
1answer
85 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
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 ...
0
votes
0answers
28 views

Loop subdivision, certain areas converging towards degenerate geometry

I coded loop subdivision and ran it on a cube with triangle faces. I noticed this: I am using doubles to represent my vertex positions, I am not 100% sure these are caused by floating point ...
1
vote
1answer
85 views

How to handle Half edge boundary edge iteration from vertex?

Ok so let's say we have a portion of a mesh that looks somewhat like this: A triangle fan with one of the triangles removed. If that triangles was not removed, we could get all the edges adjacent to ...
1
vote
0answers
48 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 ...
0
votes
0answers
34 views

void* D3D11_MAPPED_SUBRESOURCE::pData to OLE_COLOR* possible?

I have found the following from this link enter link description here pData Type: void* Pointer to the data. When ID3D11DeviceContext::Map provides the pointer, the runtime ensures that ...
0
votes
0answers
16 views

Explanation request for a GDI code block

I have a small old code snippet where I am not sure what is actually someone wanted to do. As I am not doing and trial and error guessing dvelopment. I have to be certain about the purpose could do ...
0
votes
0answers
57 views

Non linear transformation of vector graphic

I want to do a non-linear transformation of a svg in python. My specific problem is to transform a rectangular svg image into a frustum like image, for which i have a mathematical equation of the form ...
0
votes
0answers
31 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
2answers
134 views

Why is my raycaster so slow?

I'm trying to write a raycaster similar to Voxlap, but it's many times slower. I've tried octrees, but the performance gains are marginal- only 10 to 20 percent. I use the algorithm from this site: ...
1
vote
0answers
23 views

Projecting a point on a Freefrom surface

My first issue is getting a set of planes and a set of points as input, an find the projection of the those points on the nearest plane. That was pretty easy, where i just calculate the normal of the ...
1
vote
1answer
134 views

Program to make “Pieslice” without using library function?

As we know in C/C++ there is "graphics.h" header file with the help of which we can do graphics programs in C. There is a function pieslice in that header file,its syntax is: ...
2
votes
1answer
72 views

Calculate Normals of Boolean Operation for Ray Tracer

I'm working on a small ray tracing project in my free time and I'm currently implementing boolean operations for spheres. My code is setup to calculate the intersection points of each of the spheres ...
2
votes
1answer
76 views

Represent shape as particles

Input: Triangles which make up an arbitrary shape. Each triangle is represented by 3 3D points. Output: A set of particles which fills up the inside of the object (see image). I have read the ...
1
vote
0answers
26 views

Mitsuba builds targets with scons but throws “undefined symbol” error when trying to render scene

I am trying to implement a custom add-on for Mitsuba, but when I use the Heightfield I have defined in another function call(WaveBrdfAccel) in main.cpp it compiles without any problems but when I try ...
3
votes
1answer
1k views

What do the OpenGL version strings from glxinfo actually mean?

Note: I wasn't 100% certain if this question belonged here or in Ask Ubuntu. I figured since it was about OpenGL programming I'd put it here, but if I should move it to Ask Ubuntu, please let me know. ...
2
votes
1answer
69 views

Confusion about data types in Jensen's subsurface scattering paper

I am currently trying to implement Jensen's paper on subsurface scattering, but I am getting confused when I am trying to implement it in my pathtracer. I have questions about the data types of ...
2
votes
0answers
276 views

HalfEdge data structure in openmesh, create_face function explanation

Does anyone have experience with open-mesh or computational geometry and can kindly explain what exactly happens in the function below? ...
1
vote
1answer
209 views

smallpt: ray scattering and Importance Sampling

Introduction For those familiar with smallpt by Kevin Beason: In path tracing, when rays hit a surface, they are scattered and the theta angle (the angle between the normal to the surface and the ...
1
vote
1answer
109 views

smallpt: when to stop diffuse ray scattering

For those familiar with smallpt, the ray tracer in 99 lines: I am checking the code, and there is something that is not clear to me in the DIFFUSE ray scattering. After the rays are shot, they keep ...
1
vote
0answers
43 views

Help with efficient quadtree vertices indexing to avoid redundancy

I am creating a quad tree from ground zero, because I am going to collapse it from bottom up I am refining it with a certain LoD level. I am using glm for mathematics and opengl for rendering. ...
5
votes
0answers
288 views

How to account for self intersection with large ray tracing scenes?

I'm working on a hybrid real time ray tracing project and trying to tackle the problem of self-intersection with larger scenes due to loss of float accuracy. The logic I'm trying to use is based on ...
1
vote
1answer
283 views

Monte Carlo Importance Sampling

I am following the "Ray Tracing - the Rest of your Life" book by Peter Shirley and I am facing some troubles in the implementation of Monte Carlo importance sampling, and Direct light sampling. Monte ...
0
votes
1answer
549 views

This function syntax is confusing me

gladLoadGLLoader((GLADloadproc)glfwGetProcAddress) I have never seen this syntax before. Presumably glfGetProcAddres is a function, but it has the brackets behind it. Is this only possible in open gl ...
0
votes
1answer
114 views

Ray tracing the next week: understanding Instances

My question is not about the code, but it's about the approach used by the author Peter Shirley (and apparently common practice in ray tracers) of handling Instances. To understand the question it's ...