Page 1 of 6

Doom 1 Parallax Mapping (2 versions available)

PostPosted: Sun Sep 23, 2018 4:42 pm
by Rachael
Posted by dpJudas on Discord:
Code: Select allExpand view
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

Re: Doom 1 Parallax Mapping

PostPosted: Sun Sep 23, 2018 4:52 pm
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

Re: Doom 1 Parallax Mapping

PostPosted: Sun Sep 23, 2018 4:55 pm
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.

Re: Doom 1 Parallax Mapping

PostPosted: Sun Sep 23, 2018 5:03 pm
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]

Re: Doom 1 Parallax Mapping

PostPosted: Sun Sep 23, 2018 5:05 pm
by dpJudas
Oh I see - my patch to texture conversion program didn't take that into account. Oops. :)

Re: Doom 1 Parallax Mapping

PostPosted: Sun Sep 23, 2018 5:08 pm
by Rachael
Wow - I playtested that before posting it and I wonder how I missed that. >_> Good find, Enjay.

Re: Doom 1 Parallax Mapping

PostPosted: Sun Sep 23, 2018 8:29 pm
by Pompous Seed
This is awesome! If this was a full set, it'd prolly go right in the autoload folder.

Re: Doom 1 Parallax Mapping

PostPosted: Mon Sep 24, 2018 11:09 am
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?

Re: Doom 1 Parallax Mapping

PostPosted: Mon Sep 24, 2018 1:08 pm
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.

Re: Doom 1 Parallax Mapping

PostPosted: Mon Sep 24, 2018 1:28 pm
by Tormentor667
I don't get it... what's the difference between normal/specular maps and this?

Re: Doom 1 Parallax Mapping

PostPosted: Mon Sep 24, 2018 3:08 pm
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.

Re: Doom 1 Parallax Mapping

PostPosted: Mon Sep 24, 2018 3:16 pm
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 :)

Re: Doom 1 Parallax Mapping

PostPosted: Tue Sep 25, 2018 3:07 pm
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.

Re: Doom 1 Parallax Mapping

PostPosted: Tue Sep 25, 2018 3:36 pm
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

Re: Doom 1 Parallax Mapping

PostPosted: Thu Sep 27, 2018 6:35 pm
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