Most Popular

1500 questions
6
votes
2 answers

Finding the angle of any side of a polygon

I'm trying to find the angle it would take for me to rotate a polygon so that a specific side is completely horizontal and on the bottom. For example, a shape like this: Needs to be rotated so the side with the red square on it is on the bottom and…
mmmeff
  • 163
  • 3
6
votes
1 answer

Drawing a cube a million times

I need to build terrain using one cube with dimensions 1x1x1, the coordinates are provided in a .txt file and there are about 11M triplets. The problem is that using my current code I can only draw about 60k of them, then the browser tab is resetted…
Mark
  • 161
  • 2
6
votes
1 answer

How to render an object that recieves shadows but does not cast them in a variance shadow mapping system?

I'm currently preparing to implement variance shadow mapping based on this article. However, one point it makes concerns me: Rendering only casters (and not receivers) into the variance shadow map is incorrect! For the interpolation to work…
user349
6
votes
2 answers

Always rotate in the direction of mouse movement

In my SharpGL application I do a very simple, mouse controlled rotation of the scene. gl.Rotate(cameraRotation.X, cameraRotation.Y, 0.0f); where cameraRotation.Y += MousePosition.X - previousMousePositionX; cameraRotation.X += MousePosition.Y -…
Patrick
  • 61
  • 1
  • 3
6
votes
0 answers

How much processing power does stenciling actually save?

For example, let's assume I'm rendering cascaded shadow mapping, but for whatever reason, instead of one of the typical approach, I do the following: Render the lowest resolution shadowmap Copy part of the shadowmap to the next shadowmap, covering…
Llamageddon
  • 931
  • 2
  • 7
  • 13
6
votes
1 answer

Materials for research on spherical projection

I am currently doing a research on projection on a sphere, specifically for NOAA's project Science on a Sphere. What I'm trying to do is to find out how exactly do you create a video material for such a device, because it's not as simple as making a…
Michal Kučera
  • 353
  • 1
  • 8
6
votes
1 answer

How to render the wireframe of a cube without the diagonals on the faces?

I'm developing with OpenGL 4.1 and have good understanding of the modern pipeline. I was thinking on doing it with GL_LINE_LOOP for each face, but I think this will require several draw calls which certainly is not optimal. What could be a better…
BRabbit27
  • 969
  • 1
  • 10
  • 21
6
votes
1 answer

Can't get output from a GLSL code

I'm trying to learn GLSL, I'm following this tutorial. I've done everything according to the tutorials but I can't get any output from my code. As you see I'm checking for both compile errors and linker errors and everything is fine, GLSL code…
lino
  • 163
  • 5
6
votes
1 answer

Can the uniform id be changed from run to run on the same machine?

I have a shader which has several uniform variables: uniform vec4 a; uniform vec4 b; uniform vec4 c; I'm getting these handles using glGetUniformLocation() and storing them in the array. The game was suspended, then resumed and onSurfaceCreated()…
Netherwire
  • 275
  • 2
  • 6
6
votes
1 answer

Two-dimensional bounded area defined parametrically

How do I go about defining this area without using a piecewise function? I think it has something to do with Bilinear Surfaces but I'm not sure how to get started.
Gavin
  • 161
  • 2
6
votes
1 answer

Texture glitch when using simple pixel shader

I have an issue with rendering my textures in Silverlight. When I look at it from above everything looks fine: But if I only change angle of watching it it looks terrible: I am using very simple pixel shader (hlsl): float4 main(VsOutput vertex) :…
bartosz.baczek
  • 399
  • 1
  • 12
6
votes
1 answer

OpenGL: read texture mipmap level 0 and render to same texture mipmap level 1

I am trying to generate mipmaps, which are based on depthbuffer values. To generate the next mipmap level, I am trying to read in the 4 pixels of the upper mipmap level per pixel. Unlike the usual mipmap generation. I am checking the depth values,…
Thomas
  • 1,245
  • 1
  • 4
  • 16
6
votes
1 answer

Can meshes be reused in raytracing?

In rasterization, at least in the context of game development, it is a common to have many instances of the same 3D object in a scene (think many identical rocks in different sizes/positions/rotations) and to render them by only putting the 3D…
Ilya
  • 75
  • 3
6
votes
2 answers

Gimbal lock confusion

I am trying to understand exactly what is happening when Gimbal lock occurs. I have read many explanations now which provide the high-level idea, in that Gimbal lock occurs when two axes are aligned during the sequence of three rotations. But I am…
6
votes
1 answer

Existing method to automatically fill in this sort of concavity in meshes?

I am working with a PWP3D-like algorithm that renders silhouettes of a mesh in order to segment a frame of video and update an object's pose. Because it is only the silhouettes of the mesh that matter, it would be nice to automatically generate…
FilmCoder
  • 91
  • 4