Questions tagged [culling]

1

votes
2

answer
89

Views

OpenGL: Quads seemingly not culled properly

I have built a simple scene like the following: The problem is, the blue shape is lower than the red one but somehow bleeds through. It looks proper when I rotate it like the following: From what I searched this could be related to the order of vertices being sent, and here is my definition for thos...
SenselessCoder
1

votes
1

answer
444

Views

Three js: is my point visible or occluded?

I have a point in space express a vector in a three js viewer. Attached to this point there is an 'HTML annotation' that I would like to hide when the point is not visible (behind other surfaces of the same mesh or hidden by other meshes). For example in the image below it should be hidden: I am us...
Dino
1

votes
1

answer
68

Views

DirectX 11 front face culling does not cull front faces in shadow map

I try to implement shadow mapping (CSM) on DirectX 11 and succeeded to get a prototype working. Right now I have drawn the geometry using back face culling in the shadow map pass but I now want to switch to front face culling to further reduce shadow acne. Switching to front face culling does not ch...
Busy Beaver
1

votes
1

answer
343

Views

DirectX meshes not being displayed properly after switching view and projection matrices

In my program, the meshes were being displayed properly, but when I change the device.transform.view and the device.transform.projection matrices from the left handed to the right handed system, the meshes are not displayed properly anymore, i.e the back faces are being illuminated and the front fac...
user326075
1

votes
2

answer
899

Views

C# XNA - Render(?) 3D object when off/half off screen. (Culling?)

Objects that are really large like, lets say a game map will outright not show up in XNA if their origin point is not on the screen. I can't find a bloody thing on this. I have looked into culling and attempted to add it in a few forms to the project to counteract this but to no avail. I want to d...
Remm
1

votes
1

answer
727

Views

XNA - Culling Performance Issue

This method that draws my tiles seems to be quite slow, Im not sure exactly whats wrong, it belive my culling method isnt working and is drawing stuff offscreen, but im not completeley sure. Here it is: // Calculate the visible range of tiles. int left = (int)Math.Floor(cameraPosition.X / 16); int r...
Cyral
1

votes
1

answer
1.1k

Views

Orthographic 3D Backface Culling using Surface Normals

I'm creating an HTML5 canvas 3D renderer, and I'd say I've gotten pretty far without the help of SO, but I've run into a showstopper of sorts. I'm trying to implement backface culling on a cube with the help of some normals calculations. Also, I've tagged this as WebGL, as this is a general enough q...
Hunter Trujillo
1

votes
1

answer
153

Views

Vector Explanation

I have been following this article on Frustum culling, and I need some help understanding the vector math behind it. More specifically, what are the vectors of 'up' and 'right' he talks about? What values do they hold? Sorry for the brief and unexciting question, but I am really stuck on this. An...
CoderTheTyler
1

votes
1

answer
421

Views

Google Earth / Processing.js - Implementing Back Culling with 3D Projection

I'm currently working on a project that looks to map real world data onto the Google Earth globe, using the Google Earth API. The head honchos that be have asked for more demanding visuals than the plugin can offer (i.e. fancy lines, images and shapes with varying opacity fills that are animated ove...
user2853506
1

votes
1

answer
874

Views

OpenGL - Occlusion query depth buffer?

I've just started getting into the topic of occlusion queries in OpenGL, but I'm a bit confused about how they actually work. In most examples I've found, the depth and color masks are deactivated before drawing with the occlusion query (Because we don't need to actually 'draw' anything), in essence...
Silverlan
1

votes
1

answer
293

Views

Libgdx culling between modelinstances decals

I can't figure out, how I to tell libgdx to draw my green spheres behind my transparent decal. Here is an example picture of my problem: The decal creation: first two params are width and height, last flag is wether transparent or not. Decal.newDecal(count * (GUTTER + BUTTONWIDTH) + GUTTER, 2 * GU...
unreal
1

votes
1

answer
269

Views

Back Face Culling for Line Loop

I am using z-buffer to render my 3D triangular mesh. However, when I rendered the model as a wireframe mesh, I also saw the triangle faces which should have been hidden by the front face. So, I used the back face culling as follows: glEnable(GL_CULL_FACE); glCullFace(GL_BACK); drawWireFrame(); glDis...
wateva
1

votes
1

answer
235

Views

Frustum culling decreases framerate in debug but improves it in release

I'm making a tilebased game in SFML and decided to implement a simple bounding-box frustum culling to only draw the tiles that are in the viewport of the camera. The result was a success, as it tripled my framerate! However, there was a cache. When running the game in debug the framerate is instead...
LethalJam
1

votes
1

answer
395

Views

Faking Scrollbars With JavaScript or jQuery

I am currently working on a custom table that I have made with knockoutJS and jQuery. Because this table is possibly dealing with 1,000 - 100,000 rows, I have implemented my own virtual scrolling technique in KnockoutJS to ensure that only 35 or so elements are visible at a time (depending on viewpo...
James Manes
1

votes
1

answer
71

Views

Wireframe rendering with depth-buffer in deferred rendering

I have a small OpenGL app for some scientific visualization with deferred rendering pipeline. I have got 2 passes: geometric pass, where I render textures with positions, normals, albedo, segmentation, e.t.c.; and lighting pass, where I just map some of that data to the quad and render it on the scr...
user3051029
1

votes
1

answer
0

Views

Culling works with extracting planes from view-projection matrix but not with projection matrix

I have implemented frustum culling by using the plane extraction method explained in this article. The article mentions that if the matrix is a projection matrix, then the planes will be in view-space. So I need to transform my AABB coordinates to view space to do the culling tests. However, this do...
Winger Sendon
1

votes
1

answer
2.8k

Views

C/C++ OpenGL Occlusion Culling

I'm trying out raw OpenGL, so I decided to code very, very simple game based on 3d blocks, something a'la retarded Minecraft game, just to improve my skills. Last problems I've met with were cullings. I've finally figured out how to make Frustum Culling and Backface Culling, and they both work well,...
1

votes
1

answer
72

Views

What could cause polygons in OpenGL to be rendered out of order?

I'm trying to get some hands-on experience with OpenGL so I've been writing a few basic programs. The short program below is my first attempt at rendering a solid object --a rotating cube-- but for some reason some back polygons seem to be getting drawn over front polygons. My question is what could...
AIGuy110
1

votes
1

answer
1.3k

Views

Is Occlusion culling enabled in threejs by default

Is occlusion culling enabled in threejs by default or there is any setting in threejs where I can enable it ?
kishore
1

votes
1

answer
265

Views

How to retrieve a bounding box's meshes in three js?

I am actually working on implementing some occlusion culling on three.js , and I want to know if there's a way ,from a THREE.Box3 , to retrieve all corresponding meshes that are inside this bounding box ? does the bounding box in three.js keeps track of the meshes it contains ? Thank you all .
HamilcarR
1

votes
1

answer
1.7k

Views

Frustum culling rectangles problem

I am trying to implement frustum culling in my OpenGL 2d game. The only kind of geometric objects in my game at this point are rectangles, so I thought this would be pretty easy, but I am getting unexpected results. I have setup a symmetrical perspective projection with a field-of-view angle of 45 d...
Jacob
1

votes
1

answer
670

Views

OpenGL instanced rendering - frustum culling

I'm drawing large amount of cubes (100 000+) using glDrawElementsInstanced(). Due the performance reasons I'd like to implement frustum culling, but I'm not quite sure how to do that when I'm using instancing. From what I know, the only way to access individual instance of object is in shaders, so I...
user1760770
1

votes
2

answer
1.1k

Views

SceneKit - Occlusion culling

I've played with SceneKit on iOS 8 for quite a while, and recently, I run into a situation in which I need to detect if a node does not appear on the viewport. Occlusion culling might be a possible solution. Therefore, is there any occlusion culling option available from SceneKit, and if not, what a...
Van Nguyen
2

votes
2

answer
393

Views

Occlusion queries with stencil test only

Do occlusion queries still work if I disable depth testing altogether when the obstacle set is known a priori to be strictly in-between the camera and the object to be tested? This is an attempt to improve performance, as, logically, I don't need complex z-tests if none of the occluders are behind t...
user2464424
2

votes
1

answer
166

Views

Android OpenGL ES render compex object incorrectly

I'm trying to write program that draws complex non-convex object. But I have problem - some faces appear to be transparent. I partially solved this by adding GLES20.glEnable(GLES20.GL_CULL_FACE); But after that I found out that it doesn't work if there are two faces with the same direction of their...
user1786577
2

votes
1

answer
321

Views

“Culling” for single vertices - glDrawArrays(GL_POINTS)

I have to support some legacy code which draws point clouds using the following code: glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, (float*)cloudGlobal.data()); glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(GL_FLOAT, 0, (float*)normals.data()); glDrawArrays(GL_POINTS,...
2

votes
1

answer
712

Views

Three.js Unculled SkyBox

I am attempting to have my skybox not be affected by the camera.far parameter. I would like to cull all other scene objects with this just not the skybox. When I set skyBox.frustumCulled = false; it makes no difference. skyBox being the mesh of course. Is this done by adding another render pass? If...
Hobbes
4

votes
1

answer
1.6k

Views

Early stencil culling

I'm trying to get early fragment culling to work, based on the stencil test. My scenario is the following: I have a fragment shader that does a lot of work, but needs to be run only on very few fragments when I render my scene. These fragments can be located pretty much anywhere on the screen (I can...
Fred
6

votes
5

answer
10.9k

Views

3d Occlusion Culling

I'm writing a Minecraft like static 3d block world in C++ / openGL. I'm working at improving framerates, and so far I've implemented frustum culling using an octree. This helps, but I'm still seeing moderate to bad frame rates. The next step would be to cull cubes that are hidden from the viewpoint...
Eric Coutu
2

votes
0

answer
575

Views

Why is my frustum culling not culling on certain angles?

My frustum culling implementation isn't working properly; what happens is it will cull when I rotate the camera to the left, but not to the right. It will also 'cull' if I move the camera backward, though the distance at which the object disappears and isn't rendered is very short for this - about 6...
zeboidlund
6

votes
3

answer
7.9k

Views

C++, OpenGL Z-buffer prepass

I'm making a simple voxel engine (think Minecraft) and am currently at the stage of getting rid of occluded faces to gain some precious fps. I'm not very experimented in OpenGL and do not quite understand how the glColorMask magic works. This is what I have: // new and shiny glClear(GL_COLOR_BUFFER_...
Solenoid
6

votes
1

answer
657

Views

“Radar approach” to Frustum Culling: fail at first simple test?

Trying to get at least the very simple part 1 of the Lighthouse3D Radar Frustum Culling tutorial to work... and am absolutely baffled that I can't even make that part work in my renderer. So the first step is: you test if a point is in front the near-plane or behind the far-plane, and early-cull if...
metaleap
2

votes
1

answer
3.9k

Views

Vertex Winding Order in DX11

I'm trying to draw a simple square with dx11, but the order of the indices of each triangle determines whether or not it shows up. I set the cull mode to none in the rasterizer state, but it doesn't seem to change anything. If I specify the vertices of the first triangle to be 0, 1, 2 instead of 2,...
pghazanfari
2

votes
1

answer
131

Views

In 2d graphics, what's the performance overhead of rendering to a target, then to the screen?

I'm making a splitscreen game. When I render each of the splitscreens, there is some overlap outside the boundaries of the screen. The screen will be say 10x10 tiles big. If you move half a tile to the right, assuming the splitscreen view is centered, displayed on the screen is now half a tile on th...
NibblyPig
2

votes
1

answer
430

Views

GLSL shader: occlusion order and culling

I have a GLSL shader that draws a 3D curve given a set of Bezier curves (3d coordinates of points). The drawing itself is done as I want except the occlusion does not work correctly, i.e., under certain viewpoints, the curve that is supposed to be in the very front appears to be still occluded, and...
vicrucann
2

votes
2

answer
156

Views

Is there a significant performance difference between using GL_CW in favour of GL_CCW with backface culling?

Let's say I enable backface culling using: glEnable(GL_CULL_FACE); I can configure which side faces are culled on using either of these: glFrontFace(GL_CW); glFrontFace(GL_CCW); Is there a significant performance difference if I choose one over the other? My hunch says it doesn't matter because this...
Bartvbl
3

votes
1

answer
1.5k

Views

Frustum and sphere intersection

I'm reading along this neat article here: Frustum Culling and it reads that to find the distance between a sphere and a frustum side (a plane) is: C = center of sphere N = normal of plane D = distance of plane along normal from origin Distance = DotProduct(C, N) + D But I don't understand what varia...
sgtHale
1

votes
1

answer
2k

Views

Disable face culling in WPF

I'm starting experimenting with WPF 3D rendering, and one of the first problems I'm facing, is how to disable face culling. I know how to do that in DirectX and OpenGL, but I can't find a way to do that in WPF. Here is my ViewPort markup. The model is generated at runtime, and it's a MeshGeometry3D...
NinjaCross
3

votes
1

answer
1.1k

Views

Opengl Mirror transform backface culling

In openGL, I've got an object that I scale by -1 along an axis... this results in the object not rendering properly because all the front faces are now back faces. Short of disabling culling, how would I get this object to render right? Is there a way to do it without modifying the textured normal v...
Ian Nafiri
3

votes
2

answer
1.1k

Views

Best OpenGL culling method for old game rendering?

Hey guys, I am rendering some old geometry from an old game. Their client had some algorithm which allowed them to see which areas were nearby but I don't have that ability so I am looking into culling the unnecessary polygons. Currently, I am rendering every single polygon in the whole zone regardl...
Satchmo Brown

View additional questions