Author Topic: A possible solution to our scale issue  (Read 3461 times)

Offline Recon

  • Lieutenant
  • ***
  • Posts: 60
  • Karma: +1/-0
    • View Profile
A possible solution to our scale issue
« on: November 11, 2006, 07:14:35 am »

well, I have been trying to work out how to get large objects and small objects on the screen at the same time. we where discussing splatting images of far objects on the skybox. but after thinking about this I spotted several large issues with this approach. these where

Generating the image, as the planets will be rotating the image would have to be generated again and again so it would present the correct face to the camera

lighting would affect how that face appeared, and would also have to be calculated 

these seemed like big coding issues that would require lots of work
then i had an idea,

If we could create 2 sectors, one for the solar system with a large scale (1 unit CS = 30,000km) and then a small scale sector ( 1 unit = 10cm ). now if we could get CS to render the large scale sector first, then render the small scale sector over it we would have both scales on screen looking right with minimal coding. Now we would have to do a bit of trickery to move objects out of the large scale sector to the small scale sector as the got close but this seem easy compared to skybox issues we would have to solve.

Anyway, I had a quick talk with thebolt on irc and he seemed to think it was possible. So I plan to look into this over the next while to see if I can figure out a way to get the two sectors rendering on top of each other.

Any comments welcome   

Offline contingencyplan

  • Villain
  • Ivory-Tower Theorist
  • Admiral
  • *****
  • Posts: 977
  • Karma: +1/-0
  • Must I sin once, and repent forever?
    • View Profile
    • My Blog
Re: A possible solution to our scale issue
« Reply #1 on: November 11, 2006, 12:49:45 pm »
Well, I'm gaining a better understanding for CrystalSpace through my graphics class, but I'm still nowhere near an expert. whitelynx would have a better idea. From my perspective, it seems like that would work - run with it and see where it takes you. If it works, great, if it doesn't, no harm. :)
We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true. 
    ~Robert Wilensky

It is not bigotry to be certain we are right; but it is bigotry to be unable to imagine how we might possibly have gone wrong.
    ~GK Chesterton

Men never do evil so completely and cheerfully as when they do it from a religious conviction.
    ~Blaise Pascal

Offline Morgul

  • GNE Founder
  • Godlike Fuzzy Dice
  • Grand Admiral
  • **********
  • Posts: 2086
  • Karma: +21/-4
  • Godlike Fuzzy Dice
    • View Profile
    • G33X Nexus Entertainment
Re: A possible solution to our scale issue
« Reply #2 on: November 12, 2006, 06:46:26 pm »
From what I understand, we would be doing a 'render to texture' for the objects, which would automatically take lighting into account, and all we would need to do is do a render to texture every frame, and it would always update the texture correctly.
"Just because my math may tell lies doesn't mean that I don't understand the quantum mechanics of it all." --Caenus

The popular videogame "Doom" is based loosely around the time Satan borrowed two bucks from Vin Diesel and forgot to pay him back.

"In the beginning there was nothing. And it exploded." --Terry Pratchett

Offline whitelynx

  • GNE Founder
  • Head Code Monkey
  • Commodore
  • *****
  • Posts: 304
  • Karma: +4/-0
  • Internet Idiocy Pundit
    • View Profile
Re: A possible solution to our scale issue
« Reply #3 on: November 13, 2006, 06:15:20 pm »
well, I have been trying to work out how to get large objects and small objects on the screen at the same time. we where discussing splatting images of far objects on the skybox. but after thinking about this I spotted several large issues with this approach. these where

Generating the image, as the planets will be rotating the image would have to be generated again and again so it would present the correct face to the camera

lighting would affect how that face appeared, and would also have to be calculated 

these seemed like big coding issues that would require lots of work
then i had an idea,

If we could create 2 sectors, one for the solar system with a large scale (1 unit CS = 30,000km) and then a small scale sector ( 1 unit = 10cm ). now if we could get CS to render the large scale sector first, then render the small scale sector over it we would have both scales on screen looking right with minimal coding. Now we would have to do a bit of trickery to move objects out of the large scale sector to the small scale sector as the got close but this seem easy compared to skybox issues we would have to solve.
Actually, this is closer to what I originally had in mind... the splatting thing was something you mentioned, and I didn't see a problem with it at the time. ;)

How about this... do 2 sectors as you say, but make the large-scale one the skybox. Simply make it camera-centered, and have it render with "sky" priority. (so it renders behind everything else) Everything in the skybox sector should be rendered as billboard impostors instead of rendering the whole model each time, to save poly counts. (otherwise we'd be rendering tons of polys every frame) I'm not sure how far along CS's LOD impostors are yet, but you can ask in the CS channel... basically what we'd need to do is render each object to a texture (the "impostor") and render that as a billboard in place of the actual object when rendering the skybox. Then, we wouldn't put anything in the skybox that would fit in the solar system's sector, and we can even move the contents of the skybox sector around a bit if you get too far to one side of the solar system's sector.

I'm not sure how clearly I'm explaining this... feel free to ask me to rephrase. ;)
"Without music, life is a mistake, a trial, an exile."
 - Nietzsche

Offline Recon

  • Lieutenant
  • ***
  • Posts: 60
  • Karma: +1/-0
    • View Profile
Re: A possible solution to our scale issue
« Reply #4 on: November 23, 2006, 09:31:22 am »
« Last Edit: November 23, 2006, 09:35:25 am by Recon »