Questions tagged [c++]

The tag has no usage guidance.

32 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
272 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 ...
5
votes
0answers
207 views

Computation of conservative AABB for clipped triangle

I'm currently trying to implement a fast algorithm for KD-Tree construction using SAH, as described in this paper: On building fast KD-trees for ray tracing, and on doing that in O(N log N) I found ...
4
votes
0answers
529 views

ray-triangle intersection precision - c++

I'm building a software renderer but I think there might be some problem with my ray-triangle intersection accuracy. I implemented the algorithm referring to ...
4
votes
0answers
330 views

Incorrect instanced rendering

Previously, to render a bunch of quads, I was simply using a few uniforms (one for a model matrix and another for the texture layer ID). However, I'd rather not have to loop through each quad and set ...
3
votes
0answers
447 views

Problem with specular BRDF (Monte Carlo & Path Tracing)

Above on the left is my attempt and on the right is what I'm aiming for.As you can see my sphere with the specular brdf has a weird dark ring In my radiance function I am recursing through the ...
3
votes
0answers
863 views

Represent vector with arrow

Another code review question. I am trying to draw an arrow to represent a vector. I have started with an unit arrow with vertices defined as follows: ...
2
votes
0answers
254 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? ...
2
votes
0answers
123 views

Image Laplacian incomprehension

I am reading and trying to implement a research paper. It uses openGL to define which part of an image to use in order to reconstitute a big image composited of several images. In order to do so, I ...
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)}{...
1
vote
0answers
56 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 ...
1
vote
0answers
47 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 ...
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
123 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: ...
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 ...
1
vote
0answers
42 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. ...
1
vote
0answers
44 views

Handling varying texture sizes in an array texture

Say we've idetified that we have a varying number of textures that are upper capped by 2 parametrs. thus we allocate the maximum amount of memory needed to store all textures as follows: ...
1
vote
0answers
94 views

Adding Ozone to my sky simulation

I implemented a simulation for the colour of the sky a while ago by following the scratch a pixel tutorial: https://www.scratchapixel.com/lessons/procedural-generation-virtual-worlds/simulating-sky I ...
1
vote
0answers
537 views

How to properly release directx com objects

This one I am not getting even one bit. I started learning directx11 and using the basic dx initialization i tried a experiment by allowing an option to destroy the window and creating it again ...
1
vote
0answers
576 views

360 degrees rotation around x axis

How do we rotate the camera around x axis 360 degrees, without having to flip the axis, meaning without having the strange flip after we go over +-90 degrees on <...
1
vote
0answers
116 views

Finding Segments in Continuous line

I'm trying to break a continuous line segment into multiple, straight segments. I've tried using the Hough transform but have found it unreliable for getting the line segments I'm looking for and ...
1
vote
0answers
103 views

Selecting pixels within a circle having a decimal (non integer) radius

I want to select a pixel within a circle of a certain radius. But the radius is expressed in a decimal form (0.12). What does it mean to have a radius equal to 0.12? And concretely how to pick a pixel ...
0
votes
0answers
48 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
0answers
31 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).
0
votes
1answer
66 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 ...
0
votes
0answers
29 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
49 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
1answer
142 views

qt - view geomview (.off ) file

I want to open a .off file and view the content 3d model using libQGLViewer, qt-creator. I don't know how to display the 3d model after opening its .off file. ...
0
votes
0answers
47 views

How to ensure that the raytrcing coordinate system is teh same as the projection one?

I have 2 shading models right now, one is using voxels the other one is the standard projection absed renderization method. Putting them side by side I have noticed that no matter what I do one is ...