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
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Doom 1 Parallax Mapping (2 versions available)

Post by Rachael »

Posted by dpJudas on Discord:

Code: Select all

Parallax mapping for GZDoom
===========================

This pk3 contains a small sample set of textures along with a parallax shader.
It gives a small taste of how Doom might look like if it had a more complete set of textures.

Special thanks to Michael Obersnel for creating the patch textures this set was based on.
The original author was apparently willing to share this with dpJudas and so it is as thus posted, with his permission.

Screenshots:
Spoiler:
Download:
https://mega.nz/#!YJ1EQSpb!KY1Um5v6Zsfy ... V0PFdapHKQ

Alternate version (created by Darkcrafter - more details here - thanks!):
https://drive.google.com/file/d/1gPNltV ... 1EIkT/view
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Doom 1 Parallax Mapping

Post by Enjay »

Looks neat. Not too over the top in most cases. Nice and subtle, but definitely there.

A minor "health warning" it replaces standard textures and flats with lumps in the textures folder. This causes a problem with the name clash textures/flats STEP1 and STEP2 and even breaks MAP07 where the final sector raises by the height of its lower texture.

Image

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

Re: Doom 1 Parallax Mapping

Post by dpJudas »

The set is made for Doom 1 as far as I can tell. Hence the problems with Doom 2. They are mostly a proof of concept anyway as the set is incomplete.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Doom 1 Parallax Mapping

Post by Enjay »

It'll cause similar problems in Doom as well as Doom2. The "problem" is that Doom has textures named STEP1 and STEP2 and also flats with those names. If you load a mod with lumps in a textures folder with those names, it will use the loaded lumps in place of both.

[edit]
Image
[/edit]
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: Doom 1 Parallax Mapping

Post by dpJudas »

Oh I see - my patch to texture conversion program didn't take that into account. Oops. :)
User avatar
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Doom 1 Parallax Mapping

Post by Rachael »

Wow - I playtested that before posting it and I wonder how I missed that. >_> Good find, Enjay.
MrJohnny
Posts: 212
Joined: Fri Aug 05, 2016 8:41 am

Re: Doom 1 Parallax Mapping

Post by MrJohnny »

This is awesome! If this was a full set, it'd prolly go right in the autoload folder.
User avatar
Darkcrafter
Posts: 562
Joined: Sat Sep 23, 2017 8:42 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

Nice! Some critique:
1) Steep PM sometimes not enough imho :oops:
2) Why patches is still a thing? As far as I know patches are there to save some space in 90's. Why not just use textures? :mrgreen:
3) Parallax mapping looks choppy if nearest neighbor (that pixel look) interpolation is used on textures, is there any way to use nearest neighbor while having shader processing in bilinear?
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: Doom 1 Parallax Mapping

Post by dpJudas »

Darkcrafter wrote:1) Steep PM sometimes not enough imho
Steep PM is not enabled in the shader in the pk3 (change the define in there to enable it). Mostly for performance reasons.
2) Why patches is still a thing? As far as I know patches are there to save some space in 90's. Why not just use textures?
I'm not sure why Michael chose this approach. Maybe he felt it was easier as there are fewer patches than textures. I'm not sure id software did it this way to save space - it might have been motivated by an easier workflow for creating the textures.
3) Parallax mapping looks choppy if nearest neighbor (that pixel look) interpolation is used on textures, is there any way to use nearest neighbor while having shader processing in bilinear?
Unfortunately not. This requires some changes to the texture manager or the way shader sampler inputs are bound.
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Doom 1 Parallax Mapping

Post by Tormentor667 »

I don't get it... what's the difference between normal/specular maps and this?
User avatar
Darkcrafter
Posts: 562
Joined: Sat Sep 23, 2017 8:42 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

Tormentor667 wrote:I don't get it... what's the difference between normal/specular maps and this?
normal map adds some texture effect depending on light information present into a map (dyn lights). Despite best efforts one can't get a surface that doesn't look flat with this.
Specular maps are there to allow for shinnes to display according to a specular map (white color means more light in an area of a texture).

Parallax mapping simulates Displacement mapping at lower resource consumption cost (you don't need millions of polygons to get a displacement effect to work). So the surface virtually becomes 3D without getting even a polygon! So you can add a really good 3d effect to a surface.

Here you can see the difference between normal mapping and parallax mapping:
http://encelo.netsons.org/blog/wp-conte ... rallax.jpg

Left is normal, right is parallax.
User avatar
Darkcrafter
Posts: 562
Joined: Sat Sep 23, 2017 8:42 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

dpJudas wrote:Steep PM is not enabled in the shader in the pk3 (change the define in there to enable it). Mostly for performance reasons.
Thanks, gottal look into it later :)
User avatar
Darkcrafter
Posts: 562
Joined: Sat Sep 23, 2017 8:42 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

Tried to put POM in there today and failed :mrgreen: so the cause was that I entered 0.75 as a parallax coefficient to get more effect and found steep pm to distort the textures a lot. Still complies Doom well, especially nice on GSTVINE and waves floor texture at E3M1.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Doom 1 Parallax Mapping

Post by Enjay »

I played quite a bit of Doom with this last night. I think that textures where the mapping is relatively simple and subtle work very nicely. e.g. the various textures that are meant to look like big stone blocks (e.g. GSTONE1, STONE2) work really well; the mapping just giving them a bit of 3D-ness so that the lines between the blocks look slightly recessed is nice.

Textures that work less well are ones with "deeper" or more irregular features. e.g. if you go right up to a BIGDOOR2, look upwards and strafe left and right you can easily see the texture distorting and generally looking odd as you move. COMPWERD also looked WERD... er weird. ;)

I assume that part of this is due to the low-res nature of the textures and hi-res textures would cope much better with this type of mapping.


Also, perhaps another unintended consequence, if a flat has a map and the flat is used behind some end text, the flat won't show up behind the text on the endtext screen.

Image
Image
User avatar
Darkcrafter
Posts: 562
Joined: Sat Sep 23, 2017 8:42 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping

Post by Darkcrafter »

Updated my drivers for the old video card and magically it now supports gl shading 3.3 :) so I've got this thing working on my older computer as well.
Surprisingly I had to invert the parallax scale otherwise the effect was inverted (ATI Radeon HD 2400 PRO).

Must admit I was stupid enough to admit there was no occlusion mapping (it IS actually there) :oops:
Still, there are some artifacts, I saw on the web that their methods (absolutely the same in code that is used here) looks better. It kind of goes out of the texture border, so the illusion doesn't get broken as it reachs a polygon border.

Got some screenshots here: https://drive.google.com/open?id=1566iW ... ImpTf3UWml
Post Reply

Return to “Shaders”