Most Popular

1500 questions
3
votes
1 answer

Creating a gently moving 2D fog effect

I am trying to create a fog-like effect, similar to that found using perlin noise. I know where I can find information about that effect, but it's harder for me to tell if it's an efficient route for what I want to achieve. A similar effect can be…
aceslowman
  • 193
  • 1
  • 5
3
votes
1 answer

Preserving luminance

I am writing an application with multiple colored surfaces. I would like to preserve luminance, i.e. a blue surface would appear as bright as a green one, are there tools to help for this?
Stackmm
  • 89
  • 8
3
votes
1 answer

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 view space. After that the clipping is done by…
Broskiee
  • 133
  • 4
3
votes
1 answer

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 problem/slowdown is the fact I need a branch if or…
3
votes
1 answer

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: here is my use-case: ... ... I need to implement…
user464
3
votes
2 answers

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 so far after searching online: Calculated the…
Akshay Jain
  • 131
  • 3
3
votes
1 answer

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 geometry), I've read any article I could found on…
3
votes
1 answer

OpenTK - Vertex attribute layout issue

I use C# and OpenTK as my OpenGL implementation. My Vertex layout consists of 6 Doubles and one Float: public struct Vertex { //Positions public double X; public double Y; public double Z; //ContourEdge public float…
enne87
  • 601
  • 2
  • 7
  • 15
3
votes
2 answers

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 (at least) once for each pixel. In a vertex shader…
user3168961
  • 133
  • 3
3
votes
0 answers

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 tesselation. The output, for any image, would be…
Peter Brooks
  • 131
  • 2
3
votes
1 answer

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 in a 2D screenspace sense would they always be in…
J.Doe
  • 1,445
  • 12
  • 23
3
votes
1 answer

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 this logic but it's very slow. You can review my…
3
votes
1 answer

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 that when I have 3 points on the plane (A,B,C):…
Jjang
  • 183
  • 3
3
votes
1 answer

ping pong between same framebuffer two color attachments

In order to optimize I'm trying to set up a setup which ping pong between same framebuffer two color attachments to apply some postprocess effects. It seems to work (effects are applied) but concurently I'm getting a lot of strange artifacts…
mdkdy
  • 2,169
  • 1
  • 12
  • 19
3
votes
1 answer

Meaning of the parameter in a line-plane intersection in the space

The scenery is the following: I have a polygon in the space, defined (the polygon) from your vertices. By 3 vertices of the polygon (non-aligned) revenue equation of the plane containing the polygon. Later I have a ray of light, represented by the…
Nick
  • 321
  • 1
  • 9