Home Technical Talk

Parallax Occlusion Mapping

polycounter lvl 10
Offline / Send Message
Pavel polycounter lvl 10
Hi guys!
This thing have a much interest in last times for me.
parallax.jpg
I tried doing something with plugin from Fabio Policarpo (Relief Mapping for 3D Studio Max Render)
It's working, but only with not unwraped models.
Maybe i do something wrong...i don't know

People who worked or works with it. Pleace prompt!

Is any way to look result in 3d package? for sample in 3dsmax, maybe some .fx shader? or separate viewer.
How it is possible to work parallax on unwrapped models?

Thanks...

Replies

  • Pavel
    Offline / Send Message
    Pavel polycounter lvl 10
    just DirectX SDK sample video
    http://www.youtube.com/watch?v=UeF-kCr_vyo

    But it only parallax, without occlusion
  • Eric Chadwick
    What do you mean by "not unwraped models"?
    Did you read the readme, and try his example Max file?

    The .FX files on his site should work in Max's viewport, I haven't tried them though.

    Ben Cloward has a HLSL viewport shader for parallax.
    http://www.bencloward.com/shaders_offset.shtml
  • Jarrod1937
    Offline / Send Message
    Jarrod1937 polycounter lvl 15
    the video and your image look way more like relief mapping than parallax mapping to me.

    relief mapping:
    34.jpg
  • Rob Galanakis
    Relief mapping is different (and much more complex) than parallax. Relief mapping is pretty complex, parrallax is one extra 8-bit channel and some trivial instruction and floats (copied from Ben's shader:):
    newV.y = -newV.y;
    half height = tex2D(bumpTex, In.texCoord.xy).a;
    half2 offset = newV * (height * 2.0 - 1.0) * offsetBias;
    half2 newTexCoord = In.texCoord.xy + offset;
    If you take a look at fabio's code, it is much much more involved.
    The terminology is extremely confusing, involving any combination of parallax, occlusion, relief, etc, in the title, but those are the differences.

    With a little work, you can take fabio's relief shader and swizzle the Y and Z coordinates to make it 3dsmax compatable.

    Also, the next verison of ShaderFX is supposed to have a relief mapping sample.
  • Eric Chadwick
    Isn't relief mapping terribly expensive? From what I've heard, it seems like it can't be used except in a specific showcase area, where there's little else going on.
  • Pavel
    Offline / Send Message
    Pavel polycounter lvl 10
    Yeah really "terminology is extremely confusing"

    About Ben's offset mapping shader, yes i used it.
    It's looking good like and relief mapping, but only with tiled texture and on simple models.

    "It's called Offset Normal Mapping, Parallax Mapping, or Simulated Displacement Mapping. It's one of the features that is exhibited prominently in the Unreal Engine 3 Tech Demo"

    This means that mapping using only for environments? Or for characters too, and how?
    has it sense for using on characters?

    Thanks guys
  • EarthQuake
    Its best used on objects you will enver see the edges of, because it breaks the effect, and you always see the edges of characers. Also characters are extremely expensive to render(wieghts and animations) with jsut standard shaders compared to environment stuff that dosent need to deform, so running a very complicated shader like relief/offset on something like that just wouldnt be realistic, hell its still not very feasible to use stuff like that even for environment stuff in a real game.

    Just for displaying in max it would be fine i'm sure, but i've never heard of anyone using it on character work.
  • Eric Chadwick
    I remember dimly someone from Epic (Rorshach maybe?) saying they tried it on characters and it just wasn't noticeable enough to make the cost worthwhile.
  • AlexanderLawrence
    Offline / Send Message
    AlexanderLawrence polycounter lvl 16
    "hell its still not very feasible to use stuff like that even for environment stuff in a real game"

    I'd have to disagree. Oblivion uses bump offset/parallax mapping all over the place. So does Unreal Tournament 2007 (excuse me, UT3). I know because we're using the Unreal Engine 3 and it came with some of the UT3 levels.

    I wouldn't recommend using it on most things, but surfaces such as brick or rock walls, embossed lettering, slightly raised beams, neon signs, and so forth can really benefit from some offset.
  • Jarrod1937
    Offline / Send Message
    Jarrod1937 polycounter lvl 15
    [ QUOTE ]
    "hell its still not very feasible to use stuff like that even for environment stuff in a real game"

    I'd have to disagree. Oblivion uses bump offset/parallax mapping all over the place. So does Unreal Tournament 2007 (excuse me, UT3). I know because we're using the Unreal Engine 3 and it came with some of the UT3 levels.

    I wouldn't recommend using it on most things, but surfaces such as brick or rock walls, embossed lettering, slightly raised beams, neon signs, and so forth can really benefit from some offset.

    [/ QUOTE ]
    from what i understand relief mapping and parallax are two different things. my engine has steep self shadowing parallax mapping and it does not extrude as far nor alter the silhouette like relief mapping does.
    although i have heard regular parallax could be altered to also alter the silhouette, but that mapping technique is still different than relief. am i correct on this?
    and yes, parallax mapping is fast enough to use quite a bit in high end graphic games, relief mapping not so much. if the unreal 3 engine has and uses relief mapping i would be extremly surprised.
  • Rob Galanakis
    Remember that we are talking about shaders, here. It is impossible to say what shaders an engine has, or doesn't have, since the entire idea of shaders is expandability and modularity. Did you know OGRE has relief mapping? It does if anyone wants to port fabio's fx file to it (not difficult, actually). If the engine is so fixed in features that shaders and whatnot cannot be added, it is a piss-poor engine, and AFAIK there are no popular high-end engines (that'd be using parallax in the first place) who are so limited.

    BTW, my Parallax pixel shader is 57 instructions, without, it is 51... the overhead associated with it is hardly inhibiting, but there is also the extra channel requirement for the height map. It isn't used for characters because, as stated, there is little benefit even with the not-extreme cost.

    None of these modify the silhouette, btw. It is not possible in DX9, since it works per-pixel.
  • Jarrod1937
    Offline / Send Message
    Jarrod1937 polycounter lvl 15
    [ QUOTE ]
    None of these modify the silhouette, btw. It is not possible in DX9, since it works per-pixel.

    [/ QUOTE ]
    here is a pic from an article showing relief mapping altering the silhouette running in realtime on the nvidia 7800 gtx, a dx9 card. however if the limitation truly is in dx9 for wahtever reason perhaps they are using opengl? and if so what is the limitation in dx9 that causes it to not be possible? sorry but i am not very technical whn it comes to shaders, i only have basic knowledge when it comes to the more recent ones.
    btw, with parallax mapping on deformable characters i thought no one used parallax mapping on deformable objects simply because parallax tends to swim badly when the object is deforming, has this been overcome since you guys are mentioning it being used on characters?
    relief.jpg
  • Rob Galanakis
    You're absolutely right. I stand corrected, I was thinking of Parallax Occlusion mapping.

    http://www.inf.ufrgs.br/~oliveira/RTM.html

    As to your character question, tbh I'm not completely sure about the swimming, next character I do I'll create a heightmap as well as see.
Sign In or Register to comment.