Quake4 Relief Mapping

This mod only works in Ultra Quality mode. For now my normal2depth tool only process the TGA files (not the DDS ones). Ultra Quality loads the TGA files while all other quality modes uses the DDS ones.

So if you do not set Ultra Quality mode you will be loading the DDS files without any depth information included (all depth values will be 1.0 so you get no displace at all).

And Doom3/Quake4 renders a single light per pass repeating relief mapping calculations for a polygon as many times as there are lights illuminating it.

Nice work, Fabio. This stuff is looking scary.

OK made a quick video. Stills do not capture all the effect… the correct parallax is much more evident when you move around.
Nice… mostly.

It’s slowly becoming evident to me that these kinds of height-texture effects are never going to work 100%. And, because of the subtlety of the detail, when the approximation breaks down, it creates a sense of… strangeness about the object. If they can’t get everything 100% right, then the user will occassionally get the feeling that the world is somewhat strange. The average user may not be able to tell what is strange about the world, but they will definately know that something isn’t real.

And when you’re getting pretty close to high-detailed reality, having something being off absolutely destroys the illusion.

It’s a nice effect, but I’m would almost say that the effect falls into the space between clearly unreal and clearly real. And in the middle of that space is the uncanny valley , which is a place where I believe this effect falls. It’s very nearly real, but certain views of the environment cause it to break down (edge-on views, how shadows from other objects play on it, etc). Whereas a flat texture is considered really “broken” from reality (and therefore the imagination can infer what the texture is trying to convey), this relief mapping effect is mostly right, but sometimes provokes a sense of wrongness that is difficult to put one’s finger on.

Another way of saying it is that it looks too good when it’s working right such that when it’s reaching the edge of the approximation, it looks very wrong by comparison. The totality of the world now feels very inconsistent, because what looked nearly real before now seems quite wrong.

don’t forget that the d3/q4 game textures weren’t designed for use with that technique.
btw what’s the advantage over parallax mapping?

I know some people who fit in the uncanny valley.

Originally posted by Vexator:
don’t forget that the d3/q4 game textures weren’t designed for use with that technique.
btw what’s the advantage over parallax mapping?

It’s much preciser. Parallax Mapping works only on very few textures convincingly, such as brick walls. On almost every other kind of texture it looks quite bad. Also Parallax Mapping can’t handle such fine detail and on “steps” inside the texture the step-edge becomes very apparent because of the distortion.

About the “too real and too unreal” issue:
I think it looks great. Yes, there are certainly cases, where you still can see, that it doesn’t work absolutely real. But at least in computer games i don’t think this is a problem. Computer games have never been consistent in any way. It has always been like that, that new technologies or methods were developed, that made some part of the game look more realistic. But some parts have always been less realistic.
And even if everything seems to LOOK right, you usually pretty fast get the impression that it still FEELS wrong, because of humble animations, unsuitable speech/audio, bad AI or whatever.

It is ONE piece that can be improved. But games will always feel wrong in some kind. I don’t bother if it still feels wrong but at least looks better :smiley:

Jan.

I liked the definition of Uncanny Valley… interesting notion and I believe it is somewhat true.

But I think that art carefully made thinking about the limitations of this and other related pixel based displacement mapping techniques can achieve a good result. Look at the new Toy Shop demo from ATI they use something similar and fits well into the demo (although they use a much too simple depth map with rounded edge rocks for avoiding artifacts).

Also sampling step could be dynamic so that at steep angles more samples are taken. This could replace depth bias making the resulting image more ‘real’ as Korval says. This can be done with shader branching support available in pixel shader 3.0 for example.

Originally posted by dorbie:
I know some people who fit in the uncanny valley.
That’s the most insightful thing I’ve heard anyone say in a long time.
Seriously.
It’s sort of like the effect of falling in love with someone, going on picnics, boat trips, then…as the sun sets over a yellow meddow, she says [edit]something racist[/edit]

Yeah, there’s no escaping the on-edge flatness, but it’s well worth that small price. I’ve been playing with this technique for some time now and it can indeed work extremely well with the right textures. I’m blown away just looking at these screens… haven’t even tried the game yet (don’t really need to).

We’re all fairly accustomed to some artifacts in games. I don’t really see that as a show-stopper… necessary evil, perhaps, but not a show-stopper.

Uncanny valley is human-human thing, is it not? I don’t get that sensation when looking at a wall, for example. But human-like animations can be a bit disturbing if close, but not quite close enough.

@fpo
would you write a glsl version of your relief mapping shader? i’d like to understand how it worls and want to test it with my own models/textures… just don’t come along with those low-level shaders :stuck_out_tongue:

But I think that art carefully made thinking about the limitations of this and other related pixel based displacement mapping techniques can achieve a good result.
Certainly decisions on what to make displaced and what to make geometry could be made better to achieve a less jarring effect. But one of my main subconscious visual concerns is with shadows from external objects. The relief mapping approach simply doesn’t handle it at all under stencil shadows. It might be able to operate under depth shadows, though it would add a level of complexity to the algorithm.

And the artifact in this case is very subtle and noticable with even a slight raised floor/wall outcropping. It’s the kind of thing that a graphics programmer/artist would notice as the breakdown of an effect, but would be registerred as a non-descript oddity by the average person. It’s the kind of thing that falls into the uncanny valley for most people, where the world is slightly “off” in a way that they aren’t able to detect. And because it isn’t obvious, it gives a very uneasy feeling about the world.

We’re all fairly accustomed to some artifacts in games. I don’t really see that as a show-stopper… necessary evil, perhaps, but not a show-stopper.
Well, if you make a game that visually falls into the uncanny valley, it’s graphics will be considered worse than more abstract graphics, even if you’re modelling 80% of reality when the abstract one is only getting 40% or so. Visually, artistically, you always want to operate on one side of the valley or the other; you never want to fall into it.

Now, it may not be this particular visual effect that pushes us over into the uncanny valley (though clearly, this one needs to be massaged properly in terms of art lest its subtle artifacts cause problems). But I definately think we’re visually approaching a point where we’re going to start falling into the gap if we’re not cognizant of it.

Uncanny valley is human-human thing, is it not?
Not necessarily. That’s what the article was talking about (as it was born out of robots and androids and such), but once you start applying it to Cg, it can be applied to terrain. Granted, because people know people better than rocks, the problems are going to show up more with modelling and rendering people, but the theory is relatively sound applying it to non-humans.

I suppose this is a valid point, but only valid if realtime graphics were anywhere near photorealistic. They’re not, they’re all full of artefacts, whether it’s hard edged shadows, aliasing, pixelation from shadow maps, environment mapping approximations…the list is endless, and will be for the forseable future. So, if there are so many artefacts already, why do you think this point is relevant to relief mapping particularly?

Just one note on shadows… supporting correct displaced shadow volumes is easy, all you need to do is update the depth buffer adding the displace before you do stencil shadows (check it out on my papers including that).

The problem is that Doom3/Quake4 can not do it as it would require relief mapping to happen when it is doing the depth only pass (to get the displaced depth buffer).

So in a custom made engine (specially using deferred shading) it would work fine with stencil or shadow maps… so you can have correct displaced shadows with hard edges if you want (and it does not add a lot to the shader just a few more instructions in order to output depth value).

surely when the ability to create vertices on the card comes than all this(Relief Mapping) will be rendered obsolete?
im not knocking this technique i believe its brilliant

They’re not, they’re all full of artefacts, whether it’s hard edged shadows, aliasing, pixelation from shadow maps, environment mapping approximations…the list is endless, and will be for the forseable future.
That’s a graphics programmer talking, not someone viewing an image. Graphics programmers are trained to break down an image into its fundamental “effects” as well as recognize artifacts on a conscious level. Most normal people are not. They don’t understand any of these concepts. They simply see an image that is “near” reality, but off in a way that they are not able to fully describe.

So, if there are so many artefacts already, why do you think this point is relevant to relief mapping particularly?
As FPO pointed out, it could just be bad source data, but it’s the way that the effect looks so good, but right next to a perfectly viable detailed surface can be an artifact. Like, you see a surface as being clearly rough, but change your perspective (or look down a hallway), and you can see that the surface is really just flat and some kind of trick is being employed to convince you otherwise. Or you notice how a shadow interacts incorrectly with a surface that obviously looks rough.

Bump mapping doesn’t have this problem because it doesn’t look good enough to. Standard bump mapping doesn’t bring out the detail to the degree that relief mapping can, so there isn’t the disjunction of near-reality next to a visual artifact. Or, even worse, seeing an object that looks highly detailed from one angle and moving to another where it looks (compared to the original angle) incredibly fake. It creates tension in the world; an inconsistency of experience that people aren’t used to dealing with. Bump mapping may not look as good as relief mapping, but it is, at least, consistent in its appearance.

Originally posted by zed:
surely when the ability to create vertices on the card comes than all this(Relief Mapping) will be rendered obsolete?
im not knocking this technique i believe its brilliant

I think that’s fairly obvious. Bumpmapping will be thrown away eventually.

I find that the D3 graphics are a joke in some ways. Walls are huge polygons and the texture has large objects in it.

If your bumpmaps are for slight bumps, no need for displacement techniques and bump shadows.

It creates tension in the world; an inconsistency of experience that people aren’t used to dealing with.
I don’t think that this concern is justified in this particular case. Game worlds are rife with textures that attempt to create the illusion of geometric depth where none exists. This technique simply seeks to enhance that illusion. That there are artifacts associated with the end result in no way distinguishes it from other attempts at manufacturing depth through the use of any number of ad hoc techniques, save that this one is among the more effective of those attempted thus far. My concern, really, is the performance hit; and as you suggest, that the artists understand the implications of adding excessive “depth” to the textures.

Needless to say, an improper application of this–and indeed any–effect could result in less that pleasing/consistent results. But visual anomalies are part and parcel of the gaming experience; they’re part of a celebrated tradition embodying the best of intentions, and I think the (gaming) public understands that. I think the average gamer is only too eager to suspend disbelief , especially when there are kingdoms to rule or untold treasures in them hills!

Well, I think Korval’s point is that this technique is so good, and contributes so much to the realism of the scene, that when the illusion is shattered it subtracts more from the immersive experience than it originally added. Sort of, every reaction has an equal and opposite reaction, I suppose.
As I said though, I believe this is true of other effects - a good example is the water in Far Cry, where it looks stunning until you see the artifact created by the fact that the reflection is mirrored around a perfect plane, but the texture is mapped onto a displaced plane.
I imagine we all agree though, that this is a stunning technique, and certainly worth adding to our renderers.

A post was split to a new topic: Re: Quake4 Relief Mapping