MegaTexture

Thomahawk

Newcomer
John Carmack has said that smart programmers should be able to figure out and implement his MegaTexture algorithm just from what he's said in interviews.

I'm still kind of confused at how MegaTexture solves any problem. So you can collect all your textures in one giant collage - obviously there must be more to it? He points to multitexturing with a repeated "detail" texture and a non-repeated "unique" texture and says that's just a method of compression. But then I don't see what he does that's better than that?

Has anyone made any interesting conjectures?
 
People already reversed engineered Megatexture.

Implemented the PS in doom3
http://www.gamedev.no/doom3mega.jsp
Doom 3 Megatexture technology is more a proof of concept than anything else.
  • Any disk reads will stall the game loop.
  • Create and render Megatextures up to 16384x16384.

A standalone demo more similar to the Quake Wars implementation
http://www.gamedev.no/megatexture.jsp
Final version of the Megatexture Renderer was done in mid October.

Topic on doom3word about the doom3 mod
http://www.doom3world.org/phpbb2/viewtopic.php?t=17912

Mod
http://doom3.filefront.com/file/Megatexture_Technology_Mod;72779
Showcases John Carmack's early version of the Megatexture technology
which lies hidden in the Doom 3 engine based games. It serves as a
proof of concept.
* Create and Render Megatextures up to size 16384x16384.
* Disk reads is synchronous.
 
Last edited by a moderator:
If I recall correctly all Carmack talked about MegaTexture in some interviews were "a really big texture (20,000x20,000)" and "let hardware manufacturer do it". The main purpose of MegaTexture is to provide terrain details and avoid repetitive tiling artifact, I guess?

I fail to see anything interesting in MegaTexture, which certainly doesn't bring anything new to table. At the moment, using a MegaTexture in a video game is just like the way an artist texturing a big terrain - blending a huge, unique color gradient texture with a few gray scale detail textures at different scales, at most throwing in some simple texture synthesis techs like wang tiles for less artifacts. All same old same old stuffs. Even if the hardware manufacturer could support such a huge texture directly, I don't believe there will be any artist likely to paint a 20,000x20,000 texture manually.
 
I fail to see anything interesting in MegaTexture, which certainly doesn't bring anything new to table.

Try to render a terrain with a 32K by 32K unique texture in realtime. You might find more than a couple of problems.
That's unless your graphic card has 6GB of ram!
 
On the creation side it's most likely procedural texturing editable by the artist.
On the rendering side it's most likely close to virtual texturing, streaming content to textures as they are needed in a compressed form and decompressed in the pixel shader.
I'm quite curious to know the algo used to compress a 32k*32k texture into something manageable (on disk and in RAM)...

[edit]
Forgot I already had checked it, it's using DCT & BCT for compression along with S3TC.
 
The main purpose of MegaTexture is to provide terrain details and avoid repetitive tiling artifact, I guess?

At the moment, using a MegaTexture in a video game is just like the way an artist texturing a big terrain - blending a huge, unique color gradient texture with a few gray scale detail textures at different scales, at most throwing in some simple texture synthesis techs like wang tiles for less artifacts. All same old same old stuffs.

I fail to see why people still think that MT is just some form of blending or something and can't wrap their head around the fact that it's a totally unique texture. It's not just throwing a detail texture on. It's not just a special tiling mechanism. It's a texture that you can simply draw on arbitrarily, just like a texture for a character or prop, while at the same time, maintaining a resolution (or rather, texel 'density') comparable to a character/prop, and for a very large terrain.
 
I fail to see why people still think that MT is just some form of blending or something and can't wrap their head around the fact that it's a totally unique texture. It's not just throwing a detail texture on. It's not just a special tiling mechanism. It's a texture that you can simply draw on arbitrarily, just like a texture for a character or prop, while at the same time, maintaining a resolution (or rather, texel 'density') comparable to a character/prop, and for a very large terrain.

So how to draw a huge texture? By hand? I doubt any artist would like to draw that huge texture by hand. Not everyone in the industry can work in the mode "it's done when it's done". At the end they will employ some tools like fractal generator or texture sythesis algorithms. That's still a bunch of procedure textures, detail maps and special tiling mechanism. The best thing you can get out of MegaTexture is some precomputed patterns. Does that produce far better result than blending a color map with a set of detail textures? And worthy of putting tredemous effort to maintain such a huge data block in memory then use shader program to uncompress it dynamicly? I don't think so.
 
So how to draw a huge texture? By hand? I doubt any artist would like to draw that huge texture by hand. Not everyone in the industry can work in the mode "it's done when it's done". At the end they will employ some tools like fractal generator or texture sythesis algorithms. That's still a bunch of procedure textures, detail maps and special tiling mechanism. The best thing you can get out of MegaTexture is some precomputed patterns. Does that produce far better result than blending a color map with a set of detail textures? And worthy of putting tredemous effort to maintain such a huge data block in memory then use shader program to uncompress it dynamicly? I don't think so.

I think the original intent was to generate the entire thing procedurally and have the artists go in to tweak it so it doesn't look repetitive... Judging from the maps they've shown thus far, it seems to be working quite well as far as uniqueness goes.

hmm.... I just recalled this interview with Carmack:

[FONT=Verdana, Arial, Helvetica, sans-serif][FONT=arial,helvetica,sans-serif]So when Splash Damage was starting on, really early with Enemy Territory: QUAKE Wars, they were looking at some of these different ways to render the outdoor scenes with different blends and things like that. And one of my early suggestions to them was that they consider looking at an approach where you just use one monumentally large texture, and that turned out to be 32,000 by 32,000. And I – rather then doing it by the conventional way that you would approach something like this (i.e. – chopping up the geometry into different pieces and mapping different textures on to there and incrementally swapping them for low res versus high res versions), just let them treat one uniform geometry mesh and have this effectively unbounded texture side on there, and use a more complicated fragment program to go ahead and pick out exactly what should be on there, just as if the graphics hardware and the system really did support such a huge texture.

In the end what this winds up getting us is the ability to create a great outdoor terrain texture that has far more complex interactions than anything that you would get with any kind of conventional rendering, where you’ve built it up out of pieces of lots of smaller textures on there, where they do some sophisticated things with growing grass up between bump maps. And then you can go back and do hand touch ups in a lot of different places to accent around features that are coming out of the surface. And this type of thing is, I’m very sure, going to become critically importance as we go forward into kind of next generation technologies on there. We’ve seen this over and over as we’ve gone through graphical technology improvements over the years, where there will be certain key elements that you start looking at in games that look really dated because they don’t have the capabilities that people are seeing in sort of the cutting edge things there. And this type of unique texturing over the coming generation of games, I think, is going to be one of those, where when people start looking back at a game that’s predominantly piled and doesn’t have that unique artist touched sense about all of the scenes, it’s going to look very previous generation.
[/FONT][/FONT]
 
Last edited by a moderator:
I believe it was said that the megatexture is initially created using fairly generic tiled texures like any old terrain, and can then be changed however the artist wants.
 
The best thing you can get out of MegaTexture is some precomputed patterns. Does that produce far better result than blending a color map with a set of detail textures? And worthy of putting tredemous effort to maintain such a huge data block in memory then use shader program to uncompress it dynamicly? I don't think so.
The idea is that you can use simple repeating patterns, but you're not limited to them; you can use as sophisticated a procedure as you like. In this grab Gabrobot took from that Nvidia movie, you can see that the megagen uses the angle of incline to produce small, high-contrast details that you wouldn't get from a big blotchy colour map. And you could go further than that. In theory, you could generate terrain textures by simulating uplift and erosion.
 
If the megatexture is just one big flat square texture, then how does it cope with steep sides of terrain without stretching artifacts?
 
If the megatexture is just one big flat square texture, then how does it cope with steep sides of terrain without stretching artifacts?


IIRC it has problems with harsh slopes. Artists can probably lesser them a bit playing with the texture coordinates, but it's just an hack.
 
Distributing texture coordinates properly is a hack?

Not in general terms but it becomes a hack when it is the only was to lessen a problem (not solve it). in fact in the Quake Wars version of the technology[FONT=Verdana, Arial, Helvetica, sans-serif][FONT=arial,helvetica,sans-serif] there are some issues with deforming the texture coordinates too much as you'll still get areas that are much more blurred than what you'd get with normal texturing.[/FONT][/FONT]
 
Not in general terms but it becomes a hack when it is the only was to lessen a problem (not solve it).
In my experience, "hacks" have solved problems too. I think what you're talking about is the seriousness of the "problem".

in fact in the Quake Wars version of the technology[FONT=Verdana, Arial, Helvetica, sans-serif][FONT=arial,helvetica,sans-serif] there are some issues with deforming the texture coordinates too much as you'll still get areas that are much more blurred than what you'd get with normal texturing.[/FONT][/FONT]
"Problem" "solved" or "lessened" (sorry for the quaotation marks) or whatever you choose to describe it.
 
*clip mapping is bad because it breaks up the texture in smaller bits*.Megatexture on the ohter hand doesn't concern itslef with all these convuluted steps - the method places its trust in the graphics API and the hardware.
atomic magazine issue 67 PAGE 22

So the mega texture is just one big texture now???
 
atomic magazine issue 67 PAGE 22

So the mega texture is just one big texture now???

Well, AFAIK, it appears to be one from the outside of the pixel shader (in which the "virtualization" supposedly takes place), since the technique makes use of the fact that newer GPUs have a texture coordinate range of 32K (even though there's obviously not enough vram for a 2D texture that big).
 
Back
Top