All Questions
265
questions
3
votes
1
answer
1k
views
Rotation matrix for a 3D object in space
This is the follow-up question from here: Minimum requirements to uniquely represent a 3D object in space
Assume I have 3 original points in a 3D object (in 3D space) as ...
3
votes
1
answer
1k
views
Shader storage buffer indexing by 4 bytes instead of 3?
I am trying to send rendering information for an instancing rendering using shader buffer objects. My current problem is that I have 2 shader buffer objects, one which works just fine, and another ...
3
votes
1
answer
685
views
How to deal with light leaks?
I'm struggling with light leaking through meshes (especially thin ones) due to interpolation between probes located on the opposite sides of those.
First approach I took was mapping all static ...
2
votes
1
answer
216
views
$P^2$ vs projection plane
I want to explain what I understood of definition of the two things.
Projection plane:
The general processing steps for modeling and converting a world coordinate description of a scene to
device ...
2
votes
2
answers
929
views
Continuity of parametric and geometric continuity
We know that in parametric continuity, $C^1$ continuity is two successive curve section $C_1$ and $C_2$ has first parametric derivative is same. That means tangent vector $t_1$ is same for both $C_1$ ...
2
votes
1
answer
1k
views
Bresenham circle drawing algorithm, compute the distance?
In the Bresenham circle drawing algorithm, we have to choose between the top and bottom pixel, but what we always do is using the circle's equation ($f(x, y) = x^2 + y^2 = r^2$) to determine which of ...
2
votes
4
answers
254
views
Question about function for color
I would like a help to understand the following line of code:
return float3(pow(color.r, 2.2), pow(color.g, 2.2), pow(color.b, 2.2));
I've seen some places calling ...
2
votes
1
answer
201
views
How to draw smoother lines and triangles?
I am currently creating my own 3D renderer. Here is a coloured cube created by the renderer.
I modelled cube using a set of coloured triangles. Notice extraneous lines from edges and they does not ...
2
votes
1
answer
265
views
If you can use subdivision surfaces for 2D curves
I've seen how subdivision surfaces are good for 3D curves/modeling, but haven't seen anything on if it's good, or even usable, in 2D.
My question is just that, if (a) you can even use subdivision ...
2
votes
1
answer
2k
views
Probability density function while using spherical coordinates
I'm following this tutorial where at somepoint the derived PDF for spherical coordinates for a Lambertian surface is
\begin{array}{l}
p(\theta, \phi) = \dfrac{\sin \theta}{2 \pi}.
\end{array}
But as ...
2
votes
1
answer
421
views
LoopBlinn Cubic Curve Rendering - Serpentine arteffect
I am trying to implement the Loop-Blinn cubic curve in java using the following source codes GPU-Curve-Rendering and WebCore. Both of them are showing few arteffects and i cannot figure out why. Here ...
2
votes
0
answers
908
views
preserving z-values during projection?
Consider this figure for projection.
There are two equations that give value for the xp and yp coordinates:
$x_p=x.\frac{(z_{vp}-z_{prp})}{h}+ x_{prp}.\frac{(z-z_{vp})}{h}$ and
$y_p=y.\frac{(z_{vp}...
2
votes
1
answer
485
views
How do you calculate cos(theta) for diffuse in flat shading?
Consider a triangular face of three vertices $A=(0,2,1)$, $B=(3,0,1)$ and the origin $O$, with normal vectors $(0,0,1)$, $(1,1,0)$, and $(-1,-1,1)$, respectively. The incident light is white and ...
2
votes
2
answers
7k
views
Screen space coordinates to Eye space conversion
I'm trying to figure out how to reverse Eye space -> projection -> clip(divide by w) -> screen space conversion.
Basically, I want to get Screen space (still have z value for z-buffer) -> undivide? ...
2
votes
0
answers
1k
views
Line segment intersection test and find the point of intersection
Thanks for the suggestions. Now I am doing it as follows:
First off it is identified if two line segments intersect or not. And I am using the algorithm described in the book - "Introduction to ...
2
votes
2
answers
136
views
Why is the approximation valid, in the formula provided by Brian Karis?
I'm sorry I'm bringing this topic up again, but I need to expound some of the topics.
With reference to this question, I was wondering if someone can help me out in expanding some of the details.
In ...
2
votes
1
answer
745
views
Naive Path tracer produces much darker images than Explicit light sampling
So I just thought of comparing the results from a Naive Path tracer and one using Next Event Estimation aka Explicit Direct Light Sampling. However the results from the Naive PT are very dark.
Is ...
2
votes
1
answer
5k
views
Multiple VAO share a VBO
Let's say I have a have 10 different terrains. Each terrain have the same x and z coordinates, but they have different y coordinate, normals and colors. The indices used for element rendering is also ...
2
votes
1
answer
5k
views
CUDA/OpenCL vs OpenGL compute shader for Path tracer
So I want to implement a path tracer and I am confused between GPGPU computing or using OpenGL's compute shaders. I've already implemented a raytracer using GL's compute shaders.
What are the main ...
1
vote
1
answer
2k
views
Can't understand the Importance sampling GGX
I've read many articles relating to importance sampling of GGX. However, I still feel confused.
The formula of GGX is :
And many article says we should use this formula to sample:
In the formula, ...
1
vote
1
answer
114
views
Why do 3d modeling packages use a single normal per polygon and how is this viable for smooth shading
If we have a quad that is non-planar. Why do most 3d modeling packages choose to use a single normal for the quad (Specifically for Blender3d by using cross product of two edge's vectors that do not ...
1
vote
1
answer
85
views
What does filter mean in glint rendering and texture mapping?
I bumped into the flowing when reading paper. Can anyone help to explain what does filter means in glint rendering and texture mapping? Thanks a lot!
1
vote
1
answer
2k
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
1
answer
84
views
Why shearing coefficients multiplying by y? [closed]
We know that shear is transformation that distorts the shape of the object. Shear relative to X-axis that is $y=0$ line can be written as:
$x'=x+sh_x.y, y'=y$
My question is why $sh_x$ is multiplying ...
1
vote
1
answer
71
views
How to avoid declaring sampler outside of statement?
How can I avoid having to declare the sampler outside of the if statement in this shader code sample?
...
1
vote
1
answer
317
views
How to use maximum resolution (pixel density) with OpenGL in MS Windows
CodeBlocks offers an example program in C, that uses OpenGL. It draws a single multicoloured rotating triangle. I have been building on this example. I am a novice in C and in OpenGL. I believe that I ...
1
vote
1
answer
710
views
How to instanced and indirect render geometry [OpenGL]
I've a lots of objects, which have the same geometry. Right now I am using instanced rendering to render these objects. This is working very well. But I am trying to increase the performance of the ...
1
vote
1
answer
159
views
Importance sampling in a path tracer
So, I'm attempting to implement a monte carlo path tracer that uses the ggx brdf model. However, I'm rather confused about how to sample the light direction.
I know that theta and phi can be sampled ...
1
vote
1
answer
301
views
Importance sampling of the blinn-phong brdf in pathtracing
tl;dr:
How do you importance sample the blinn-phong-brdf?
Recipe for importance sampling of the phong brdf as far as i understood it (pseudo-code):
...
1
vote
1
answer
65
views
enumerate vertices from tessellation evaluation stage (Triangle patch)
Is there any way to enumerate the generated vertices of a tessellation patch (triangles only) inside the tessellation evaluation shader? The tessellation levels will only be integer values with ...
1
vote
1
answer
121
views
Conditionally sample from texture in shader
I'm building a little 2D graphics library in Rust/WGPU as a means to learn graphics programming. I want to draw an outline around a shape and specify the outline's color. All of my shapes have a ...
1
vote
1
answer
106
views
Model Separation - Several models reside in a single .stl file
I have an .STL file (ascii and binary format) that contains several different CAD models. How can I read the file and create separate .stl files for each of the single different models. Even some ...
1
vote
1
answer
334
views
Path tracing - cannot converge diffuse sampling + oversaturation
I'm in process of creating progressive path tracer using DX12 + DXR. I managed to create working raytracing code + pathtracing code with multiple bounces but I'm experiencing problems stated below (...
1
vote
1
answer
389
views
Final transformation matrix to transform world coordinate into vrc [duplicate]
For a 3D scene in the world coordinates, its View Reference Point $\mathrm{VRP}$ is at $(5,2,1)$, and a viewer is looking towards point $A=(1,1,1)$. Construct a transform matrix which will map world ...
1
vote
2
answers
2k
views
Calculate normals from vertices
Assume you have a list of vertices and their connectivity information. (I.e you can find all the adjacent edges and faces to each vertex).
What is a good approach to calculate a normal from this ...
1
vote
1
answer
626
views
Monte Carlo Importance Sampling
I am following the "Ray Tracing - the Rest of your Life" book by Peter Shirley and I am facing some troubles in the implementation of Monte Carlo importance sampling, and Direct light sampling.
Monte ...
1
vote
1
answer
74
views
Given a background image B and a composie image of A OVER B, can we somehow recover image A?
I often find myself in the situation where I have some old image where I composed a translucent overlay on top of a background, but then lost (or more likely discarded) the overlay. I still have pre-...
1
vote
1
answer
523
views
Path tracer isn't converging
So I just completed a naive path tracer that uses explicit direct light sampling.
Problem is the path tracer isn't converging. It's like a raytracer, showing a single image on each pass. More info on ...
1
vote
1
answer
3k
views
How do you load multiple textures into an array texture with OpenGL?
I have been reading the OpenGL documentation but it is not clear to me how to achieve the following.
Say we have an array of strings. Each string in the array is a valid relative path to an image ...
1
vote
1
answer
88
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
...
1
vote
1
answer
734
views
How are textures projected onto 3d models in texture painting applications
In most modeling software you can texture paint onto 3d models using so called stencil textures. They basically project a texture from the viewport view onto the model as seen for instance in the ...
1
vote
1
answer
73
views
Finding geodesics on a mesh?
What are some state of the art methods/algorithms to find geodesics on arbitrary manifold meshes?
1
vote
1
answer
876
views
Calculating the gradient of a tetrahedral mesh
How can I compute the gradient for a tetrahedral mesh (3D)? For triangular mesh, I got an answer from the following post Calculating the gradient of a triangular mesh
How can I get a similar formula ...
1
vote
1
answer
253
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?
1
vote
0
answers
173
views
An example of Combining Stratified Sampling and Importance Sampling in AGI
Being confused about the example of Combining Stratified Sampling and Importance Sampling in Advanced Global Illumination (P72,P73).
I know how to do importance sampling and stratified sampling. But ...
0
votes
1
answer
75
views
Lines not disappearing after being drawn in OpenGL
I am creating a Bezier curve tool in OpenGL and every time my program draws something in motion with cursor coordinates I see the previously drawn lines on the screen for a second or two before they ...
0
votes
2
answers
319
views
How RGB images are formed
I have a noob level question about RGB images-
Pixels in RGB images are in the range of (0-255), so technically each channel ranges from 0(black) to 1(white), then why we say that each image has a Red,...
0
votes
1
answer
359
views
Raytracing in OpenGL or Vulkan?
I was looking at this glass ball rendering with an image inside of it (zoom out to see the glass ball), and noticed that it looks like they simulate the refraction of light as it crosses from inside ...
0
votes
1
answer
3k
views
finding the projection matrix for one point perspective
I found the derivation for two point and three point perspective here on this site, even though it says review on one point perspective, it doesn't give a link to previous pages, but I'd like to ...
0
votes
1
answer
258
views
Convert one triangle to another in matrix4x4?
The context openGL instances learning.
I want to transform a reference triangle to another one. So final goal is to have one triangle and the instance being a transformation of that initial triangle.
...