# All Questions

2,187 questions
23 views

### How can you avoid thin triangles in a parametric shape in a smart way?

I have created a closed 3D mesh using a parametric function. The shape is constructed by taking an arbitrary closed b-spline and scaling it based on one of the parameters (similar idea to a parametric ...
14 views

### Is there a way to create a shared matrix set in open GL ES

Apparently it does not share "uniform buffer blocks" in the shader language or in the gl api calls. But it seems there might be some trick to use a vertex buffer of Vec4s and use them as matrices, ...
33 views

### Bitmap-images or SVG

I'd like to create a GUI in my first Unity-game (2D). I want my GUI appear sharp in all resolutions (e.g. 1920x1200 or 3840x2160). The problem I am facing now is that I don't know if I should save my ...
45 views

### Rendering Fluid Simulations?

I've read about Lagrangian and Eulerian fluid simulations and here's what I take from their methods: Lagrangian - Simulating fluid particles by calculating displacement for each particle Eulerian - ...
28 views

### Alpha component in color buffer affects RGB components?

I'm looking for a way to make my surface semitransparent, and for now i ended up using this configuration: ...
37 views

### How do I convert a hit on an infinite plane to UV coordinates for texturing in a Raytracer?

I am trying to convert a ray hit on an infinite plane, defined by an origin and a normal vector, into UV coordinates, so I can find the appropriate texel at that point. Code I have is close to ...
30 views

### How do I swap the buffers when using a Win32 window with Vulkan?

I was recently told here how to manage the integration between Vulkan and Win32. I am writing a windowing library like "GLFW", that is only going to support Vulkan; I have now come to the point where ...
75 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: ...
46 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 ...
30 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 ...
36 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 ...
15 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 ...
21 views

### Saving a turtle Graphics window

I made some graphics using turtle in python and used the command turtle.hideturtle() for hiding the turtle. For saving the graphics I am using the command ...
653 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 ...
37 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 ...
40 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 ...
34 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 ...
22 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?
27 views

### What vectors are used to assign light intensities?

What vectors are used to assign light intensities to surface points during the rasterization process in the Phong Lighting Model? A diagram would really help to see how this works.
43 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?
91 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 ...
22 views

### What are some textbooks on color? [on hold]

I like to learn some basics (what exactly is hue), and to understand how different blending modes (in Photoshop) and color adjustments (inversion, contrast/brightness, exposure, etc) operate.
43 views

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

In hidden surface removal, how does the Z-buffer algorithm work vs. painter's algorithm?
45 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?
23 views

### GLSL texture not applying properly

I was following the model loading tutorial here and am having issues displaying the model correctly, specifically applying the texture correctly. I am sending the diffuse textures to the shader in an ...
94 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"?
64 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?
16 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 ...
40 views

### Need help identifying style of an image (and possible conversion strategy)

The following image successfully maps to a 3d face on iOS: I am trying to find similar images (specifically a musculature version of the face) but have not been lucky. I have come to the conclusion ...
39 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 ?
37 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, ...
34 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 ...
81 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 ...
68 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
83 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 ...
62 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 ...
49 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.
47 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/...
66 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 ...
86 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): ...
76 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 ...
129 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?
48 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 ...
114 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 ...
81 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 ...
64 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 ...
40 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 ...
55 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. ...