Parallax Occlusion : A possibility?

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
GeorgeTheWarp
Posts: 40
Joined: 02 Jun 2016, 02:56

Parallax Occlusion : A possibility?

Post by GeorgeTheWarp »

I've been wondering about the availability of parallax occlusion in OpenMW for quite a while. I looked at the wiki about height normal maps and parallax maps, but is parallax occlusion supported? Or is it just parallax mapping?

Parallax Occlusion, if not yet supported, HAS TO BE in the future. It's really one of the most modern features there are for gaming, and AMD is quickly catching up and making GPUs very capable of it. Sadly, nVidia still didn't catch up. However, the perception of depth this complex on 2D textures can very well remove the need of 3d modeled grass, and make the apparition of pretty much everything else way better, except for very specific things. So, is parallax occlusion supported?
User avatar
Capostrophic
Posts: 794
Joined: 22 Feb 2016, 20:32

Re: Parallax Occlusion : A possibility?

Post by Capostrophic »

GeorgeTheWarp wrote:is it just parallax mapping?
They're not so different in core, btw.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Parallax Occlusion : A possibility?

Post by Chris »

GeorgeTheWarp wrote:However, the perception of depth this complex on 2D textures can very well remove the need of 3d modeled grass
No, it won't. The parallax family of effects basically work by turning texture lookups into mini raytests based on the position of the viewer, using a heightmap to determine the "depth" of the texture at a given point. This works as long as you don't have particularly extreme slopes, and any kind of overhang is out of consideration. Steep viewing angles is also a problem, and you can get some oddities along polygon edges where the raytest can fail to take into account different adjacent textures.

Tessellation would be a better option, since it actually generates 3D geometry on the fly and will look just as correct as if that geometry was there to begin with. Incidentally, vanilla Morrowind used a rudimentary form of tessellation through AMD's "TruForm" system, though it only worked on certain AMD cards. With OpenGL 3, we could in theory enable that using standard and portable geometry shaders.
User avatar
psi29a
Posts: 5355
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Parallax Occlusion : A possibility?

Post by psi29a »

According to this: https://en.wikipedia.org/wiki/ATI_TruForm
Its support in Morrowind was unofficial, via the FPS Optimizer.
http://www.nexusmods.com/morrowind/mods/3875/
http://elderscrolls.net/docs/fps_optimizer.php

Image

Not sure how "true" this is though... but that would mean that "Vanilla Morrowind" did not have TruForm support. It was a 'mod' that brought in support.
User avatar
wareya
Posts: 338
Joined: 09 May 2015, 13:07

Re: Parallax Occlusion : A possibility?

Post by wareya »

>With OpenGL 3, we could in theory enable that using standard and portable geometry shaders.

Yeah, you could probably do that with a geometry shader, provided it has access to smoothing group data so that you can do it properly. So long as the model's normals are valid, interpolating an extra vertex in the middle of each triangle is trivial, and you could do it recursively (since you have to do it on the newly-created edges too).

Unfortunately, geometry shaders require GL 3.2, which means that strict core profile code would be mandatory (driver support of compatibility profiles for versions above 3.1 is not required in the standard). Else, you have to do it in software on model load, which is slow and will probably dramatically increase graphics bandwidth usage (I would assume something like double the bandwidth for first-order smoothing).

It also happens that different vendors have radically different bottlenecks on core profile. For example, on my specific setup (mesa on a radeon hd 5770), glDrawElements is extremely slow if the EBO and VBO were mapped with STREAM and DRAW. I couldn't figure out the best way to do things so I ended up making a new VBO consisting of the vertices in order of the element index list *every single frame* and it was somehow faster.
GeorgeTheWarp
Posts: 40
Joined: 02 Jun 2016, 02:56

Re: Parallax Occlusion : A possibility?

Post by GeorgeTheWarp »

wareya wrote:>Yeah, you could probably do that with a geometry shader, provided it has access to smoothing group data so that you can do it properly. So long as the model's normals are valid, interpolating an extra vertex in the middle of each triangle is trivial, and you could do it recursively (since you have to do it on the newly-created edges too).
However, would it give depth to a 2D image? The main question is this, as it would enable easier changes to the appearance of meshes without have to tinker with the mesh itself, and would probably be more efficient to do so too. Having to load up blender for a slight change that could have been made in the texture is not fun, even thought some people prefer tinkering with many tools for few gain.

Also, it would enable a larger possible userbase (from a gamedev perspective). Is it really that slow? Is parallax occlusion faster/slower? Which company's implementation is the most efficient?(for parallax occlusion, it's obvious. AMD have developped it for a long time before nVidia, and nVidia didn't implement it until very recently) Is the way we are supposed to use it is similar to parallax? Or is it just bump maps?

Sorry for the numerous questions I have asked, but I'm curious about what technologies could be more efficient for games.
raven
Posts: 66
Joined: 26 May 2016, 09:54

Re: Parallax Occlusion : A possibility?

Post by raven »

Yeah, there are limitations to parallax occlusion. You a ray tracing into a surface, so it works best with depressions. This is why most often cobblestone surfaces are used to demonstrate it ;)
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Parallax Occlusion : A possibility?

Post by Chris »

GeorgeTheWarp wrote:However, would it give depth to a 2D image?
Yes, since the extra geometry is generated on the fly, you can provide a heightmap and the polygon sub-divisions can follow the details present in it to create the "depth". OpenMW could have a shader path that recognizes the presence of such a heightmap and automatically enable the appropriate geometry shader with it, and it would "just work" like normal mapping does.

But it can go farther than that, since it's happening in 3D and is actual 3D geometry rather than a visual trick, that means it will also behave as 3D geometry. Its altered depth and surface angle will be preserved during rendering so light and shadows will correctly affect it, and as such you're not restricted to surface depressions. See: https://www.youtube.com/watch?v=bkKtY2G3FbU And since it's real geometry generated on the fly, the same system can can used for other things, like animated grass, by changing the shader: https://www.youtube.com/watch?v=pdMaFWGLxKE
User avatar
lysol
Posts: 1513
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Parallax Occlusion : A possibility?

Post by lysol »

Chris wrote: But it can go farther than that, since it's happening in 3D and is actual 3D geometry rather than a visual trick, that means it will also behave as 3D geometry. Its altered depth and surface angle will be preserved during rendering so light and shadows will correctly affect it, and as such you're not restricted to surface depressions. See: https://www.youtube.com/watch?v=bkKtY2G3FbU
While this looks great and all, the part that is interesting is really: Will this put less load on the computer compared to just making the models look this detailed from the beginning? Presumed those models have lower detail LOD-models of course. I mean, to me it feels like it must require a lot of calculations for the computer to add those details from simple height maps, can this technique really be that much more efficient on presenting high detail compared to a "normal" 3d model?
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Parallax Occlusion : A possibility?

Post by Chris »

lysol wrote:While this looks great and all, the part that is interesting is really: Will this put less load on the computer compared to just making the models look this detailed from the beginning?
I imagine so, since it requires less memory and automatically lowers detail at a distance by simply not generating as much extra detail, rather than switching between different models.
I mean, to me it feels like it must require a lot of calculations for the computer to add those details from simple height maps, can this technique really be that much more efficient on presenting high detail compared to a "normal" 3d model?
The calculations are handled on the GPU, which happens in parallel. It's trading more processor usage for less memory, but the reduced memory usage and use of parallel processing can work in its favor.
Post Reply