[SOLVED] Detail mapping + Parallax = Texture Swimming?

Started by
4 comments, last by n00body 9 years, 3 months ago

So basically when I do heavily tiled detail mapping on a surface that is using Offset Bump Mapping or Parallax Occlusion Mapping, as I orbit around the surface the detail maps appear to swim across the surface.

Conditions

  1. Both the base and detail maps use UV0.
  2. The base maps are tiled 1x with no offset.
  3. The detail maps are tiled 10x with no offset.
  4. The parallax offset is generated from a heightmap tied to the base maps texture coordinates.
  5. I apply the parallax offset like so: (UV0 * Tile + Offset) + parallaxOffset.

Questions

  1. Is there any way to counteract this problem?
  2. Do I need to modify the parallaxOffset somehow before I apply it to the transformed detail texture coordinates?
  3. Are Detail mapping and Parallax just inherently incompatible?

Thanks.


[Hardware:] Falcon Northwest Tiki, Windows 7, Nvidia Geforce GTX 970

[Websites:] Development Blog | LinkedIn
[Unity3D :] Alloy Physical Shader Framework

Advertisement

I would have thought you'd need:

(UV0 + parallaxOffset) * Tile

Rather than

(UV0 * Tile) + parallaxOffset

(I've ignored the offset seeing as you said it's zero in both cases, and I'm not sure what it represents)

That seems to have done the trick. I originally shied away from that option since I am doing this in Unity, and they hide texture transforms inside a macro. I'll just need to write my own.

Thanks for the help.


[Hardware:] Falcon Northwest Tiki, Windows 7, Nvidia Geforce GTX 970

[Websites:] Development Blog | LinkedIn
[Unity3D :] Alloy Physical Shader Framework

Additionally, I've found out you need to divide the offset by the tiling of the base map to avoid swimming on detail maps when you tile the base map. Just keeps getting more complicated. :(


[Hardware:] Falcon Northwest Tiki, Windows 7, Nvidia Geforce GTX 970

[Websites:] Development Blog | LinkedIn
[Unity3D :] Alloy Physical Shader Framework

Additionally, I've found out you need to divide the offset by the tiling of the base map to avoid swimming on detail maps when you tile the base map. Just keeps getting more complicated. sad.png

And then you scale up the parallax factor, and shadow receiving features look worse and worse. Looking at it, there seems to be a variety of reasons few games ship with parallax mapping, which is a shame since it always starts out as such a nice seeming idea.

That's odd. I haven't needed to scale up the parallax factor in mine. I basically just do the following:


float2 baseUV = uv0 * baseTiling + baseOffset;
float2 parallaxOffset = pom(height, heightmap, baseUV, viewDirTangent);

baseUV += parallaxOffset;
parallaxOffset /= baseTiling;

float2 detailUV = (uv0 + parallaxOffset) * detailTiling + detailOffset;

Am I missing something?

EDIT:

For clarification, I am using the following POM implementation:
A Closer Look at Parallax Occlusion Mapping


[Hardware:] Falcon Northwest Tiki, Windows 7, Nvidia Geforce GTX 970

[Websites:] Development Blog | LinkedIn
[Unity3D :] Alloy Physical Shader Framework

This topic is closed to new replies.

Advertisement