Merged low res texture for distant pages?

Falagard

09-11-2005 02:30:36

Tuan,

Quick question: I need a way to have a merged texture that is used for lower LOD pages using Ogre's built in material lod system, such that when a page is greater than X distance it switches to a merged texture which has all the splats baked into a single texture. I know there is/was functionality to do this merging in PLM2 somewhere, but one of my problems is that I may have custom pixel shaders to do my splatting that are different than yours, and may include things like a lightmap over the terrain.

The easiest way to do this merged texture, in my opinion, would be to create a quad that represents a page and apply the high-res material to it and then save out the rendered texture to disk.

Thoughts?

Clay

tuan kuranes

09-11-2005 07:57:03

yes there is a colormap genrator in mapsplitter, but not really finished, as it lacks scaling splatting textures... but that's not that much work, problem was that it would need some scaling algo that smooth correctly the result.

Yes, quad-texture generated splatting could be better as it would benefits from bilinear scale from GPU. So yes a run-time generated texture could be better.

But, as for batching, I'm thinking about a new texture mode, for distant texture, which is like BaseTexture (colors coming from splatting texture), but that would not need a particular texture, just a 1D texture for all distant pages, with one Texcoord generated by renderable.
Would be faster result, and not sure it wouldn't be too different at far distance than the "splatcolormap" texture.

Falagard

09-11-2005 10:44:00

Lost me there.

By distant I meant pretty close ;-)

As in, possible up to 4 pages would be fully rendered, and anything further would be using low res textures. At those distances, which are still pretty close, you would want to see more detail than a 1d texture would give you.

Take a look at http://www.larabie.net/ogre/LoTDemo-10-03-2005.zip for an example, using PLM2.

I created the merged texture there using Freeworld's built in merge functionality, including the shadowmap. Unfortunately Freeworld's merging stuff wasn't very good, so you can see the obvious transition from the pixel shaded splatting version to the merged version. I would expect it to be less evident if it were rendered to texture using the method I described instead.

Clay

tuan kuranes

09-11-2005 13:17:01

That needs some comparison tests.

Falagard

09-11-2005 20:45:52

What's there to compare? If I understand correctly a 1d texture would colour an entire page with a single colour?

tuan kuranes

10-11-2005 09:05:24

arggh ! no wonder you don't want comparison.

1d texture is a "color ramp" texture. the texcoord gives position in the ramp, which is a sort of gradient, in our case composed of color value coming from average color in splatting texture.

Idea is to get same results as all "basetexture" texture modes, but only with One texture for all distant page.

Falagard

12-11-2005 02:23:13

Ahh, gotcha. Would like to see that in action.

The other reason for doing a merged texture is for lower spec machines that don't support shaders. In this case I'd use the merged texture for the whole terrain with a detail texture.

Does your system work with those older machines? Also, would it look as good? :-)

tuan kuranes

12-11-2005 06:52:35

it works on older shader and should look like basetexture or basetexture2.