Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The tag has no usage guidance.

0
votes
0answers
31 views

Dragging an object on a plane with respect to the camera

this is a long description but I hope the solution is simple: I have a 3D pointCloud with a vtk box (displayed at 0,0,0) and I want to drag the box on the XY plane with my mouse cursor (Zero movement ...
1
vote
1answer
56 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
42 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
47 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
90 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
33 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
0answers
66 views

How to solve the equation x = Mx + b using markov chains?

I am unable to find the mistake in my code. I've used the following input: M = [0.5,0.0, 0.0,0.25] b = [1.0,1.0] The answer for x should be ...
0
votes
1answer
61 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
136 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
106 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
73 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 ...
4
votes
1answer
196 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
57 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
123 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
248 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
108 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
1answer
300 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
224 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
117 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 (...
2
votes
1answer
301 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
199 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
91 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
97 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
84 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 ...
3
votes
1answer
272 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
376 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... <...
4
votes
0answers
234 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 ...
5
votes
2answers
137 views

Strange behaviour in vertex shader with divisions

This is the vertex shader code: ...
1
vote
2answers
217 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
379 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
101 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
133 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 ...
1
vote
1answer
132 views

My (ADS) shader doesn't render the light direction correctly

This is what I'm doing: vertex shader: ...
1
vote
1answer
215 views

Am I passing the correct matrices for my shader? openGL/C++

On page 89 of David Wolff - OpenGL 4.0 Shading Language Cookbook book, it suggests a way to set up up a Phong shader in the fragment stage. It lists some different matrices to pass via uniform, and I ...
1
vote
1answer
124 views

Swap buffers twice does not show the first scene

If you clear the color buffer and draw a triangle, you have nothing in the buffer that is shown in the screen and a triangle in the other buffer, so you have to swap buffers for showing the triangle. ...
8
votes
2answers
352 views

How to handle a parametric equation in raytracing?

After taking a look at the Mobius strip, I noticed its equation is really simple and tried to add it into my Raytracer. I tried a "naive" way by simply generating N...
6
votes
1answer
737 views

How can I generate mipmaps manually?

This question has an answer here: https://stackoverflow.com/questions/42596516/generating-mipmaps-manually It was a silly mistake. Sorry for the inconvenience. OpenGL is fairly difficult to learn. ...
6
votes
1answer
200 views

Artifacts when gamma correcting

Doing post-process gamma correction is showing texture artifacts, here is a small example on a skybox: The first image is gamma correcting on the skybox shader and seems correct, the lower is doing ...
1
vote
2answers
542 views

Can you batch vertex data and still sort by depth?

In order to reduce the amount of draw calls per frame I've decided to use a vertex array object to store vertex data from several different meshes. More precisely, I use the vao to the define the ...
1
vote
1answer
92 views

Does programs like After effects and Unity engine use graphics library to render custom guis?

I was always interested how programs like: Unity, AE, godot engine and other render their custom guis. So my question is, do they use graphics library to render custom guis or something else. If they ...
1
vote
1answer
318 views

How can I send custom bitmap to frame buffer?

I was trying to make a CPU-based ray tracer but I know after all the calculation I will end up with an array of pixels. I don't know how to paint it on the screen. What are the various ways to do that?...
1
vote
1answer
235 views

Point respect to plane

How do I classify a point with respect to a plane, returning whether the point is inside, outside, or coplanar? I know that if a point is on the plane the Dot product + the plane distance would equal ...
2
votes
2answers
1k views

Can one VAO store multiple calls to glVertexAttribPointer?

If no, Should I create a new VAO for every VBO that has its own vertex attribute configurations? Could you please give me a snippet code example that shows how to use one VAO for multiple VBOs? All ...
7
votes
1answer
438 views

What is a good approach for handling uniforms in modern OpenGL?

I'm creating a renderer using modern OpenGL (3.1 and up) and now I'm trying to create an efficient but flexible way of handling uniforms. I've been reading up on uniform buffer objects and on what a '...
3
votes
2answers
355 views

How to watch image being ray traced?

In my ray tracer, I render my images out to a .PPM file and then view it in photoshop. To make things easier and faster I want my ray tracer to open up another window and show the image being rendered ...
4
votes
1answer
577 views

How to get the GLFW_CONTEXT_VERSION_MAJOR value?

This code snippet: ...
7
votes
1answer
724 views

What does “makeContextCurrent” do exactly?

I am pretty confused about that function. GLFW Context reference says as follow: This function makes the OpenGL or OpenGL ES context of the specified window current on the calling thread. A ...
4
votes
3answers
187 views

Is there a difference between window and screen in computer graphics?

I've been reading some code which setups a ray tracer and I've realized I've a doubt regarding what's a screen and what's a window in this context. Here's the relevant code using Qt: ...
5
votes
1answer
1k views

Modern way of light sources in OpenGL?

In older versions of OpenGL there were things like: glLight(...) gl_LightSourceParameters The modern way of doing lighting is passing light source parameters manually to the shader in vao-s? Or ...
6
votes
1answer
173 views

How to rasterize a line when the background color is not always white?

I've to rasterize a line taking into account not only the background color of the screen, which is white, but also the color of other objects in the scene. In my case, I've just another object, a ...