I need some programming support...
I'm implementing a terrain renderer. I'm using OpenGL on the PC side but I'm going PVR-only on the dreamcast. The terrain LOD system is mostly done... And now I'm trying to figure out how to properly texture this thing. I have like 4 different textures (the basic gras, rock, dirt, snow stuff) in mind which need blending (kinda slope based not just height based).
As far as I get it, you have to carefully sort your triangles in opaque or transparent lists. Once your are done with one you can only add stuff to the other one - or implement some kind of a buffer and save it for later. My terrain is rebuilt every frame (SOAR-algorithm based) so this is kinda difficult to manage. So the best way would be to render only opaque polygons as terrain polys. As the dreamcast doesn't have multitexture units I was thinking of two options here
1) pre-bake all textures and stream them from the cd-drive, like virtual-texturing
- I've read somewhere that one can expect 350-450kb/s from the cd drive, so that's not an option
2) generate texture-tiles on-the-fly by blending all the needed textures together, maybe also light-map them and then render them to a texture atlas
so I'm investigating option 2) here
I think I have a possible solution, but I'm stuck at the following:
as I understand it, it's only possible to render to a texture which is bigger then the screen size. so for 640x480 the texture should be 1024x512. that's bad the memory is already very limited.
Is it only a implementation issue in KOS? or is it possible to render something in to a 128x128,256x256,512x512 texture regardless of the renderer screen size? setting the perspective+projective matrix maybe?
Is it possible to render something to an exact part of the texture?
like I want to render in to block A here:
Code: Select all
0---------128---------512
| | |
| | |
| | |
-------------------------
| | |
| | A |
| | |
| | |
-------------------------