D.V.D
Make a wish
- Reaction score
- 73
So I was reading a PDF of the Cuda program for Nvidia Graphics Cards and when I was thinking about how to create my own graphics engine, I came across this problem. So in this case, let's say that im ray casting to find objects on a map that is 10km by 10km. If the smallest point on my map is 1 millimeter, that would result in the map being 10 000 00 00 0ml by 10 000 00 00 0ml. This would result in a ridiculously large 2d array of 1 000 000 000 000 000 000 mm square. So using a 2d array to store all objects on the map would result in terabytes of information which is largely impossible. So then came the problem, how would I find objects on my map? I could loop through every object on the map every time a ray moves to see if the object is hit by the ray but lets say you have a very detailed scene. For example, in Warcraft 3 you would have sometimes 10 000 to 100 000 doodads on a detailed map followed by a number of units that can also be from hundreds to thousands depending on the map. This however is warcraft 3, if your making a detailed map like this so for example skyrim, you can have millions of objects on the map and looping through each one of them for every ray would be far too slow. So my question is, are there any efficient ways of storing large amounts of objects on a large map while not going overboard in the number of operations done to find the objects using ray casting methods.