All Questions

2,503 questions
Filter by
Sorted by
Tagged with
21 views

Why is glUniform1i() returning GL_INVALID_VALUE?

I have a sampler variable in a shader: uniform sampler2DArray tiles; Which I am trying to bind to a texture unit in GL: ...
14 views

Concerning the Procedural noise's function, how would you define a squared magnitude in plain word?

By googling, I have found some definition of squared magnitude about mathematical plane applied in the gaming field, but I am dubting this is what we would mean in the noise generation's field. ...
116 views

Double buffering always necessary?

Question from the graphics newbie: What I know by now is that "usually" double buffering is used: You calculate the content of frame x+1 while frame x is shown on the screen, if you want to achieve ...
31 views

Why does my code generate a figure whose kurtosis looks a little higher than the one I am trying to reproduce?

this figure (fig_1) is an univariate normal distribution in 3D, the corresponding equation is in the top left hand corner it seems that x varies from -5 to 5; sigma varies from 0 to 4. This Python ...
28 views

Why does my code to plot a cone actually generate a roof?

per this post, this formula $Z = 1 - \sqrt{X^{2} + Y^{2}}$ generates a cone where the point is at (0, 0, 1) and it spreads out below that. It meets the x-y plane at the unit circle I am trying to ...
20 views

How combine multiple projections into a single pass?

We have a projector type display used in an automotive application, where a projector displays an application on the windshield. Because the projector would normally warp a flat image, we have to ...
54 views

Strange artifacts while rendering a dielectric material

I am trying to render a dielectric sphere inside the Cornell Box. Some circles are generated on the sphere. Here is the photo generated by path tracer: And below is my main function: ...
56 views

Could some give an explanation or hint about this kind of equation? $\left(- \sqrt{X^{2} + Y^{2}} + 1\right) \cos{\left (2 \pi X + \phi \right )}$

This is a screen shot from an animation generated by a matplotlib example the key part in the code is ...
35 views

What library or tool was used to plot these graphs?

I've been wanting to plot graphs that look like these (Taken from this blog post), but I can't figure out what tool, language, or library was used to pull this off.
63 views

Difference betwen Rendering Equation, Lighting model, Ray Tracing, Global Illumination and Shadows?

What is the difference between all these techniques? I know what a lightning model does, eg Phong, Flat, Gouraud. As far as I know both Ray Tracing and Global Illumination are just lighting models ...
44 views

Why do we call it TRS and MVP, instead of SRT and MVP or TRS and PVM?

Here's something that's been bothering me while learning graphics. We have two core concatenated matrix sets: "TRS" for transforms, and "MVP" for moving everything into the canonical view volume. TRS ...
43 views

Creating a Smooth 3D Mesh from a 2D Outline

I am trying to find (or maybe create) an algorithm for creating a smooth, rounded 3D mesh given a 2D outline. I'm trying to recreate a system from a Gamecube game called Amazing Island, and you can ...
24 views

How can I reproduce the MatchMoving/MotionTracking technique from Just Dance?

I'm a software engineer student with a big projet idea but low graphic knowledge. My goal is to compare two people dancing. One person would be the teacher with perfect moves and the other would be a ...
47 views

Shader code for putting an atmosphere over a planet

I'm working on a game set in space with procedurally generated planets, and I'm trying to write a shader that puts an atmosphere over a planet given the color of the atmosphere and the strength of the ...
30 views

GLFW | What is a frame?

Here I was reading about buffers and found such text: When the entire frame has been rendered, the buffers need to be swapped with one another, so the back buffer becomes the front buffer and vice ...
33 views

Douglas-Peuker and equal distances

I have a polyline and I want to simplify it with Douglas-Peucker. It's an easy algorithm, but what if there are points with the same distance. What point should I select? Is there a reasonable ...
19 views

Fuse 3D-Points in Bundle Adjustment? [closed]

(Crossposting from here: https://softwareengineering.stackexchange.com/questions/399331/fuse-3d-points-in-bundel-adjustment) I'm actually implementing my own Pose-Estimation/- and -Refinement ...
31 views

3d Math Primer book equation derivation - Projecting One vector onto another

I'm reading the book 3d Math Primer for Graphics and Game Development 1st edition by Fletcher Dunn and Ian Parberry. On page 61 there's this: How does it derive $v_{||}$ there? It doesn't follow ...
14 views

How to handle object drawables?

Currently the graphics API I am using is Vulkan, but I am trying to find a general enough way to represent the following. In graphics, drawing can be generalized as: Get vertex buffers and send them ...
32 views

Oren-Nayar Reflectance

I'm trying to implement Oren-Nayar reflectance and I don't quite understand the Wikipedia article on it. In the article, it has this diagram: I can't figure out what $(\theta_i, \phi_i)$ and \$(\...
30 views

How to render multiple shaders per mesh

I've tried looking everywhere, but I just don't get it. How is multiple shaders assigned to a mesh if you can only bind a single shader in OpenGL? Assume I have a mesh with a texture shader and now I ...
37 views

Bloom Effect Blending, Depth Buffer Resolution Mismatch Problem

In most cases, Bloom's intensity-filtered image is rendered for objects affected by it to a low-res FBO and blended with the image at last. If the bloom is not applied to some objects, Depth Buffer ...
16 views

Problems on rendering CT Scan image using volumetric raycasting

I am trying to render an image of the head CT Scan by volumetric raycasting. I have the below image as a reference taken from this webpage. However my images aren't as good quality as the reference ...
13 views

Determining the Bounding Box values of a glTF file

Is there a way when looking at the source of a glTF file that you can determine what the boundingBox values of the object are?
35 views

What's the difference between Clipping and Culling?

In a tutorial about OpenGL both words are mentioned, unfortunately without a good explanation. To find out, I have read this article three times, but I fear I'm a too common man... my understanding is ...
39 views

In the rendering pipeline, in what coordinate space are vertices when they arrive at the primitive assembly stage?

Full disclaimer, this was a test question, but I couldn't find any information online. In my opinion, this depends on if the primitive assembly stage happens before or after perspective division. If ...
47 views

Implementing GGX VNDF importance sampling with DXR

I am currently implementing the GGX specular BRDF in a DXR raytracer using the importance sampling method describe by Heitz I am sampling the VNDF with: ...
29 views

About view matrix and frustum culling

I was trying to determine if an object (sphere) is inside a view frustum. My strategy was first to get the view matrix: ...
41 views

Non least squares formulation to fit catmull rom spline

I have a set of unordered points that I'm getting from an image attached. I'd like to simply fit a parametrized curve such as a catmull-rom curve to with n control points (n = 4 to 10, and can be ...
62 views

What's the justification of multiplying colors together?

In Phong shading model (and other shading models as well), the light color is multiplied together with the surface color component-wise. I want to know the justification for this. Is this some what ...
45 views

Calculate the distance between two 3d points in screen coordinates

Given the Point A with the coordinates gl_FragCoord.xy, I have to find the distance to the Center of the cube face to which it belongs in screen coordinates. ...
47 views

How to handle quads?

I currently can not solve a ray-quad intersection with a quad that bends, because it is impossible to solve (because really a quad can't/shouldn't bend). Sadly, often times, models with ...
49 views

What is the algorithm used for phong shading normal interpolation?

Let's suppose we have an object consisting of only 3d points, and triangle faces that each take a subset of these 3d points. How can I interpolate the normal vectors to get that Phong smooth shading? ...
24 views

How to create static alpha masks of an image

I have an image of following type- I want to create mask of the following type where the inside area is white and rest of it is black. How to do it?
76 views

Artificially increase the region of interest of an image

I am solving an image segmentation problem. To increase the accuracy of the model, I came across the following preprocessing step- First, the set of pixels of the exterior border of the ROI is de- ...
20 views

Difference between a spherical camera and a trackball camera

A spherical camera is pretty easy to define. We have an anchor point C the camera always looks at and a relative position P where the camera is, which can be expressed in spherical coordinates, ...
28 views

What image formats support indexed color palettes with more than 256 colors?

I've been reading up on images with indexed color, and while most indexed image formats are limited to 256 colors, there are apparently image formats that support larger palettes. According to ...
20 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 ...
36 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: ...
42 views

Zero-copy texture reading from CPU memory

The Intel 740 AGP graphics card read textures directly from system RAM, using VRAM exclusively for depth buffers and the framebuffer. This has the effect of saving video RAM, and it could be ...
48 views

Why does my julia ray tracer return stack overflow error?

I' trying to write a monte carlo ray tracer in julia, but my main function returns stack overflow error. Below is my main function: ...
40 views

Normal Map Storage (Not Unit Length)

Looking at various assets (models / textures / scenes) available online, I have noticed a trend that conflicts with my assumptions. Many of the normal maps contain texels whose vector length deviates ...
42 views

Debugging tools for OpenGL on macOS

I am porting some code from Metal to OpenGL since we want to run our app on Windows too. Xcode is my preferred IDE, but the newer versions of Xcode do not support any OpenGL debugging. Question: What ...
23 views

What exactly is the orthographic projection used by Matlab

I would like to imitate the orthographic projection that Matlab uses by default: Matlab View Projections and Matlab camproj It seems similar to the "Trimetric" projection described here: ...
22 views

Confusion about glVertexAttribPointer and non-active attributes

When binding an attribute index using glVertexAttribPointer, what happens when a later bound program does not contain an attribute at said index? Is the behaviour undefined, or is the attribute ...
21 views

Report standard deviation in Rendering results

I noticed that a common metrics for image quality assessment (Monte Carlo path tracing) is MSE between the generated image and a reference one. My question is: why isn't the standard deviation ever ...
36 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 ...
40 views

Is there way for polygon decomposition by thickness?

Here is an example dots representing coordinates of pixels added more representative example added real example added main problem