Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

135 Neutral

About Ansharus

  • Rank
  1. Ok, sounds like a good way of doing it. Basically it boils down to roughly weighting your different sorting criteria by what would give you the best performance boost?
  2. A while ago, I asked a question about how to properly organize your render loop (http://www.gamedev.net/topic/659636-good-render-loop-organization-resources). Haegarr gave me some good advice about doing visibility culling and about putting specific render jobs for (among others) opaque and non-opaque objects in separate render lists. In those rare moments that I do find time to work on my own projects, I have already implemented a basic octree implementation for visibility culling, but I am now faced with the problem of sorting my render lists. As I understand, one would want to sort an opaque object render list from front to back, in order to trigger early z rejection, but I was wondering how you could combine this front-to-back sorting with sorting objects to minimize resource switching. Correct me if I'm wrong, but either you sort objects by their distance to the camera, or you do it by some other criteria, but you can't do both right?  
  3. Ansharus

    BSP trees with modern OpenGL

    I've been working as a programmer for several years now, so I know my way around a programming language or two. I've been doing some basic stuff with OpenGL (I worked for a company using OpenGL for their 3D cartographic applications), but as you can all probably tell, I've still got a lot to learn. This FPS I'm developing for the moment is more of a stepping stone to get myself acquainted with game programming. The environments I'm creating contains mostly simple convex shapes (although their poly count can get a bit high at times).  From L. Spiro's comments I've deduced that using BSP trees may be a bit overkill for the purposes I have in mind. I'm also not so thrilled about cutting into my existing polygons or in other ways complicate the geometry of my scene, so I think I'll just take L. Spiro's advice and go with a render queue implementation that does some basic sorting of my objects. Anyway, thanks for all the help. It's nice to know that there is a large community to fall back on  .
  4. Ansharus

    BSP trees with modern OpenGL

    What I'm getting from the comments so far is that BSP trees do have their use when I want to draw everything in the correct order. Whenever I look up BSP trees, everyone is talking about planes, and I do understand how I can divide up my space if my objects are just regular planes. But let's expand on Erik's example here. What if instead of a blue plane and orange plane, I had a blue and orange box, or better yet a blue and orange teapot. How do i create a BSP tree for something like this? Do I define a bounding box for each item and use the bounding box' planes for creating my BSP tree, or is there some other accepted way of doing this? I know my questions are touching on some really basic stuff here, but I can't seem to find a straightforward answer to this. Some real life example of a scene containing some 3D objects that is partitioned step by step into a BSP tree would seriously come in handy.
  5. Ansharus

    BSP trees with modern OpenGL

    Thanks, sounds easy enough. I'll try to avoid using concave translucent objects for now and just focus on getting everything working with a simple back to front ordering mechanism based on the distance to the camera.
  6. Ansharus

    BSP trees with modern OpenGL

      Ok, so basically: Just take your translucent (sub)meshes, order them back to front and render then in that order. But exactly how do I correctly order them back to front in a reliable manner if BSP trees can't be used? I've read on or two books on OpenGL and game engine development, but some basic concepts about scene management, rendering phases or other practical approaches for rendering a complete scene always seem to be missing.Can anyone point me to any good resources that tackle these problems specifically? 
  7. I've been working on making my own OpenGL rendering engine for first-person based game. For simplicity's sake, let's assume I'm rendering a large static scene which contains both opaque and transparent objects. From what I understand, I have to sort my transparent objects back to front in order for them to be rendered correctly. If I heard correctly, BSP trees are the way to do this as long as my scene is static. However, BSp trees seem to sort the individual polygons in my scene, rather than the individual objects. Is this correct? If not, how do I get the correct "object order" for objects in my scene.   I have only constructed a basic rendering loop in which I store all my geometry in one large VBO, which I then draw in one go using indexed drawing. How would I be able to tell OpenGl in which order it should render the individual polygons, without having to buffer my vertex/index data over and over again? If anyone could shed some light on this, or point me in the direction of some good examples using modern OpenGL, I would be forever in your debt ;-).
  8. Thanks a million for your answer! It finally gave me the (high level) insight I was looking for. Rendering a single model was pretty straightforward, but I was looking for some good overview of how the rendering process should be divided up. Reading about them in Game coding complete made me think they were the industry's answer to efficiently organize your objects that need to be rendered. After I posted my question, I came across various other resources discussing scene graphs: Scene graphs - Just say no http://gamedev.stackexchange.com/a/8281   Like you said: They are not the answer to everything. I'm going to try and implement my rendering process the way you described: 1. Perform visibility checks on objects to be rendered 2. Divide visible items in specific render batches based on their main characteristics (e.g. opaque - transparant) 3. Perform sorting of those lists to minimize render time, e.g. by minimizing state changes between draws 4. Perform the drawing   Again, thanks a lot. I'll have a lot of coding to do this weekend 
  9. Hello everyone,   I am currently working on a prototype version of an OpenGL based Android game (using Java, not the NDK). I already got the basics down: Loading VBO's with my vertex data (positions, normals, texture coordinates, colors), binding to uniforms, etc. Basically, I'm able to render multiple models with transformations and lighting applied.   However, I am a bit concerned about the efficiency of my render loop, since it's all of my own design. Most of the resources out there teach you the basics: How to load your models, use, shaders, ... but they never go into the topic of actually organizing you rendering process. In particular: in which order should I bind my objects, how to chain transformation matrices properly, ...   I've been reading "Game Coding Complete" in which they describe a way of rendering your scene by using a render tree, chaining transformation matrices as you move down the tree. All of it is written for DirectX, but I think I can apply most of it to my OpenGL render loop as well. I was just wondering if anyone knows of some other good resources that could teach me more about implementing a decent medium/high-performance render loop for OpenGL. I'm especially interested in any resources that would teach my how to organize my models efficiently, which types of render passes I should use, any way of sorting my models from front to back efficiently, how to chain my transformation matrices efficiently, etc.   Any help would be greatly appreciated. Thanks in advance!
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!