|
Kind of a vague question, sorry. Lets say I'm working on an outdoor first person game in OpenGL. I want a large view distance, so I'm assuming I'm going to be drawing very large, very simple geometry on the horizon, and small complicated geometry close up. For whatever reason, some way of cheating with a 2 pass skybox rendering method isn't going to work. What are the performance considerations of doing this? For instance, does it poo poo all over my z buffer precision if in the same scene I'm drawing a 4 poly pyramid on the horizon that's hundreds of units tall and doing detail work close up? Also in that kind of situation, what's an acceptable scale for our coordinates? Is it worth spending time worrying about whether making my map extents minfloat to maxfloat rather than something arbitrary like +- 1024.
|
# ¿ Oct 1, 2008 12:34 |
|
|
# ¿ Apr 26, 2024 05:38 |
|
Hubis posted:You're going to run into signficant z-buffer precision problems leading to Z-fighting for things that are near one another (within one exponential precision value from one another) unless they are drawn in strict back-to-front order, including sub-draw call triangle order. Thanks. That won't be a problem, the way my data's organised, nothing but simlar size polys at similar distances.
|
# ¿ Oct 1, 2008 23:58 |
|
Well, using TRIANGLE_STRIP or TRIANGLE_FAN each quad becomes 4 vertices, for a start.
|
# ¿ Jun 16, 2009 11:35 |
|
When I mentioned Triangle Strips I was explicitly talking about drawing one rectangle at a time, obviously they won't work over multiple rectangles because of the texturing thing. I was addressing the fact that the lack of quads led him to complain about using 6 vertices per quad, where a tri strip uses 4.
|
# ¿ Jun 17, 2009 07:36 |
|
You could docode:
HauntedRobot fucked around with this message at 10:11 on May 5, 2010 |
# ¿ May 5, 2010 10:01 |
|
Aigh, what in the hell. Having a fun time trying to ditch immediate mode, and having a hell of a time trying to draw 3 sides of a goddamn cube. Scene is basically set up so I'm looking at the cube corner-on. That means 7 vertices, 4 floats per vertex, elements are setup:code:
Shaders set up OK and do nothing much. Then in my rendering code (where vpos is the vertex position passed to the vertex shader as an attribute): code:
Edit: doing just the one DrawElements call with all 10 elements works, but then I am redrawing one of my triangles... Edit2: FIXED Indices is an offset in bytes, and a short is 2 bytes. That 4 should therefore be an 8. Always the simple things. HauntedRobot fucked around with this message at 15:06 on Jul 29, 2010 |
# ¿ Jul 29, 2010 14:22 |
|
Trying to enable multisampling in OpenGL and I'm missing something. I am using glew elsewhere, but I know that all this stuff has to be initialised before glew, so there's been no glewInit() yet. This is the (I think) minimal failing code in my window setup routine.code:
Edit: Answer - it's NOT crashing there, the debugger just can't cope with functions defined that way and skips a bit, crashing in a perfectly sensible place later. Carry on. HauntedRobot fucked around with this message at 16:11 on May 3, 2011 |
# ¿ May 3, 2011 15:46 |
|
Edit: Once again, stupid problem that had nothing to do with the code I posted.
HauntedRobot fucked around with this message at 14:37 on May 16, 2011 |
# ¿ May 16, 2011 12:18 |
|
It's also a problem of documentation. People have had years to write tutorials and examples for OpenGL 1.1 glBegin/glEnd stuff, the new stuff, not so much. I mean yeah, plenty of "here's how you get a triangle up on screen with VBOs" but it falls off in quality when you get beyond that, like how your approach would change if you had a list of triangle meshes, how you would handle camera stuff, etc etc. But it'll catch up.
|
# ¿ Jan 22, 2012 12:47 |
|
I have a world defined as a bunch of polygon meshes and I'm using VBOs at the moment to render them. Currently the setup iscode:
The thing with that is that the lighting is baked in and static, and I want to move on to dynamic lighting. Is there a way to accomplish that through loading the vbo -> *doing something where dynamic light values get added* -> DrawArrays? Or have I hit the limitation of rendering that way there? If so, where would I go next from there? Is the next thing to do it all in shaders or is there some kind of intermediate step? Something with a deferred lighting pass maybe? I've learnt a ton of stuff doing things this way that I'd sort of handwaved over before.
|
# ¿ Mar 26, 2012 11:37 |
|
|
# ¿ Apr 26, 2024 05:38 |
|
HiriseSoftware posted:If you want to still use VBOs with dynamic lighting instead of shaders, you could put the color values into another VBO and modify them each frame: Oh, that's a pretty good idea. Disentangling them from the other vertex info isn't ideal, but I already have a similar thing in the loader for generating a simplified collision mesh for the physics.
|
# ¿ Mar 26, 2012 16:09 |