# All Questions

3,020 questions
Filter by
Sorted by
Tagged with
17 views

### Ray tracing where illumination itself affects the geometry

I am interested in a scientific application in which ray tracing is necessary, but also where the light itself alters the geometry of the surface mesh (imagine perhaps that the beams of light have ...
13 views

### Calculate the position and rotation of a quad in 3d space given a 2d projection of that quad from a camera

I am trying to build a VR tracking system with a laptop webcam, and I have succeeded in identifying, and tracking paper markers I put in front of my webcam. For context I am using OpenCV with the ...
22 views

### Is glDispatchCompute(a,b,c) any faster than glDispatchCompute(a*b*c,1,1)?

In my application, there is no inherent 2D or 3D structure to the computer shader instances. So having multiple dimensions doesn't benefit me semantically in any way. I am wondering, whether it still ...
56 views

### Lambertian shading illuminates all the front of a sphere

I've sucessfully implemented a ray tracer from scratch in C and it's marvelous: The surface normal on this sphere is taken by computing the intersection point, A, and treating this as a euclidean ...
17 views

### Identifying 2d coordinates of texture from 3d textured sphere

this is best explained by visualization. Below webpage is a spherical textured panorama which gives the effect of being inside of the room. I want to be able to localize (eg) windows by mouse clicks ...
58 views

### Why is the image from the CUDA version not as sharp as the CPU version?

I am extending Roger Allen's Ray Tracing in One Weekend in CUDA (and also here) by following Peter Shirley's Ray Tracing: The Next Week; specifically Image Texture Mapping. The image I obtain from ...
34 views

### How to deallocate memory for vertex buffer objects

I have a class that handles loading buffers for a mesh: ...
41 views

I'm trying to apply the algorithm in that paper as follows enter image description here So I wrote a pixel shader that does it, but still confused about some parts like the term It-j(x,y), how would ...
69 views
+50

### IBL looks too dark with uniform sampling

I'm making a program that illuminates a sphere using an environment map. For each fragment in the sphere, I compute a many random directions in the hemisphere along the surface normal (no importance ...
52 views

### Is there an existing method to draw a heart of stars that looks more like a heart?

I wrote a C program which prints a heartbeat (heart star) animation. The key is to print a heart of stars, which looks like this consists of line of stars and blanks. ...
33 views

### Matrix transforming with translation/rotation/scale at center of screen

I'm trying to create a camera using matrix transforms, the gist as follows: ...
16 views

### What sort of implementation dependent limits for glPointSize can one expect from modern graphics cards?

As noted here, when rendering using the GL_POINTS primitive, there is an implementation dependent limit to the point size range. I intend to use GL_POINTS for fast billboard rendering of particles, so ...
73 views

### Too soft shadows from multiple suns

I want to render the transient shadows due to the sunlight over a day in one image. So I placed all the suns, as directional light, in the scene. However the shadows in the rendered image(a raytraced ...
42 views

### Operations in the Rendering Pipeline

I have a few short question regarding operations happening in the rendering pipeline (OpenGL, Vulkan, I'd expect for all questions to have similar answers for these two frameworks while DirectX might ...
33 views

### Can surface normal be used for obtaining points on a plane?

Excuse my wording. I will use the picture below to explain what I mean. I want to use the surface normals for each arrow shown like below to draw lines parallel to each plane like the image shown ...
30 views

### Drawing a square using glDrawArrays with GL_TRIANGLES

I used a version of the following code to draw a triangle using glDrawArrays with GL_TRIANGLES, per Anton Gerdelan's very nice tutorial here: Hello Triangle ! It draws a nice triangle. I have modified ...
41 views

### BVH uses aabb for a sphere in Ray Tracing: The Next Week

While studying Peter Shirley's Ray Tracing:The Next Week, I came across an issue that I cannot quite figure out: Stepping through the random_scene() case of the ...
61 views

I have a rgba16f texture that I fill with values using nvidia GL_NV_shader_atomic_fp16_vector extension, which allows to perform ...
19 views

### How to update large step probability when exchanging states in Metropolis Sampler?

I want to implement good path guiding for photons for my Vertex Merging integrator. After reading through this 2 papers: Hachisuka T., Jensen H. W.: https://www.ci.i.u-tokyo.ac.jp/~hachisuka/...
17 views

### Packing a GL_RGB from three separate buffers?

I'm decoding an .mp4 to use as a texture on a tristrip. It's easy enough to use an unsigned byte array of RGB triplets to create this texture, but frames come out ...
24 views

### Problem sampling uniformly envmap with GGX

I have made a program that samples uniformly an environment map and computes the lighting using the GGX BRDF. I have made a small example that reproduces the issue I'm having. You can check it out ...
32 views

### How to draw surface normals from surface normal maps?

Using deep learning to estimate surface normals from monocular RGB images is a common task. The resulting image generally looks like this: My question is how can I use this map to actually draw a ...
28 views

### How to visualize density data as volume using OpenGL?

I have a CT scan of a portion of a human body, with each point describing density. The data file provides X, Y, Z, and density values. I want to know how to visualize this data, using OpenGL or a ...
28 views

### How to split vertices during UV Mapping?

I'm currently implementing UV Mapping with Box Gizmo. It is the same function as the image below. (Box Projection UV Mapping in 3ds Max) As above, I have implemented texture mapping to the model. (...
59 views

### Debugging refraction in a sphere

I have been working on recreating some of the scenes from Peter Shirley's raytracing books using compute shaders and the new Metal raytracing API. It is going well but I am having some trouble with ...
23 views

### What do you do when the root skeleton is not defined in a gltf file?

Cross posting from stack overflow: Reading the source code of tinygltf I see this: ...
50 views

### Is there different between 'if' and 'ternary operator' in GLSL?

I'm practicing GLSL on ShaderToy ...
29 views

### How to render a rotated raster image with lesser aliasing

I am wondering about techniques for rendering a rotated and or scaled raster image. Currently I use the following algorithm Render everything at double resolution and store the result in ...
76 views

### Rendering a particle system as a smooth blob

What is a good algorithm for rendering a particle system as a coherent mesh, in realtime? I am running a smoothed-particle hydrodynamics fluid simulation, and I would like to render the particles not ...
47 views

### Can ambient light reflection of a surface be larger than diffuse reflection?

According to Phong's reflection model, there are different reflection constants (k) and different intensities of the light source (i) for ambient, diffuse, and specular terms: \$I_p=k_ai_a+\sum_{m \in ...
51 views

### Different OpenGL behaviour on Windows and Ubuntu

While porting this project with slightly modified code to Linux I ran into some weird behaviour. On Windows it runs just fine (https://youtu.be/xH6Dc6xOuow). But on Ubuntu it shows some weird ...
107 views

### How do we know if a ray intersected a triangle in one in a million

I've taken a class about ray-plane intersection on this: https://www.khanacademy.org/computing/pixar/rendering/rendering-2/v/rendering-5 Suppose we shoot a ray at the scene and this scene contains ...
128 views

### Energy redistribution sample re-integration

I'm implementing ERPT-style energy redistribution of primary samples within a pathtracer. Specifically, to improve the sampling of defocused areas. The core algorithm does two things: If sample ...
40 views

### Layer rendering in Vulkan

I am writing a Vulkan video manipulation engine which has the following layers: Foreground (2D) Scene (3D) Background (2D) Note that each layer may have multiple objects, some of which may be ...
43 views

### projecting 3d onto 2d plane is not showing up correctly

I am trying to learn about 3d graphics from first principles, so i have decided to implement a simple thing, create a circle in 3d space & rotate it along some axis. I understand the basics theory....
19 views

### THREEjs: updating an object's matrix doesnt change it's position and rotation params

I want to set a transformation matrix to an object upon creation and then control it by position, rotation and scale, but while changing the matrix does change the object in world space, it's position ...
32 views

### coverage vs transparency

2D application users seem to be using transparency as a proxy for coverage more often than not. However they are not the same, although nearly everybody makes the assumption that they are. Given that ...
48 views

### How to retrieve RGBA mask used to transform image1 into image2

Let image1 be: And RGBA mask be: (45, 78, 251, 102) Apply mask on top of ...
57 views

### Comparing two triangle meshes

How to quantitatively compare two meshes? For example, comparing the same object mesh before and after processing it. Is there any library or code readily available for this?
32 views

### Using instanced arrays for dynamic objects

With the help of instanced arrays we can specify an array of transforms and render a number of objects with a single render call. I'm wondering if using instanced arrays make sense in situations where ...
48 views

### Algorithm for thinning a thick line

I'm trying to reduce a thick line, in raster space, down to a thin line, preferably one pixel wide (or thick). Does anybody know of an algorithm that can do this? Imagine you draw with a marker on a ...
21 views

### Wrapping a point cloud skeleton with a mesh

Using Unity I've been producing sculptural forms that look like this. It's made of patterns of cubes that twist around each other. I'm trying to get it into a 3D printable format. From unity I export ...
64 views

### Rendering a volume that might be completely clipped in OpenGL

Suppose that I have some world-space volume (which we may assume is a convex polyhedron with a small number of vertices), and I want to render its intersection with the view frustum, such that every ...
37 views

### OpenGL pipeline stages, when is the primitive assembly executed?

The question is simple, I have this diagram from the Khronos page: And this diagram from the Learn OpenGL page In the first picture the Primitive assembly is executed for example after the Geometry ...
40 views

### Why is there a T factor in the definition of Shah given in Matt Pharr's Physically Based Rendering?

The specific chapter about this is here - Sampling Theory Unlike what I read anywhere else, it defines Shah as: $$Ш_T(x)=T\sum\nolimits_i{\delta{(x-Ti)}}$$ And the T is still present in the ...
17 views

### How to “preserve texture” when transforming vertices

Maya has a feature called preserve texture. It allows you to transform vertices of an object and basically have the texture "stay in place" in object space. Say I have a plane with unwrapped ...
22 views

### Determining input color space primaries from spectrum data

If I have an output device, for which I have a known spectrum data for each of it's primaries, I should be able to calculate the CIEXYZ of its primaries using using the integral equations together ...
20 views

### Why are these 2 buffers joint while extracting glTF information?

I am using tinyGLTF to parse gltf files and then render them in my program. I am currently during the third example in this page. In particular I am trying to extract the 2 animation buffers: My code:...