|
shodanjr_gr posted:I dont want to mute certain channels, i want to mute whole buffers against clearing (for instance my FBO has 4 color buffers + a depth buffer, i only want to clear the first color buffer). How does glColorMask help me with that? You need glDrawBuffer or glDrawBuffers to set up which ones to write to, I guess
|
# ¿ Sep 1, 2008 03:06 |
|
|
# ¿ Apr 28, 2024 20:24 |
|
Try an extension library like glew, it makes accessing all of OpenGL's functionality painlessly transparent Not sure if it differentiates between hardware support and emulation, but it's worth a try
|
# ¿ Dec 17, 2008 05:13 |
|
MasterSlowPoke posted:The bounding box is already computed per-frame and is interpolated inbetween. I'm simply performing a rotation about the Y axis on the model's world matrix. In fact, this method does in fact work when I transform the bounding box's physical geometry, but I need to get the actual values for my collision testing. Well once you rotate the AA bounding box it's obviously not going to be axis-aligned anymore, so you can't really use it for collisions like that. I guess one cheapo solution would be to take the maximum and minimum of the new and old corner coordinates, per axis, to get a slightly larger AABB of both the original and the rotated BB. Or switch over to something rotation-invariant like bounding spheres... If you actually need the rotated positions of the BB vertices, like what you're calculating in that source snippet, you need to work out the coordinates from min/max first and then transform each one separately. Of course the result is not an AABB so it's useless for cheap collision detection.
|
# ¿ Feb 13, 2009 06:52 |
|
Scarboy posted:I have a camera in OpenGL using the gluLookAt function that is working correctly. The camera rotates around a fixed point at the center of the screen. Is there any way i can lower the center point of the camera on the screen/viewport/window? Not sure what it is that you want (why not just mve the camera slightly up?), but it sounds like an off-center projection matrix. Something like calling glFrustum by hand (or D3DXMatrixPerspectiveOffCenterLH, both the GL and DX references have matrices describing what's going on) with the vertical bounds of the viewing frustum skewed as much as you like.
|
# ¿ Feb 25, 2009 03:08 |
|
Plus, you need to call glEnable(GL_TEXTURE_2D) separately for each texture unit you want to use (after glActiveTexture)
|
# ¿ Mar 31, 2009 10:51 |
|
Whilst farting I posted:Yes! This was it, thank you. steps is the number of line segments you use to approximate the curve - more steps means a smoother curve but more processing to calculate it. Vector p is just that - a vector. In this case, it's the next point to draw a line to (the pseudocode uses moveto and lineto but this can easily be replaced with GL_LINES or something if you just want a curve on the screen)
|
# ¿ Apr 26, 2010 11:50 |
|
Mata posted:Can triangle strips only ever be 1 triangle "tall"? For example this image I would describe as 1x4 triangles. What's the simplest way to instead draw 4x4 triangles? Should I use multiple index buffers on one vertex buffer? You can use degenerate triangles: by repeating vertices, you create invisible triangles that you can use to include a discontinuity in a single triangle strip (like a jump to a second layer) If it's supported, you can also use an index of -1 (0xffff or 0xffffffff) to do the same. This is called strip-cut index in D3D and the Primitive Restart extension in OGL.
|
# ¿ Jun 20, 2011 08:21 |
|
I haven't touched GPU stuff in a while, but I was under the impression that static branches based on global uniform variables will be optimized away by all modern compilers/drivers and never get executed on the GPU, so it wouldn't make a significant difference either way...? Best way to find out is benchmark both, I guess
|
# ¿ Nov 24, 2011 00:00 |
|
floor is lava posted:Playing around with pure opengl to do some 2d stuff coming from sdl. I'm using textured quads in an ortho view with the top left being 0,0. I'm having problems with clipping on the x and y axis. If a quad goes to the left or above the drawing area the image disappears. How do I deal with something like a sprites on the edges of the drawing area? How do I go about adding a buffer area so that the quads won't be considered invalid? That shouldn't happen unless you're using unsigned integers for the coordinates. Normally, negative coordinates and clipping "just work".
|
# ¿ Dec 4, 2012 18:46 |
|
|
# ¿ Apr 28, 2024 20:24 |
|
It works in OpenGL ES with GL_EXT_shader_framebuffer_fetch, not sure about desktop OpenGL.
|
# ¿ Nov 20, 2015 06:59 |