All Questions

Filter by
Sorted by
Tagged with
4
votes
1answer
506 views

What if we don't mention Modelview and projection matrix?

So I've been learning opengl for some weeks now and managed to understand all the viewing pipelines. As far my understanding goes we need to bring the object to world space and then the world space to ...
4
votes
1answer
153 views

Colorblending shader recompilation scenarios

Context As I was trying to learn more about Vulkan, I learned that certain fixed-function steps could be implemented with shader code from this video (at around the spot where he talks about the ...
5
votes
1answer
203 views

The Process of Spherical Harmonics

I have read about spherical harmonics from Here about the usage of SH for generating Irradiance Environment Maps and how it can make the process of generating EM faster than the regular operations. ...
3
votes
1answer
218 views

Real time image based lighting for arbitrary BRDFs coordinate alignment

I was trying to understand how real-time illumination happens with image-based lighting. I understood that importance of representing the Environment Map and BRDF in spherical harmonics. Because ...
4
votes
1answer
202 views

OpenGL ES Frag Shader - Branching

Working on optimizing a fragment shader which is slowing down my OpenGL ES 2.0 shader based game. This is used with a shadow buffer to determine if the fragment/pixel is inside a shadow volume. The ...
9
votes
1answer
7k views

Programmatically generating vertex normals

I'm working with Kinect face api, it provides an array of vertices and indices for triangles which is to be rendered to make the face image. The no of vertices and their order in array as well as the ...
2
votes
1answer
109 views

Alternatives to Clipping in avoiding display problem

I know in computer graphic, we can set a world window in world coordinate system, and then mapping it to viewport which is the display window. Things that are not in the world window should not be ...
2
votes
1answer
667 views

Transforming fragment-to-camera to tangent space for parallax occlusion mapping

I'm trying to implement POM using this tutorial. As stated, I need to transform fragment-to-camera to tangent space and then pass it to a function. tangent space is computed using Assimp. Well I ...
6
votes
1answer
403 views

Image rescaling algorithm

Suppose I have to use bilinear interpolation to rescale image. I more or less understand how enlargement works in case of integer scale factor. But what to do with non-integer scale and especially ...
8
votes
2answers
177 views

Encode two R11G11B10F buffers into one using Y'CbCr?

We are trying to optimize Lighting in fillrate. Integrated graphics chips are very slow in memory access. There are two Light Buffers: one for Diffuse and one for Specular. Both use format R11G11B10F....
4
votes
1answer
117 views

How can I implement a complex sinusoidal function?

The following is the 2d complex sinusoidal function, $u_0$ and $v_0$ represent Fundamental Frequencies in $X$ and $Y$ directions respectively. How can I represent $j$ (imaginary number)? Edit: ...
5
votes
1answer
182 views

Error with tube lighting

I have recently been working on area lights for a small open source game engine called Urho3D but have run into an issues when rendering tube lights where the lights look the same as sphere lights ...
12
votes
2answers
693 views

What is the fundamental reasoning for anti aliasing using multiple random samples within a pixel?

In graphics, it's common to take multiple samples within the bounds of a pixel and combine them together (most commonly just doing an average) for a final sample pixel color. This has the effect of ...
6
votes
1answer
483 views

Do we use 3x3 matrices in computer graphics?

I've been doing some side-research on computer graphics as a hobby and came across this article on quaternions: http://www.opengl-tutorial.org/assets/faq_quaternions/index.html#Q2 In the first ...
4
votes
2answers
585 views

Rotate a cylinder from XY plane to given points

I am given geometry of a cylinder which lies on the XY plane with 1 unit radius. And given coordinates of 2 points in 3D I need to move the cylinder so that it connects the two points. What I tried ...
7
votes
1answer
989 views

Proper way to handle diffuse + refraction + reflection rays in path tracing?

Let's say we are path tracing and that there is an object which has some amount of diffuse reflection, and some amount of specular reflection. What is the best or correct way to handle that in the ...
1
vote
1answer
2k views

Background behind 3D model

I have object loader, which i want to have background. I tried to put jpg image like texture to my application. I tried to make that with FreeImage library, but the image didn't show. Also i tried ...
8
votes
1answer
278 views

Is this Russian roulette code correct?

I'm using www.scratchapixel.com among other resources to help me learn how to implement a renderer. I am looking at the following code from this page where a packet of photons moving through a ...
5
votes
3answers
3k views

What is the difference between a Sampler and an Image variables in GLSL?

Reading through some code about voxelization I found the following line in the fragment shader ...
4
votes
1answer
688 views

Solid angle and surface area values in (photometric) raytracing

So, I started writing my second raytracer - this time focusing on photometric rendering that uses IES lights and standard photometric units. I've got the basic raytracing up and running (using pure ...
3
votes
1answer
328 views

OpenTK - Vertex attribute layout issue

I use C# and OpenTK as my OpenGL implementation. My Vertex layout consists of 6 Doubles and one Float: ...
5
votes
1answer
286 views

Where is the best place for Tangent-bitangent calculation, in shader or in C/CPP code?

I have two methods of calculating tangent and cotengent (needed for normalMap lighting calculation). The one is doing it from CPP code (with assimp library for example) The second is doing it ...
4
votes
2answers
536 views

OpenGL: Purpose of transform matrix in Vertex shader where transform*vertex

I'm trying to understand OpenGL by using Processing OpenGL ES. If I have an example Cube to render. I've read that a vertex shader will be run once for each Vertex. The fragment shader will be run (...
2
votes
1answer
76 views

Use big frame buffer to control a small display

I am really new in computer graphic area. Suppose I have 1024*1024 frame buffer, and I want to use it to control a 512*512 display. What shall I do? In my opinion, I will only read the information in ...
5
votes
0answers
92 views

Unfolding a 3D point to a Cartesian plane

I am writing a texture splatting pixel shader for meshes (not terrain) whereby I find a UV position from a raycast, which I convert to a local position, and then calculate a bounding box around that ...
5
votes
1answer
224 views

Creating Sparks using Code

I'm new to this area and have less knowledge. I want to create some graphics like sparks and lightning by writing some code, using my own physics. I don't want to use some engine, However I can use ...
1
vote
0answers
83 views

Image cleaning - removing all regular shapes ( circles, squares, text, icons etc. )

I'd like an automatic method to clean images. I've been looking at the GIMP, and its command line (cli) interface, in scheme / lisp. It looks very promising, but I'm a complete novice, so I'd be ...
4
votes
0answers
174 views

selectively setting stencil value based on vertex property in vertex shader

Just like the question says. Is it possible to selectively set the value of the stencil buffer based on a property of a vertex, like the value of its normal, during its vertex processing phase? ...
1
vote
2answers
512 views

Only show opaque objects behind transparent objects

I would like to make certain objects in my scene transparent, but only the parts visible to the camera when opaque. Currently, when I make objects transparent, I can see other transparent objects ...
7
votes
2answers
1k views

Is it expected that a naive path tracer takes many, many samples to converge?

I have a naive diffuse/emissive material path tracer implementation (pinhole camera) and am seeing it take a very large number of samples per pixel to converge - like probably in the millions - and ...
3
votes
0answers
83 views

What is a good algorithm, and framework, to calculate centres of gravity or mass (cog)?

I'd like to take an photograph, subdivide it into a tesselation, either of squares, or (ideally), hexagons, and then find the centre of gravity (or, if you prefer, centre of mass) of each cell of the ...
5
votes
1answer
4k views

Confusion between usages of linear RGB and sRGB

Suppose you have generated an image using linear values for RGB channels. E.g. you linearly interpolated it when doing blending, etc.. When you're going to present this on the screen, should the ...
8
votes
1answer
319 views

How to correctly render visible spectrum with uniform intensity?

I'm trying to get the correct representation of visible spectrum to render on the screen. My current progress is with using CIE 1931 standard observer color matching functions analytically ...
1
vote
1answer
49 views

Photo-realism blind experiment [closed]

I need a lot of real time rendered images and real images where it's recorded which one is which to prove either way whether existing gaming computers have the hardware to be photo-realistic to ...
8
votes
1answer
2k views

OpenGL specular shading - Gradient banding issues

I use Phong shading as my lighting model. Nevertheless, the specular shading produces gradients in the light cone: Hopefully you can see the gradient starting from the lower left corner expanding ...
3
votes
2answers
232 views

Frustum aligned volume integration - aliasing issue - temporal reprojection

Raw volume raymarching especially aligned with frustum seem to produce a lot of aliasing/banding on edges of shadow map. Especially when fragment pos is far because step length is then getting bigger. ...
3
votes
1answer
291 views

Bug: Overly Sharp Highlights in PBR

I'm still working on my BRDF equations. Theoretically, all equations are correct, but the hilights are super sharp. I'm not sure if this is a result of me not using Image-Based Lighting (I currently ...
15
votes
3answers
7k views

Physically based shading - ambient/indirect lighting

I implemented a physically based path tracer after studying PBRT by M. Pharr and G. Humphreys. Now I'm trying to apply physically based rendering to real time graphics using OpenGL ES (in an iPhone ...
5
votes
1answer
131 views

Where should I project a polygon corner when it is behind me?

I am creating a simple 3D engine as a learning project to get the hang on spherical trigonometry. I am using the following approach. 1. A model consists of a lot of triangular faces. 2. Each triangle ...
13
votes
3answers
2k views

Correct Specular Term of the Cook-Torrance / Torrance-Sparrow Model

For a while I have been doing some research on the topic of Physically Based Rendering. One reflection model that is mentioned over and over is the Cook-Torrance / Torrance-Sparrow model. It seems ...
5
votes
1answer
218 views

I dont understand how a GPU computes and branches, could you please help me fix this shader preformance

I have been working on how the GPU does parellel processing, and branching. However I am not yet to the point where I know how to make this shader more efficent. Essentially I dont know enough about ...
5
votes
2answers
1k views

Screenspace Normals - Creation, Normal Maps, and Unpacking

I'm trying to condense my Deferred Rendering G-Buffer. So I have some questions about getting 2-component Screenspace Normals. I know Frostbite and Killzone (the only two AAA company's G-Buffers I ...
4
votes
1answer
68 views

What happens when GL_Depth is disabled

In my simulation I draw a bunch of rectangles with GL_TRIANGLE_STRIP inside of one draw call. What will happen if I turn off GL_DEPTH_SORT? If all of the rectangles were stacked on top of themselves ...
4
votes
1answer
239 views

How to get unique nearest neighbour?

There's already something called K-nearest neighbour algorithm with gives nearest neighbour to points. But what I want is unique neighbour which is not shared by any other neighbour. I've implemented ...
5
votes
1answer
965 views

What Are The Default Values of `glReadBuffer/glDrawBuffer(s)` for an FBO?

glReadBuffer(...)/glDrawBuffer(...)/glDrawBuffers(...) access part of a framebuffer's state. ...
7
votes
1answer
615 views

Animating a smooth linear transformation

After watching this video on matrices, I tried to make a simple animation of 2D linear transformations. Starting with a set of 2D points in a grid, I applied a 2x2 matrix to each point and obtained a ...
6
votes
1answer
189 views

Weird rendering in rectangle mesh shader AKA Why has my basic shader become a modern art generator?

I am trying to translate an old (2013) bit of code from Apple from objective C to Swift with some modifications I need for my simulation. The code I am translating can be found here To make ...
6
votes
1answer
1k views

Algorithm for adjusting the speed of a progress bar animation

I am trying to figure out an algorithm for handling an otherwise simple animation. I have a progress bar that "ticks down" from a user specified amount of time to zero. I wanted a smooth animation, so ...
4
votes
1answer
192 views

Transformations about a Plane

I need to find the transformation matrix (homogeneous coordinates) that flips an object about a plane whose normal is directed towards (-2 2 0), and intersects the y-axis at y=2. I know how to do ...
4
votes
3answers
4k views

Computing a rotation: complex numbers vs rotation matrix

A 2D vector can be rotated by an angle $\theta$ using the rotation matrix: \begin{bmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{bmatrix} Or, it can be rotated by ...

15 30 50 per page