Questions tagged [mathematics]

The knowledge of the numbers, formulas, shapes and quantities. In the computer graphics, almost exclusively linear algebra is being used.

Filter by
Sorted by
Tagged with
3 votes
2 answers
239 views

Degree for Computer Graphics : Computer Science or Mathematics?

I want to learn graphics on a lower level but I have no clue where to start. I know that I will need some hard mathematics (linear algebra, vectors, matrices, transformations...) rooted inside my head....
Vie Infernal's user avatar
2 votes
1 answer
108 views

How can I determine ideal NURBS surface control points for a multi-patch sphere?

I would like to know how to "parameterize" the control points for the 6 faces of the commonly used NURBS mutli-patch sphere ("Cobb sphere"), for an arbitrary-size control point ...
Chaosoahc's user avatar
0 votes
1 answer
48 views

What are the exact math steps to convert sRGB (D65) to Lab (D50) colorspace?

I've been struggling to implement the correct steps (matrices, white-points, etc) to convert some sRGB (RGB) values (already in 0-1 range) to Lab/CIELAB color space. I've tried following guides on ...
Pedro Ribeiro's user avatar
0 votes
0 answers
36 views

GLSL reflect function math correct?

In the documentation of GLSL - reflect given a surface normal $N$ and an incident vector $I$ the calculation being performed is reported as $$ \text{reflect}(I,N) = I - 2\text{dot}(I,N)N $$ I wonder ...
user8469759's user avatar
0 votes
0 answers
41 views

Pixilate/Quantize UV coordinates in world space?

The effect I'm trying to achieve is to have it so that the texture is pixilated/quantized, but the "grid," stays aligned to world coordinates even as the object with it's own UV coordinates ...
zachThePerson's user avatar
2 votes
1 answer
50 views

value range in CIEXYZ space

When converting from sRGB to CIEXYZ I seem to be off by a factor of 100 I'm trying to convert from sRGB to CIELAB. Calculation First I need to go from sRGB to CIEXYZ. Using this formula I get i.e. ...
md7's user avatar
  • 23
0 votes
1 answer
65 views

Extrapolating geometry across a triangle mesh?

Say you have 2 parametric cylinders represented as triangle meshes with very different geometries and you connect them together. Is there a method that allows you to join them together such that the ...
Makogan's user avatar
  • 1,696
1 vote
0 answers
59 views

Piecewise smoothing of a mesh?

Kobbelt et al. published a paper some 20 years ago where they specified how solving Poisson equations on the positions of a mesh lead to removing noise. This can be used for reconstructing mesh ...
Makogan's user avatar
  • 1,696
0 votes
0 answers
20 views

How is re projection usually implemented in remeshing?

I was reading "Polygon Mesh Processing" and in chapter 5 the authors present this little algorithm: ...
Makogan's user avatar
  • 1,696
1 vote
1 answer
69 views

Confusion regarding incident direction in render equation

I am studying from pbrt-v3 and the rendering equation has just been introduced as $$ \underbrace{L_\mathrm{o}(\mathrm{p},\omega_\mathrm{o})}_\text{Outgoing radiance }=\underbrace{L_\mathrm{e}(\mathrm{...
Scene's user avatar
  • 111
0 votes
1 answer
83 views

Faring a region of a mesh connecting two curves

In the book Polygon Mesh Processing, there is a section dedicated to fairing. In particular page 59 has this lovely figure: I am specially interested in the rightmost image. According to the text ...
Makogan's user avatar
  • 1,696
0 votes
1 answer
57 views

Does CMYK values provide more colors than RGB?

We know that in the RGB system we have three primary colors and each of them has a value from $0$ to $255$ (or $256$ values in total). So all possible colors are $256^{3}=16777216$. But in the CMYK ...
Snack Exchange's user avatar
1 vote
1 answer
53 views

Need help understanding this simplification/optimization for a very basic GLSL shader

i'm currently following a tutorial on youtube to get started with computer graphics (shaders) and it contains the following GLSL code: ...
Seth's user avatar
  • 13
0 votes
1 answer
32 views

How to measure distortion of a parametrization?

If you have a map from a mesh into the 2D plane. How do you measure its distortion? I know that theoretically what you do is express the differential map of the transformation then use SVD to figure ...
Makogan's user avatar
  • 1,696
1 vote
1 answer
35 views

Sampling scattering direction around directions other than the last ray direction

In a path tracer, if we want to sample a ray direction in scattering medium, we can use phase function sampling, which actually use the direction of the ray before sampling as a sort of anchor to ...
Enigmatisms's user avatar
0 votes
2 answers
42 views

Finding vertices of a polytope?

Assume that in 3D we have a polytope defined by the intersection of halfspaces. A half space is the set of all solutions of a linear inequality $P = N \cdot x + c \leq 0$ Where $N$ is the normal to ...
Makogan's user avatar
  • 1,696
1 vote
1 answer
58 views

Confusion about the bias during Monte Carlo integration

I recently stumbled into this question: Say, for example, we are doing mean-free-path sampling (distance sampling) in a scattering medium and to keep it simple, let's only consider the single ...
Enigmatisms's user avatar
1 vote
0 answers
49 views

Measure for volumetric rendering equation

Recently I've been digging deeper into the volumetric rendering (volumetric path tracing, to be specific). I already know that for surface rendering, there are two commonly used measures (reference ...
Enigmatisms's user avatar
2 votes
0 answers
44 views

How to properly use scattering coefficient during volumetric path tracing?

The increased radiance during sampling is known by: $$ L_s = L_e + \sigma_s \int p(w, w')f_p(w, w')dw' $$ The latter part, which accounts for in-scattering radiance bears a $\sigma_s$ in it. The ...
Enigmatisms's user avatar
0 votes
0 answers
115 views

One-sample model Multiple Importance Sampling with balance heuristic

Recently I feel a bit confused about one-sample model MIS. One sample model MIS can be found here in Veach 1997. 9.2.4 The one-sample model, and this one-sample model is widely used in the opensource ...
Enigmatisms's user avatar
0 votes
2 answers
134 views

Where does sin(theta) go in estimators of The Rendering Equation?

Consider this equation, where we have a surface integral over hemisphere with Lambertian BRDF and cos(theta) from The Rendering Equation: $$ \int_{0}^{2\pi}\int_{0}^{\frac{\pi}{2}}\frac{albedo}{\pi}...
Ocelot's user avatar
  • 125
0 votes
1 answer
97 views

With a light source at (0,2,0) and unit cube (from [-1,1]) using a given shading formula, how is the r,g,b for each surface calculated?

The above problem is from a past Computer Graphics exam. I am particularly confused about the explanation given, firstly for the top and bottom planes (since the direction of normal for top plane ...
LC796's user avatar
  • 3
0 votes
0 answers
67 views

Interpolate Gradients to Vertices of triangular mesh

A well known way of interpolating the gradient field of a scalar field onto faces of a triangular mesh uses the following formula (source: https://www.cs.cmu.edu/~kmcrane/Projects/HeatMethod/...
Ian_L's user avatar
  • 101
0 votes
1 answer
122 views

Parametric equation for Catenary curve between two Points

I have two points in 3D space, A and B. I need to have a parametric equation of the catenary curve such that: Cat(0) = A, Cat(1) = B, Cat(t)= f(t, A, B) How can I derive the function f
Argha Chakraborty's user avatar
0 votes
2 answers
195 views

Whats the best way to render (2D) parametric curves with uniform stroke width?

I want to create a rendering engine that mostly renders parametric curves on a 2d screen. As far as it seems, todays graphics are all dependent on vertices and matrices, so not sure where to start or ...
user avatar
1 vote
1 answer
117 views

How to compute discrete partial derivatives in 3D

I'm supposed to compute partial derivatives for 3D volume rendering (in ray tracing). I'm bad at math and so I can't understand what $f$ is in my case. In reviewing examples, I'm seeing the $f$ ...
Mote Zart's user avatar
  • 111
0 votes
1 answer
135 views

Splitting Floats To Texture Channels

I know, this is a silly question, but since I need this so often, I just want to double check that I made no mistake. Working with most shader languages, a texture can store $8$ bits per channels, ...
fweth's user avatar
  • 127
4 votes
2 answers
606 views

Can you explain to me the Bresenham's line algorithm in simple terms?

I've been trying to wrap my head around this algorithm, and I need it for my drawing function. But I can't seem to understand it. The Wikipedia page gives this piece of code right at the end: ...
sneaker's user avatar
  • 41
2 votes
1 answer
40 views

Approximate compass bearing of a normal

Let's say I have a 3D model that represents a small real-world space; it could be bounded by a 10" by 10" by 10" box. I know the real-world compass bearing for an observer in the center ...
gavinmh's user avatar
  • 121
2 votes
1 answer
155 views

Can you encode a reflection in a quaternion?

Say we have the transformation: \begin{bmatrix} 1 & 0 & 0\\ 0 & 0 & 1\\ 0 & 1 & 0\\ \end{bmatrix} i.e. the matrix that encodes swapping the z and y axes. This is equivalent to ...
Makogan's user avatar
  • 1,696
0 votes
1 answer
138 views

Point a normal vector towards a point in 3D-Space

Given a normal vector in 3D-Space, how can I rotate the vector, such it points to a point in 3D-Space. I tried couple of ways doing this, which ended up looking completely wrong.
user19022's user avatar
0 votes
1 answer
134 views

Plot inverse of emulated double-precision floats

I need to accurately plot a line chart using WebGL. The numbers have a precision of around 33 bits - that's too many to fit into a single-precision float's mantissa. WebGL does not support the double-...
purefanatic's user avatar
0 votes
0 answers
19 views

Automate Image resize, scale, position for best quality (size)

I have a process where a web user selects a photo for a profile image. User is then presented with a canvas to zoom, rotate and move their image within a square viewport. Once satisfied, the user ...
johnw182's user avatar
  • 101
1 vote
1 answer
54 views

How do I convert pathtraced distance to value that is usable by OpenGL's depthbuffer?

I was hoping someone could check my understanding. I've got a pipeline that does some path tracing, and then draws some debugging rays using standard rasterization. I'm trying to get depth to work ...
Cascades's user avatar
  • 113
2 votes
1 answer
184 views

View rotation matrix

Im unsure about how I could describe what im trying to achieve in few words or a title so ill go on to describe it. So I have voxel, in 3D space, represented solely by its center. The voxel though, is ...
kaelundeen's user avatar
1 vote
2 answers
553 views

How to determine transformation matrix for an object given a graph?

I am given this image: and asked to determine the transformation matrix that took me from ΑΒΓΔΕ(let's call it ABCDE for convenience) to Α'Β'Γ'Δ'Ε' (A'B'C'D'E'). I am also given the solution, so as to ...
riverwastaken's user avatar
1 vote
3 answers
329 views

What projection matrix and world transformation do I need to have an isometric projection?

I'm doing my own engine in college to display a wireframe on screen with an isometric projection but I literally can't find any literature about maths behind doing it by hand just for game engines ...
MiguelP's user avatar
  • 111
1 vote
1 answer
103 views

3D to view plane projection

I am trying to draw points of a 3D sphere onto my monitor as if I was looking out into space. Me, the viewer, is at (0, 0, 0). The plane of my monitor is at (x, y, 1) and I have a sphere out in ...
Dan Wood's user avatar
0 votes
0 answers
113 views

Converting a Bezier Path with variable width stroke to an outline?

I started working on a "stylus annotation program", and as part of it I need an algorithm that convert a path with width indicators to an outline. This is similar to the Advanced Outline ...
Dov Grobgeld's user avatar
0 votes
0 answers
48 views

Getting something close to the convex full of SDFs using CSG operations

Inigo Quilez has an explanation of smooth operations to join sdfs. I am trying to get something close to the convex hull of multiple sdfs. For starters let;s consider a simple case of 3 cubes int eh ...
Makogan's user avatar
  • 1,696
2 votes
1 answer
237 views

Is it possible to make a projection matrix to not project in the center?

I have the following projection matrix: and I need to make a hole in the center of my matrix, something like that: (I don't want to project a custom W and H) Is that possible ? Thanks.
Cosma Eduard's user avatar
1 vote
1 answer
148 views

Defining the proper sdf for this structure

I am making a procedural sdf (just a bunch of cubes) based of an image. The idea is very simple. We have a stencil image: Each texel in the image corresponds to a 3D cube. So to ray trace what I am ...
Makogan's user avatar
  • 1,696
0 votes
1 answer
128 views

Error in equation 2.1. in Ray Tracing Volume Densities

I am reading through Kajiya - Ray Tracing Volume Densities paper. And I've already got stuck into section 2. I wonder if there's a mistake in that equation. I'll quote the relevant bit The quantity ...
user8469759's user avatar
2 votes
0 answers
182 views

physics/math of lighting gradient of a 3D object

Consider a monochrome ball. The colours of the pixels is a function of the point height, the light intensity, the light angle, and the surface material (reflection). What is the simplest formula ...
Googlebot's user avatar
  • 131
2 votes
3 answers
2k views

vulkan perspective matrix vs opengl perspective matrix

Hi I have a slight confusion in using the opengl perspective matrix in vulkan. glm's perspective matrix works directly in vulkan just by multiplying the "[1,1 term by -1 but when I compared the ...
VersesDev's user avatar
  • 129
2 votes
1 answer
394 views

Having trouble implementing distance transform with jump flood

I'm attempting to use the jump flood algorithm to compute distance transforms of an arbitrary texture derived from a canvas2d context, roughly following the explanations detailed here/here. In the ...
Nico's user avatar
  • 23
1 vote
1 answer
139 views

Conflicting definitions for the distribution of normals $D$ in microfacet BSDFs

Please do not confuse this question with this one. In Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs, Eric Heitz defines the distribution of normals as. There, the footnote. ...
GroundGlassUnknown's user avatar
1 vote
2 answers
420 views

Half Edge criterion to check if an edge flip is illegal?

I am trying to determine if and when flipping an edge is topologically valid. The current criterion I have is that it is only valid if there is no edge connecting the opposite vertices of the edge. I....
Makogan's user avatar
  • 1,696
2 votes
1 answer
256 views

Deriving formula for perspective correct interpolation

I am trying to derive the formula for perspective correct texture interpolation on my own while implementing my own software rasterizer (projecting an arbitrarily rotated triangle in camera space on ...
Sam's user avatar
  • 164
3 votes
1 answer
199 views

Cubic Splines - Do Parametric and Explicit representation give different curves?

I asked a similar question here before but since the previous post original question was different, I think it was confusing people. So I've voted to close that and asking the new question here. I'm ...
gallickgunner's user avatar

1
2 3 4 5