G33X Nexus Entertainment

G33X Nexus Entertainment => Requiem for Innocence => Current Projects => Precursors => Topic started by: Recon on November 11, 2006, 07:14:35 am

Title: A possible solution to our scale issue
Post by: Recon 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   
Title: Re: A possible solution to our scale issue
Post by: contingencyplan 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. :)
Title: Re: A possible solution to our scale issue
Post by: Morgul 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.
Title: Re: A possible solution to our scale issue
Post by: whitelynx 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. ;)
Title: Re: A possible solution to our scale issue
Post by: Recon on November 23, 2006, 09:31:22 am