# All Questions

2,224 questions
98 views

### Smooth shading on sphere approximation

In what way is a "cheat" when using smooth shading on a sphere approximation? I'm not understanding how it's a cheat to use smooth shading on this? Other questions that are lead after this may be: ...
75 views

### Should you measure mesh complexity in triangles or vertices?

I have seen people using either vertices or triangles as a quick heuristic to estimate mesh memory usage and mesh rendering time. I always thought vertices were better, because the number of vertices ...
66 views

### Do I need separate Graphics and Transfer commands?

I was following this tutorial on Vulkan https://vulkan-tutorial.com/Vertex_buffers/Staging_buffer and I decided to do this bit: The buffer copy command requires a queue family that supports ...
53 views

### Bresenham's algorithm next pixel?

In line drawing, bresenham's algorithm was explicitly derived for lines with slopes between 0 and 1 in the first octant from point P1 to point P2, where the x value of P1 is less than that for P2. In ...
20 views

### What are the outcodes that would be assigned to these points?

In Cohen-Sutherland clipping, it assigns outcodes to the points on lines that are drawn to specify their orientation relative to the clipping window. In the diagram below, I'm confused on what ...
759 views

### Why are oct trees so much more common than hash tables?

When reading papers I commonly find Oct tree implementations of geometry representations to sort the data. However whenever I think about the problem hash tables seem better overall. Hash tables have ...
75 views

### Ghosting in volumetric lighting

Does anyone know any method to remove ghosting in volumetric lighting? When light move it leaves trail behind, i would like to remove it. Volumetrics are Bart Wronski style (in frustum) with ...
50 views

### Why is precalculating a distortion different from calculating it in the shader?

I have an application where I simulate a camera distortion. There are two ways to go about it: calculate the distortion per pixel in the shader or precalculate the distortion and store the distortion ...
45 views

### Why is glreadpixels only working in certain cases?

If I try to read the screen with glreadpixels and then draw the same thing again using gldrawpixels it works, BUT if and only if ...
38 views

### How does the Modified Phong Lighting Model from the Phong Lighting Model?

How does the Modified Phong lighting model also known as the Blinn-Phong differ from the Phong Lighting Model? How can I distinguish the two?
47 views

### What are the 3 types of light reflection from surfaces in the Phong Lighting Model?

Can someone please explain what are the 3 types of light reflection from surfaces in the Phong Lighting Model? Maybe possibly using a diagram to help me understand it better?
127 views

### What is mipmapping?

I know OpenGL likes the texel resolution of textures be some power of 2 in each direction because of mipmapping. (They say that this is not a totally stringent condition, but it is preferred) Can ...
87 views

### Z-Buffer algorithm vs Painter's algorithm?

In hidden surface removal, how does the Z-buffer algorithm work vs. painter's algorithm?
62 views

### How are normals assigned to vertices in different types of shading?

I'm new to this forum and topic but wanted to figure out specifically how are normals assigned to vertices in flat shading, gouraud shading, and phong shading? Is there a difference between any?
110 views

### Why do polygons have to be “simple” and “convex”?

I'm new to computer graphics and just wanted a solid understanding of why? Why is it so important that polygons you push through the pipeline be "simple" and "convex"?
94 views

### How does GLSL code get “loaded” and “compiled”?

I just wanted to find out for sure how GLSL code gets loaded and compiled. Does the g++ compiler do it?
17 views

### PostScript to PDF [closed]

So I have this ps file and I am converting it to pdf using ghostscript ps2pdf . However some part of my ps file is being cropped in the conversion specifically the margins . How can I convert this ...
62 views

### Turtle in Python

I am new to turtle library in python . I created a pattern using turtle however I observed margin gaps around the rectangle that I created . How can I remove them ?
49 views

### Ask for help on understand an algorithm which combines stratified sampling and importance sampling of Monte Carlo

I cannot understand an algorithm which combines stratified sampling and importance sampling of Monte Carlo. It is introduced in Page 73 of a textbook "Advanced Global Illumination", 2nd edition, ...
40 views

### Ask for help on understanding a formula related to change of variable

Although I have tried for a long time, I cannot understand Eq.(11) of paper "Microfacet Models for Refraction through Rough Surfaces" written by Bruce Walter, Stephen Marschner, Hongsong Li and ...
106 views

### Is a single shader and 1x1 pixel white sampler more efficient than frequent switching between shaders with and without samplers?

I have some existing OpenGL code that I am porting to Vulkan. The question is somewhat relevant to both OpenGL and Vulkan. I am rendering some primitives using textures, some single channel, others ...
107 views

### FPS counter for a simple Vulkan app

What measurement/monitoring tools could I use to get the FPS values for a simple Vulkan app? Thanks in advance
94 views

### “Artist Friendly Metallic Fresnel” reversible?

While implementing the "Artist Friendly Metallic Fresnel" paper by Ole Gulbrandsen (http://jcgt.org/published/0003/04/03/paper.pdf), I read that it is fully reversible: (section 2.3.2): for all r,g ...
66 views

### Overlaying a grid on to a height map

What is the method used in overlaying a grid (agonostic of the grid type) on to a height map? It seems it's some sort of projection, but what are the technical details in how to implement it? An ...
140 views

### How do I create a Win32 window with a Vulkan context?

I am aware of libraries that already do this (like GLFW), but I would actually prefer do all of the window and context creation by myself.
57 views

### Writing data to a shader resource at runtime in DX12

I'm hoping to port my existing toy raytracer to a window so that I can see samples accumulate over time. And then port over to Pixar's pmj02: https://graphics.pixar.com/library/...
70 views

### Given a picture of a unit square at an arbitrary angle and position, how can I reconstruct the distance and orientation?

To simplify, assume faces and corners of the square are labeled and the camera lens if whatever makes this simplest (a 90 degree field of view projection?) The application: using a known and labeled ...
109 views

### Flood-Fill and scanLine algorithms are line-based floods but I want square based floods

I have a flood-fill algorithm (Flood-fill) to fill a 24x24 matrix as follows (matrix is 24x24 here but will be much bigger in production): ...
80 views

### How does Voxel Cone Tracing solve the rendering equation? [duplicate]

so I am not new to interactive graphics programming, but I wanted to try out advanced techniques. Currently I am struggling to understand how the author of the 2011 paper "Interactive Indirect ...
181 views

### What algorithm to reassemble a broken image?

What algorithm can I use to reassemble a broken image? Is there any technique? algorithm? Can I use graphs? machine learning? computer graphics?
88 views

### total internal reflection implementation in pbrt-v3

I've been implementing a path tracer, referring pbrt-v3. However, I'm a bit confused about its implementation. Code is here. It seems when we sample to do transmission, it tests if it meets a total ...
132 views

### Luminance and Radiance in computer screen

I am currently building a graphics engine. I have a slight confusion on the imaging pipeline of computer screen. My question is how does computer transform the colour in the final frame buffer to ...
102 views

### Translate an arcball camera upwards or left-right

This problem is giving me a really hard time. I'm always looking at the origin and have a camera that moves around it in an arcball mode. That part works beautifully: I'm calculating the camera ...
80 views

### Project vertex onto plane

What I have: a plane given by its normal$\ n$ and a point on the plane$\ p$. a 3D-point$\ v$. a direction$\ d$. What I need: the projection of$\ v$ along$\ d$ onto the plane. How can I ...
63 views

### Drawing Directed Lines (with arrow endings)

I am working on a simple graph viewer with OpenGL. My problem with is directed edges. I tried to draw arrow endings with GL_TRIANGLES but somehow my calculations are off. I've used direction cosine ...
69 views

### Is it possible to access adjacent vertex data in tessellation evaluation shader?

I'm trying to render thick cubic Bezier curves using the whole OpenGL 4.5 pipeline: I render a patch with 4 control points. Vertex shader is simply pass-through to tessellation control shader. ...
43 views

### In texture mapping, should we set texture coordinate to every vertex or can I skip vertices in between?

I am working on a texture mapping problem. I use vtk C++ library for my work. I have a very dense mesh with lots of vertices. I want to apply image texture to this mesh. Should I set texture ...
76 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 ...
78 views

### Conversion from cubic catmull-rom spline to cubic b-spline

I have a bunch of points that are the control vertices of a cubic catmull-rom spline. I would like to convert these to the control vertices of a cubic bspline. I believe I can do this using this ...
21 views

### How to rotate camera in CAD package application

I can rotate camera to change the view for the first person. But as I am working on a camera object for a cad package this isn't a first person or walk-through. I am not sure how to rotate the camera ...
65 views