All Questions

Filter by
Sorted by
Tagged with
9
votes
4answers
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: ...
0
votes
0answers
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 ...
2
votes
2answers
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 ...
0
votes
0answers
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 ...
0
votes
0answers
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 ...
0
votes
0answers
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 ...
1
vote
1answer
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 ...
1
vote
1answer
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 ...
4
votes
1answer
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 ...
4
votes
0answers
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 ...
1
vote
0answers
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....
3
votes
1answer
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 ...
0
votes
0answers
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....
0
votes
2answers
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 ...
2
votes
1answer
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, ...
1
vote
0answers
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: ...
1
vote
2answers
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 ...
2
votes
0answers
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 ...
1
vote
1answer
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 ...
4
votes
1answer
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 ...
3
votes
1answer
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 ...
1
vote
0answers
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 ...
1
vote
0answers
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 ...
0
votes
1answer
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 ...
2
votes
0answers
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 ...
2
votes
1answer
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 ...
0
votes
0answers
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 ...
2
votes
1answer
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 ...
1
vote
1answer
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 ...
3
votes
2answers
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 ...
0
votes
0answers
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/...
1
vote
1answer
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 ...
8
votes
2answers
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 ...
0
votes
0answers
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/...
1
vote
0answers
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?
2
votes
0answers
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 ...
0
votes
1answer
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 ...
2
votes
1answer
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 ...
17
votes
2answers
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....
1
vote
0answers
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....
2
votes
1answer
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, ...
2
votes
0answers
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 ...
1
vote
0answers
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 ...
1
vote
1answer
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 ...
2
votes
0answers
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 ...
1
vote
1answer
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 ...
1
vote
1answer
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 ...
0
votes
1answer
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 ...
0
votes
1answer
47 views

Pseudo rounded cube in OpenGL

If I have a cube in OpenGL, how can I have it appear like rounded? I think it's too complicated to really have the cube rounded so is there any "light trick" to have something like this: The cubes ...
1
vote
2answers
91 views

Multiple swapchains in Vulkan app with ImGui

I am integrating imgui into my app using glfw + vulkan example. The function vkCreateSwapchainKHR() is also called by imgui setup logic in addition to my app on the same device and it fails with "...

15 30 50 per page