breakin

Member

16

158 Neutral

• Rank
Member
1. BSP Tree , how to create and render?

I'm going to suggest a book. http://realtimecollisiondetection.net/books/rtcd/ It deals with many structures that are needed in collision detection. It might be nice since it is written for people who wants to do collision detection (rather than say occlusion culling). After reading the book you might decide to use Octree, BVH or something other. Perhaps you decide not to do it yourself and use a existing library instead. There is also a list of all papers referenced from the book. If you don't want to borrow/buy it, perhaps you can find something in there! http://realtimecollisiondetection.net/books/rtcd/references/index.html
2. BSP Tree , how to create and render?

BSP-trees are not used that much anymore due to the fact that they operate on triangles and not on objects. Today is often better to just draw an object, rather than to spend time on determining what triangles are visible are what are not. Z-buffer makes back-2-front-rendering obsolete. Ordering draws front-2-back is better with Z-buffer since then most pixels are only rendered once. For collision purposes I think that loose-octrees or octrees or any other structure than BSP-trees is the best! BSP-trees are hard to update when things move and it is hard to get rid of all numerical problems. That said, I think BSP-trees are really cool, they just don't make that much sense nymore.
3. When deriving tangent space vectors for bump mapping.

Hm one more point though. It is often true that TxB=N but in case the winding of the triangle in UV-space is different form the winding in worldspace, it should be TxB=-N You must calculate both tangent and bitangent. You could do calculate T,B calculate N calculate TxB calculate f=(TxB) dot N sign = f>0 and store N,T,f (just one bit!). Then you can flip the sign of B based on f. Where t store that one bit is another matter, not sure what is best ;)
4. When deriving tangent space vectors for bump mapping.

Hi! I think the main problem is that you don't calculate the tangent vector at all, but something else. I really like the derivation of how to calculate tangent/bitangent-vectors found at http://www.terathon.com/code/tangent.html . There is also source code for how to do it! Hope this helps!
5. Unprojecting: 1000 questions, 0 answers

Hey. Let me answer another question instead. Easiest way to do picking is often this: * Render object-ID/triangle-ID in 16x16 pixels around the pixel where the mouse cursor is. You can do frustum culling vs this small rectangle so most objects are rejected. * Read back to CPU and check. Fairly fast for small framebuffers. Hard part is precision, but if you set up your ID's correctly you can obtain back the ID correctly on the CPU. If you don't have precision to have a unique ID for each triangle in the scene, consider: A) first determine object-ID and then polygon-ID within that object using two passes. B) write two integers (perhaps using multiple render targets). Object-ID in the first one and polygon-ID in the second one. Why is this easier? You can reuse your renderingversion of your object. No need for collision friendly versions at all. If you want to know where in the triangle you are picking, you have to do ray<>triangle-intersection, but that is easier than doing ray<>scene-intersection. I guess you could do the same thing to get a small zbuffer using shaders and storing depth encoded as colors somehow (just as you store int as colors in the approach outlined above), but then you still have to find where that point is in your scene (ie on what triangle).
6. Help on Exponents

Is that (2*3)^n - ( 3^(n+2) / 3^(n+1) ) or ( (2*3)^n - 3^(n+2) ) / 3^(n+1) or something else ?
7. Getting started with coding an Adventure game.

Unless there is really really much content, perhaps XNA is a good platform. Since you've already mentioned DirectX and Visual Studio, I'm assuming that Windows only is fine with you. Using XNA you get access to Xbox 360 as well, and can use the digital distribution channel there. You could of course first make the game and try getting a publisher interested, might be easier to prove yourself by making one game yourself though and publish it yourself. Might make a buck or two that way as well...

In the vertex shader, the coordinate that was set using glVertex3f (or perhaps put in some kind of buffer) can be found using gl_Vertex. I'm guessing you are using gl_Position = ftransform() but that functions is mostly equivalent to gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; (read more at http://www.lighthouse3d.com/opengl/glsl/index.php?minimal). If this is indeed what you do, that mean that (in the vertex shader) vec4 viewSpacePosition = gö_ModelViewMatrix * gl_Vertex; will give you the view space position of the vertex. To get the world space position, you have to work some more (then you can't use the MODELVIEW matrix alone). Hope this helps, feel free to post more questions on my confusing answer!
9. Lighting

Quote:Original post by kaiser83 isn't per pixel lighting supposed to be a better solution to lightmaps? as far as i understand it was a technique used long ago and has been phased out? No. They just solve different problems. Quote:Original post by kaiser83 in any case my main problem is that the lighting is too dark in some areas and blindingly bright in others (depends on how the camera is facing) If you only use diffuse lighting then lighting shouldn't change as you move the camera. If it does, it's a bug. That is a good way to test that you do all your calculations in a good way.

11. Am I to old to start?

Hi! I think the real question is if it's too late to start programming at 28. I think not. One does not have to be as hardcore as some years ago. Today it's easier than ever to make a game. Maybe start by hello world and then not too much later you're doing a XBLA-game (Xbox Live Arvade, xbox-360 distribution channels for homebrew games) using XNA. Then it's down to good ideas and your ability to work in a team. This you might already have experience with! To make a triple-A game in C++ is another matter but if you want to go there as well, you can. But just do whatever is fun and possible and work from there! Remember; Small teams means more fun. And that often means smaller games!
12. Occlusion Query speed troubles

I'm not sure about the exact timings, the recommandation seems to wait at least 2-3 frames for the results (depending on double or triple buffering). The card is supposed to buffer for the coming X frames but if you wait for results that goes out the window since the previous frames needs to be fully completed before you can start with the next one. They are mostly used conservatively to determine things for an time interval. Like is the (swept) bounding box of this object visible? Ie will it become visible in 2-3 frames or can I keep not drawing it, etc... On some consoles it can be much faster though (or so I've heard!)!
13. OpenGL3.0.. I mean 2.2

Quote:Original post by V-man What "stability benchmarks"? Where are they? Oh forgot about the benchmark. ATM I guess there are none, but someone (this could be a guy/girl at Nvidia/ATI/Intel internally, or someone else for all to use) probably could do a better job testing the non-deprecated subset than all of OpenGL. For instance Khronos could create a test-suite with reference images. Or perhaps some reference rasterizer or something. Point is that the subset to test would be smaller, if they only wanted to please game developers and all of those could jump on the 3.0 train. Problem here is older card that now won't support OpenGL3 so I'm guessning not nearly as many as supposed to can jump.