Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualBornToCode

Posted 23 January 2013 - 01:50 PM

The way i have my component system set up is that i have a scene class which has a build in octree. Whenever you add an new GameObject to the Scene it gets added to the proper location in the octree. When i render i pass the camera to the Scene Render fuction. First thing it does is find which node in the Octree the camera is in. Once it find the node, it extract all the GameObjects from that node and child nodes into an array. Once i have a flat table of all the objects, I sort that table based on material/shader or anything else i want to sort it by. Then i render all Opaque Objects Front to Back, then render all Translucent Objects Back To front.


#1BornToCode

Posted 23 January 2013 - 01:48 PM

The way i have my component system set up is that i have a scene class which has a build in octree. Whenever you add an new GameObject to the Scene it gets added to the proper location in the octree. When i render i pass the camera to the Scene Render fuction. First thing it does is find which node in the Octree the camera is in. Once it find the node, it extract all the GameObjects from that node and child nodes into an array. Once i have a flat table of all the objects, then i sort them based on material/shaders. Then do another for loop that renders all of them.


PARTNERS