Most Popular

1500 questions
4
votes
1 answer

Javascript color extraction library

I have a small project that needs to extract the perceptually-salient colors of an image, in javascript. There are a few libraries out there (color-thief.js, vibrant.js). The trouble is, I'm finding that adobe color's image extraction does a…
Escher
  • 423
  • 3
  • 8
4
votes
1 answer

How to crop with edge-detection using imagemagick

Let's say I have an image of an object against a white background. I want to crop so that the image fills the available space. This takes 10px off: convert original.png -shave 10x10 shaved.png How would I implement something like this that detects…
Escher
  • 423
  • 3
  • 8
4
votes
1 answer

Earth curvature and horizon in modeling large scenes

If I want to model a large environment, how can I solve the problem of earth curvature and horizon? I use an environment map for the sky, but for the ground what can I do? Do I have to model the ground with a big plane, disk or a spherical cap? Is…
Valerio
  • 433
  • 2
  • 5
4
votes
1 answer

DirectX 12 Constant Buffer Binding

I can't really seem to figure out how to bind two constant buffers to my shaders. I have them described like so. One in slot b0 and the other in slot b1. cbuffer WVPData : register(b0) { matrix model; matrix view; matrix…
Andrew Wilson
  • 828
  • 7
  • 15
4
votes
0 answers

MRF and Textures

I am pursuing my research in Texture Interpolation. After digging deep into it, I'm stuck at a point. It is proven that textures can be modeled as Markov Random Fields and that each texture can be synthesized from a collection of neighborhoods. How…
4
votes
2 answers

Storing shadow data

Given a 3D space and a light source, I use ray casting to determine the shadows generated in the scene. If I'm to store the shadow data (boundary of the shadow, object which cast the shadow, etc.) what is an efficient way to go about it? Edit: Its…
ichigo1191
  • 43
  • 4
4
votes
1 answer

Parametric line intersection test

I have the following question in an exam review and I am looking for feedback about how to approach the solution. Any advice will be highly appreciated. "Using a parametric line intersection test, give the parameter values of the endpoints of a…
JORGE
  • 261
  • 1
  • 2
  • 3
4
votes
1 answer

How to remove a control point from a NURBS curve?

I am trying to write an algorithm to remove a control point from a NURBS curve, similarly to what can be achieved using the CVREMOVE command in AutoCAD. I searched online but I was unable to find a single article about this topic, so here I…
4
votes
2 answers

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. Would it be a viable and better pathway to…
4
votes
2 answers

What is the difference between a "meshlet" and just a small mesh?

Obviously, conceptually, a meshlet is just a small mesh. But what is the reason for making the distinction then? I'm assuming it has to do with how they are implemented. In a meshlet architecture, does a parent mesh contain the complete vertex…
Chris Gnam
  • 229
  • 1
  • 7
4
votes
2 answers

cosine term in rendering equation

Rendering equation's value can be estimated with Monte Carlo (Physically Based Rendering: Light Transport I: Surface Reflection): $\begin{equation} \begin{split} L_o(p, \omega_o) &= \int_{S^2}f(p, \omega_o, \omega_i) L_i(p, \omega_i) |\cos\theta_i|…
Rahn
  • 171
  • 4
4
votes
2 answers

How to decode a JPEG file which is not fully loaded yet?

I see web browsers doing this all the time when the internet connection is slow, loading the JPEG images almost line by line from top to bottom. How is this done in practice? I experimented with several image decoding libraries in Rust for example…
jhk999
  • 43
  • 3
4
votes
1 answer

Why do I need to remove the positive charactaristic function for the pdf of the outgoing direction to integrate to 1 with GGX?

Context: I am attempting to implement Trowbridge–Reitz (GGX) based on Microfacet Models for Refraction through Rough Surfaces in a pathtracer. I use numerical integration to check if the pdfs integrate to 1 (I convert solid angle to spherical…
4
votes
2 answers

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: plotLine(x0, y0, x1, y1) dx = abs(x1 - x0) sx =…
sneaker
  • 41
  • 1
4
votes
1 answer

How to find the nearest palette color when dithering in RGB

I maintain an image dithering library and command line tool. When I was initially developing the library, I was trying to figure out how to match dithered RGB values (containing quantization error or randomness, whatever the dithering algo does), to…
makeworld
  • 143
  • 3