Questions tagged [c++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
63 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
21 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 ...
0
votes
0answers
16 views

how apply edge collapsing within selected surface

I'm using CGAL edge collapsing to remove edges on mesh and it's working successfully . But I want to run the edge collapsing process within selected surface on mesh viewer . I preview the Geomview (....
2
votes
1answer
47 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
58 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
118 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? ...
0
votes
1answer
120 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
92 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
27 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
169 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 ...
0
votes
1answer
148 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 ...
-2
votes
1answer
131 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
87 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 ...
1
vote
1answer
111 views

How can I control memory for command allocators and command queues in D3D12?

The D3D12 programming guide suggests specific allocation strategies for command queues and allocators, but the creation methods for those objects operate directly on queue/allocator pointers without ...
1
vote
1answer
97 views

OpenGL Unable to retrieve the values of data sent to shader using textures

I've been following these tutorials and i can't figure out how to send data to shaders using textures. https://en.wikibooks.org/wiki/OpenGL_Programming/Scientific_OpenGL_Tutorial_02 In this tutorial ...
1
vote
1answer
209 views

Do I need separate Graphics and Transfer commands?

I was following this tutorial on Vulkan https://vulkan-tutorial.com/Vertex_buffers/Staging_buffer and I decided to do this bit: The buffer copy command requires a queue family that supports ...
1
vote
1answer
752 views

How do I create a Win32 window with a Vulkan context?

I am aware of libraries that already do this (like GLFW), but I would actually prefer do all of the window and context creation by myself.
4
votes
0answers
286 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 ...
0
votes
1answer
101 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. ...
-1
votes
2answers
121 views

Relatively new to OpenGL, need guidance/tips on an assignment with interactive user input

I'm currently taking a Computer Graphics class at university, and have been given an assignment which involves loading an obj file and manipulating it with keyboard and mouse controls (eg. arrow keys ...
2
votes
1answer
84 views

Why does DirectX use COM pointers and interfaces?

I have a rudimentary understanding of COM and I know that its main purpose is to enable interoperability between programs written in different languages. However I dont understand why that is useful ...
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 ...
1
vote
1answer
57 views

Can you avoid querying for a texture location in OpenGL?

The way I learnt to send a texture to a shader is more or less ...
2
votes
1answer
410 views

Weird artifacts in my ray tracer

I am getting weird artifacts in my simple ray tracer that I made using the book Ray Tracing in One Weekend by Peter Shirley. Example: (circular pattern on the ground and black tint on the spheres.) ...
1
vote
0answers
38 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: ...
0
votes
1answer
369 views

Opengl black screen for a simple translation

i am a beginner to opengl following an online guide, I am trying to make a simple translation to my triangle. The triangle did render correctly when i made a float uniform to translate it, but when i ...
0
votes
1answer
152 views

Distorted OpenGL graphics in certain models of Intel GPUs under Windows; possible causes?

I'm not sure this is the best place to post this, but it definitely seemed more appropriate than programming. I'm one of the developers of Performous, essentially a karaoke (and instruments) game. We ...
1
vote
1answer
220 views

Issues with Multi-threaded Raytracing

I'm having some issues with my multi-threaded ray tracing implementation. It seems to only render about half of the image. Here is the picture: Here is the code: ...
1
vote
0answers
89 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 ...
5
votes
1answer
503 views

Inverse value in a Perspective Matrix

I am a new leaner of computer graphics. I'm trying to understand a code I found online and I got stuck in the following formula: ...
1
vote
0answers
71 views

Image Processing: Photogrammetry [closed]

I am new to image processing but I am currently exploring myself in 3D reconstruction during my leisure time. I have decided to use openCV (eg. edge detection, possible?) in C++., maybe with a little ...
2
votes
1answer
225 views

Histogram of image intensities

I want to create a histogram of intensities 0.1, 0.2, .... 0.9, 1, from an image rendered using OpenGL and C++. How can I do this? Can I access the pixel intensities in the framebuffer somehow? Also, ...
2
votes
2answers
650 views

I'm trying to get a 2D screen position so I unproject a point from 3D into 2D screen coordinates by that following function:

I'm trying to get a 2D screen position so I unproject a point from 3D into 2D screen coordinates by that following function: ...
1
vote
0answers
333 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 ...
2
votes
1answer
764 views

Vulkan best way of updating pipeline viewport

I have discovered that there are two ways to update the viewport (might be more, but not sure). Currently I am rebuilding the Pipeline when I resize my screen but there is a noticeable stutter as it ...
1
vote
0answers
445 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
1answer
127 views

How do I handle uniforms in a deferred renderer?

I'm currently working on a renderer that tries to minimize the amount of state changes when drawing objects. During each frame the client submits draw instances (the client provides a render state (...
3
votes
1answer
763 views

Please, help me to understand why my raytracing camera rotates in wrong directions?

I'm trying to build a raytracer and I use this article on how to build camera system. The problem is that when, after calculating ray direction in camera space, I multiply it by camera-to-world ...
1
vote
2answers
325 views

How to use multithreading in 3D software renderer to speed up fetching texture values

The biggest bottleneck of my code is fetching texture RGB values from memory. My code looks something like this: ...
1
vote
0answers
114 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 ...
5
votes
0answers
153 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 ...
2
votes
0answers
121 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 ...
2
votes
1answer
369 views

Jos Stam's “Stable Fluids” boundary conditions

In the paper Stable Fluids by Jos Stam, I am confused about the boundaries in the set_bnd function in the code. I don't know what kind of boundaries is this. Is it Neumann boundary condition or ...
1
vote
1answer
647 views

How can I utilize all cores of CPU In my ray tracer with std::thread?

I have been working on a ray tracer and I was trying to use multiple threads to maximize the performance. I tried couple of approaches but there's no difference in performance. Here's my shot... <...
3
votes
0answers
380 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 ...
4
votes
2answers
186 views

Strange behaviour in vertex shader with divisions

This is the vertex shader code: ...
2
votes
2answers
433 views

Can somebody explain this Ray Tracing Function?

I am currently reading through Peter Shirley's Ray Tracing in One Weekend. In the beginning chapters where the author introduces diffuse surfaces we a presented with this function: ...
1
vote
1answer
726 views

Skia example code not writing an image

I am just trying to make a simple Skia program. A very simple program, but as I run this code, the output image file never writes anything. I am running this code on VS 2015 and included the skia.lib ...
4
votes
1answer
114 views

NormalMap problems: bumps work, but shade does not

I've been trying to figure this out for a few days now, but I just can't get it right. I've read multiple tutorials and possible explanations, I even watched a java tutorial without finding the ...
1
vote
1answer
213 views

How to organize Lights and Models?

I'm interested in how to organize in code (I prefer C++) lighting. Problem is: I have Scene which contains Model where model ...