Doom 1 Parallax Mapping (2 versions available)

Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Darkcrafter
Posts: 571
Joined: Sat Sep 23, 2017 8:42 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

I found out the technique is called Parallax Occlusion Mapping with Silhouettes.

https://chetanjags.wordpress.com/2013/0 ... lhouettes/

http://developer.amd.com/wordpress/medi ... D07%29.pdf
User avatar
Chris
Posts: 2950
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Doom 1 Parallax Mapping

Post by Chris »

That will still have issues with polygon edges. It's simply an unescapable fact that Parallax Mapping works by taking a to-be-rendered flat triangle surface pixel in screenspace, and adjusts the texel lookup based on camera angle to make it look like it has depth. When the view ray should cross to a differently-textured or -oriented surface, the lookup adjustment has no way to compensate so you'll get a visible seam, and more extreme parallax adjustments will show more significant seams. This is to say nothing of the pixel depth value, which creates another set of issues (either you change the depth value to its proper value and pre-shader depth-test optimizations are disabled, or you don't and the depth buffer still sees it as a flat surface).

Parallax mapping is okay enough for subtle adjustments, but if you want to really adjust the apparent depth of the geometry, you need to change the geometry. Geometry shaders were needed to properly implement displacement for a reason.
User avatar
Darkcrafter
Posts: 571
Joined: Sat Sep 23, 2017 8:42 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

Yeah you're 100% correct here. I wanted to ask if there is anyway to overcome this problem? Maybe to use some linedef or point information from a map and then "blend" this seam out with a crossfade?
User avatar
Armaetus
Posts: 1256
Joined: Fri Mar 13, 2009 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10 Home
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: New York State

Re: Doom 1 Parallax Mapping

Post by Armaetus »

These are great! I look forward to seeing Doom 2 added to the mix as well as fixing the step texture and inter-episode problems.
User avatar
Sinael
Posts: 244
Joined: Tue Oct 18, 2011 8:57 am

Re: Doom 1 Parallax Mapping

Post by Sinael »

Is it possible to make separate filtering settings for base textures and parallax? Because for the base textures nearest looks the best, but it makes parallax look "stepped", while trilinear makes Parallax look neat, but the base texture looks smudged.
User avatar
Darkcrafter
Posts: 571
Joined: Sat Sep 23, 2017 8:42 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

The developer already said no.
User avatar
Darkcrafter
Posts: 571
Joined: Sat Sep 23, 2017 8:42 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

I can't believe I ported relief parallax mapping from here: https://habr.com/ru/post/416163/
This one greatly outperforms everything posted here in quality but it will make your graphics card working a bit harder.

Here is the shader: https://drive.google.com/open?id=16Sjq- ... t3sNnb_w63
New download link: https://drive.google.com/file/d/1KhzZyx ... sp=sharing

:!: Relief mapping is ON by default :!:

Looks good even without texture filtering: https://drive.google.com/open?id=1uy6jD ... hQoopsspmw
Last edited by Darkcrafter on Wed May 18, 2022 5:55 pm, edited 1 time in total.
User avatar
Tormentor667
Posts: 13547
Joined: Wed Jul 16, 2003 3:52 am

Re: Doom 1 Parallax Mapping

Post by Tormentor667 »

Wow! This looks indeed very good
User avatar
Enjay
 
 
Posts: 26540
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Doom 1 Parallax Mapping

Post by Enjay »

They do indeed look good but some could still do with a bit of hand-tweaking. e.g.



A quick edit



I don't really understand what the different colours and shades in the materials do - so it's not great. However, I did notice that the displacement and normal map for this texture don't take account of the switch panel in this texture at all. It's there on the specular, but not the other two.
User avatar
Darkcrafter
Posts: 571
Joined: Sat Sep 23, 2017 8:42 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

Hmm. I noticed the same behaviour with switches too. I tried to put my texture in there so as a result it had way much displacement ammount to it while still having the same contrast in the heigh map image. I suspect that having correct pbr maps is important. As far as I know this implementation relies on patches but not the textures, so it might be the reason why quadratic switches placed on the top of the plastic texture (which obviously uses its own height map) look that way.
User avatar
Enjay
 
 
Posts: 26540
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Doom 1 Parallax Mapping

Post by Enjay »

It does depend on textures, but for what ever reason, the texture in the PK3 is fine, it's just that the displacement and normal map don't have any trace of it in their image.

Here's the texture, displacement, normal and specular images from the PK3.

Image
dpJudas
 
 
Posts: 3109
Joined: Sat May 28, 2016 1:01 pm

Re: Doom 1 Parallax Mapping

Post by dpJudas »

The original texture set was made using patches. Since GZD doesn't support that as input for normal/displacement maps, I wrote a small program that converted the patches into textures. The switches didn't come with a normal map to begin with and at the time I figured it made sense to then just not modify the existing normal map for the patch under it. Obviously that wasn't a very good solution.
User avatar
Darkcrafter
Posts: 571
Joined: Sat Sep 23, 2017 8:42 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

We need the tools, convenience of use is 90% of success! When this parallax shader looks pretty decent by itself it sucks due to seams between linedefs I'm wondering if there is anything we can do to at least to make it not that obvious. Also I'm striving to get that parallax shader with silhouettes, just imagine how this would beef up the doom graphics. I just downloaded nerual enhance mod added my hi-res weapon animation pack + some of my hi-res textures and parallax in the end of it. Doom never looked that good so I dropped my jaw mouse.
zhadoom
Posts: 39
Joined: Mon Feb 04, 2019 10:06 am

Re: Doom 1 Parallax Mapping

Post by zhadoom »

Wow, this looks great!

Question: What tools do you use to create normal and displacement maps?
User avatar
Darkcrafter
Posts: 571
Joined: Sat Sep 23, 2017 8:42 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

For height maps you can go even with paint. I use Photoshop. For normals there was a photoshop plug-in called nVidia Normal Map Creation Toolkit, you basically drop your bump or height map image in there and it does the job. Ideally you would go with a 3d modeling package, make a 3d model of a texture and bake normals and heights, but this is out of scope for a majority of users due to lack of 3d modeling experience.

Return to “Shaders”