# All Questions

2,429 questions
Filter by
Sorted by
Tagged with
5k views

### Multiple viewports with modern OpenGL?

I use SDL2. Currently my only shader has a MVP matrix, and transforms the points with it. I calculate my View and Projection matrix for a camera with GLM: ...
29 views

### Do I need a normal matrix if I calculate lighting in an objects space?

As a quick reminder, here is what normal matrix is and why do we need it. Now the question - if I take the light position and transform it into an object space than I don't need the normal matrix at ...
50 views

### Diffuse lighting calculations in ray-tracer

I am trying to write a ray-tracer. The lighting part is proving to work but not accurately. To debug I simplified the scene to a single sphere centered at the origin with a radius of 1 and a point ...
25 views

### Difference between Passing Instance Data to Vertex Shader methods

I see two kinds of passing Instance Data to Vertex Shader in different Examples. 1 .Using a Uniform Buffer and filling in an array, like below ...
6 views

### How can I detect if an edge has flipped during the UV unfold process?

I'm writing my own UV Unfold operation (similar to Maya's Optimize UV tool or 3DS Max's Relax Tool). My code works great 90% of the time but in some instances, I'm getting faces and edges that flip ...
24 views

### Inverse texture mapping

I have a textured 3D object and looking for ways to transform back the texture. Effectively, I think this is an inverse texture mapping task. Do you know of anything close to this? Some papers or ...
44 views

### Weird glColor3f results in framebuffer objects

The code is glColor3f(1, 1, 1); gluSphere(gluq, 0.2, 10, 10); glColor3f(1, 0, 0); glTranslatef(1, 0, 0); gluSphere(gluq, 0.2, 10, 10); In short, when I draw ...
30 views

### Understanding the irradiance map generation

I am trying to understand how the generation of irradiance maps works. I was reading LearnOpengGL tutorial and Codinglabs article. Reading those articles, I got a bit confused about how we use ...
43 views

### How to approximate the heightmap of processed wood?

In the above image, you can see that there is some slight variation of the height of each wood plank. These variations do NOT come from the wood texture itself, but from the way it was cut, i.e if a ...
39 views

### Are there any reasons to use power of two textures with modern mobile platforms?

Are there any reasons to use power of two textures (like 128x128 sized) if one targets modern mobile platforms (with OpenGL ES 3.0, Metal and/or Vulkan)? With iOS the PVRTC only supports power of two ...
153 views

### Volume Rendering - Dataset not rendered correctly

So Im trying to implement a Volume Renderer mainly for medical images like CT-scans and MRI images using GPU raymarching. I'm using the book "Real Time Volume Graphics" and this tutorial as a refernce....
36 views

### What are affine covariant regions

I am trying to understand this seminal paper. I read this post on what affine transformations and my understanding is that affine transformations are transformations that preserve parallelism of lines ...
25 views

### How to display image from CUDA / What API to port my project to for real-time raytracing?

I started a raytracing project using the python numba library which provides a just-in-time compiler for CUDA kernels. When the scene is rendered my result is a 1920 x 1080 x 3 RGB array in GPU memory....
95 views

### An algorithms for covering a 2d polygon with a predetermined number of rectangles?

I am looking for an algorithm that is able to cover with non-overlapping rectangles in a pre-defined number and minimum area a generic 2d-polygon. Polygons are usually free-hand draws, so they can be ...
95 views

### How to obtain a parametric equation out of a part designed in Autodesk Inventor?

Whenever you make a part in inventor, the software calculates de properties of the whole body given a constant density. Then, automatically, it shows the inertial tensor. As you can recall from math, ...
65 views

### Compute shader only 5 times faster on the GPU than on the CPU

I'm running following compute shader in Vulkan. worldImage is device local memory that holds the world. resultImage is reference to the memory of the swapchain image: ...
55 views

### Convert triangulated object to a polygonized object

Is there an efficient algorithm to convert a 3D object described with a set of triangles to a 3D object described with a set of polygons. Polygons can have an arbitrary number of points, more is ...
43 views

### Pitfalls of animating with quaternions

When working with animating a rig, quaternions are often used for rotations. However sometimes we need to clear rotation along given local axis of a joint. With quaternions it's not as simple as just ...
717 views

### Is back-face culling considered a technique/optimization of ray tracing?

I've stumbled upon this question on a CG exam: Which of the following techniques/optimizations doesn't apply to ray tracing? A: Back-face culling B: "Shadow-feeler" rays C: Recursive ...
478 views

### Computing a lookAt matrix by passing a vec3 to a camera object

I am following this tutorial on how to implement a first person camera. So far I was able to implement the entire (C++) class in TypeScript and it works as it is supposed to. Problem What I was not ...
234 views

### BSDF sampling versus light sampling

I wish to understand the specific application of Multiple Importance Sampling (MIS) to weighting BSDF sampling and light sampling together. Refer to the following diagram from these Stanford course ...
14 views

### Image contribution function and reconstruction using filters

So I've been reading Physicall Based Rendering which in section 16.4.3 defines the "image contribution function" to be the following $$I_j = \int_\Omega h_j(X)L(X)d\Omega$$ where the variables are ...
41 views

### Help with understanding the look-at function (the view matrix)

I've been reading this article about the look-at function. I don't understand the part when they're trying to inverse the matrix N. They say that R is orthogonal because all its row and column ...
38 views

### Only each third image in swapchain is being used, causing flickering

I've managed to write a "small" Vulkan program that outputs a solid color using compute shader directly to swapchain. However, it doesn't work properly. ImageMemoryBarriers I've setup don't ...
131 views

### What to reproject when doing temporal filtering in stochastic screen space reflection?

I am in the middle of implementing stochastic screen space reflection based on frostbite presentation here. On page number 39, it is stated that we need to reproject the ray intersection location ...
217 views

### How to match Blenders polynomial lens distortion model with GLSL?

I'm trying to re-implement Blenders (libmv) polynomial lens distortion model using shadertoy, in order to apply the lens distortion in another application ideally by generating a STMap for that. I ...
19 views

### How do I automate projecting a 2D vector image onto a 3d curved surface plane? [closed]

I am creating a workflow consisting one or more tools to wrap or project 2D vector images onto a 3D surface plane. The process is as follows: Convert image in a vector format (any format compatible ...
30 views

### Use glTranslatef and shaders?

In newer OpenGL it's encouraged to use shaders and pass the model-view-projection as parameters. But what if I drew a complex object, and wanted to translate/rotate it and draw many copies? For ...
58 views

### light probe (for global illumination) placement techniques?

I'm learning light probes used for dynamic global illumination. I have a question regarding the placement of light probes, as based on most of the pictures I have seen, they seem to be placed ...
236 views

### Clipping circle and polygon and generate a CAD drawing

I'm developing a CAD drawing generator using C# and netdxf library (https://github.com/haplokuon/netDxf) The app first performs boolean operations (specifically - union & subtraction) on polygons ...
11 views

### Area of a mesh patch given the corners

I have a mesh $\mathcal{M}$ and 4 vertices $v_1, v_2, v_3, v_4$, I know the connectivity but not the geometric path. $\mathcal{M}$ is a single connected component (with no holes). What's the quickest/...
46 views

### Strange sphere reflection effects in ray tracing project. I cannot figure out what causes them

I started a ray tracing project in Python. I made a CUDA kernel and a trace() function for each pixel. It works perfectly when calculating intersections, shadows and lambert shading, however when I ...
785 views

### Path Tracing & Materials

I'm wondering about the technique used when sampling a layered material for the next event in a path tracer. I have a material with three layers: a base diffuse, specular and sheen lobes. How does one ...
29 views

### How To Upgrade My Intel Graphics Driver? [closed]

I have Ubuntu 18.04. When I run glxinfo | grep OpenGL, I get this: I have OpenGL 3.0 but I want this to be upgraded to OpenGL 3.1+. I tried to do what was advised in https://askubuntu.com/questions/...
58 views

### Lighting ramps compressed to zonal harmonics

Let's say I have a lighting lobe represented as a ndotl ramp texture, how do I compress it into a zonal harmonic?
44 views

### Screen space reflections become warped when looking up or down

I have been experiencing issues over the past few days with implementing SSR on water into my engine. Looking straight forward, it appears to be alright. However, when I look up or down, the ...
25 views

### Access frames of livestream

A friend of mine offers a live-stream via TCP. I can view the live-stream in a browser by fetching it via web-socket. What I want to achieve is to segregate the video into frames. Furthermore, the ...
58 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 ...
11k views

### What is the simplest way to compute principal curvature for a mesh triangle?

I have a mesh and in the region around each triangle, I want to compute an estimate of the principal curvature directions. I have never done this sort of thing before and Wikipedia does not help a lot....
22 views

### Boundary Smoothing Algorithms

I have a 2-manifold with boundary, built with marching cubes. Are there any well-known algorithms for smoothing its boundary edges? Most of the papers I found are concerned with smoothing the surface....
412 views

### Feeding vertex data to a compute shader

I'm writing a CAD program in vulkan. In my current design, I have line paths represented as large vertex buffers for rendering. I would like to implement an algorithm for extruding the path outwards, ...
38 views

### Out of core rendering

Suppose there is a frame, which is larger that the device memory (I mean, dozens of Gb). And I would like to render to it from a set of textures, which is larger than the host memory (I mean, dozens ...
19 views

### Volume of Intersection of Cube and Sphere

Is there any way to compute the volume when a sphere intersects a AABB(cube), with different centers. Also i want to be able given a percentage of sphere's volume to to place the sphere's center in a ...
44 views

### Camera position in vertex shader

in the vertex shader I have the vertex position vpos which is in object space and I want to get the vector going from the camera to ...
40 views

### Vertex positions from particle position

I have a question about Nvidia Flex or any particle based simulation in general: The particles are created by sampling the mesh, which can result in fewer particles than there are vertices in the ...
570 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 ...
57 views

### Is it possible to do color conversion on decoded video without getting it from GPUmemory to CPU memory?

Decoding video will result in different pixel formats on different GPUs and drivers. I have an application which can render (using OpenGL), only the RGB8 pixel format, therefore I need to do color ...
71 views

### How can i create a 3D Sphere(earth) using OpenGL, GLFW, GLAD, GLM?

Please help me out with this thing and currently i am a little more than a beginner so please tell me in that context. i don't need any obsolete methods for creating this like using GLUT or GLEW.can ...