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
r&r
Posts: 279
Joined: Fri Sep 08, 2017 2:54 pm

Re: Doom 1 Parallax Mapping (2 versions available)

Post by r&r »

would the concept Parallax works for doom's 2d sprite weapons?
User avatar
Tormentor667
Posts: 13547
Joined: Wed Jul 16, 2003 3:52 am

Re: Doom 1 Parallax Mapping (2 versions available)

Post by Tormentor667 »

Most propably not because the sprites are drawn flat directly as graphic to the hud.
User avatar
talisa
Posts: 26
Joined: Sun May 13, 2018 2:02 pm

Re: Doom 1 Parallax Mapping (2 versions available)

Post by talisa »

wouldnd it be possible create voxel versions of doom's hud weapons instead? voxels would have the same look, since voxels are merely pixels arranged in a 3D space

perhaps with some good voxel work, it could be able to make voxel versions of doom's HUD weapons that looks just like the original 2D sprites,
but with the added benefit of being 3D and having real depth, while still looking just as chunky and pixel-tastic as the original sprites ?

just a random thought that sprung up in my head when thinking about 3D sprites... since voxels are litterally just 3D sprites in a way
User avatar
TDRR
Posts: 816
Joined: Sun Mar 11, 2018 4:15 pm
Location: Venezuela

Re: Doom 1 Parallax Mapping (2 versions available)

Post by TDRR »

talisa wrote:wouldnd it be possible create voxel versions of doom's hud weapons instead?
Yes, it works in the hardware renderer. AFAIK, it does not work in software mode however, and this hasn't been fixed (yet?).

But this is probably far more trouble than what it's worth, since the voxels will look the exact same as sprites when put as a HUD weapon, and yes, this has been done before. The only time it could be actually useful is in VR.
User avatar
talisa
Posts: 26
Joined: Sun May 13, 2018 2:02 pm

Re: Doom 1 Parallax Mapping (2 versions available)

Post by talisa »

hmm... well... a slight subtle sway could be added possible which occurs with the players movement
so that the player will actually be able to tell that the weapons are voxels instead of sprites?

it can be very subtle, just enough for the player to be able to tell the weapons are voxels instead of sprites

also, of course, any nearby lights like torches and such will also affect the hud weapons if they were voxels, which would look much nicer on voxel weapons.

perhaps the one same 'simulated sunlight' shader could be added to them like cherno recently added to his voxel hud weapons from his ''voxel chibi doom",
which add random lighting to the hud weapons to simulate random directional lighting on the hud weapons
viewtopic.php?f=46&t=58059
Kazudra
Posts: 126
Joined: Mon May 25, 2015 10:52 am

Re: Doom 1 Parallax Mapping (2 versions available)

Post by Kazudra »

talisa wrote:wouldnd it be possible create voxel versions of doom's hud weapons instead? voxels would have the same look, since voxels are merely pixels arranged in a 3D space

perhaps with some good voxel work, it could be able to make voxel versions of doom's HUD weapons that looks just like the original 2D sprites,
but with the added benefit of being 3D and having real depth, while still looking just as chunky and pixel-tastic as the original sprites ?

just a random thought that sprung up in my head when thinking about 3D sprites... since voxels are litterally just 3D sprites in a way
Good Voxel work is extremely hard to come by, the only game I've seen with Voxels that are impressive is Ion Fury.
User avatar
talisa
Posts: 26
Joined: Sun May 13, 2018 2:02 pm

Re: Doom 1 Parallax Mapping (2 versions available)

Post by talisa »

Kazudra wrote:
talisa wrote:wouldnd it be possible create voxel versions of doom's hud weapons instead? voxels would have the same look, since voxels are merely pixels arranged in a 3D space

perhaps with some good voxel work, it could be able to make voxel versions of doom's HUD weapons that looks just like the original 2D sprites,
but with the added benefit of being 3D and having real depth, while still looking just as chunky and pixel-tastic as the original sprites ?

just a random thought that sprung up in my head when thinking about 3D sprites... since voxels are litterally just 3D sprites in a way
Good Voxel work is extremely hard to come by, the only game I've seen with Voxels that are impressive is Ion Fury.
good impressive voxel work? ....ill just leave these threads right here

Reikall's Voxels.

Cherno's Voxel Chibi Doom

Voxelbro's Voxel addons

just a FEW of the many examples of great voxels :wink:
User avatar
Steve5563
Posts: 82
Joined: Sun Jan 27, 2019 11:18 pm
Operating System Version (Optional): windows 10
Graphics Processor: nVidia with Vulkan support
Location: Australia

Re: Doom 1 Parallax Mapping (2 versions available)

Post by Steve5563 »

i found an issue with this parallax shader,
the bright maps don't seem to work with it. is there anyone here or knows of someone that plays around with shaders and would be willing to look at the code and see what the problem is?
such a cool feature just held back by this small bug.
AndrewMRX
Posts: 29
Joined: Sat Apr 18, 2020 11:53 am
Graphics Processor: nVidia with Vulkan support

Re: Doom 1 Parallax Mapping (2 versions available)

Post by AndrewMRX »

This shader does not work with brightmaps on the new Gzdoom version, but it works on GZdoom 4.3.3
It would be nice to fix this for the new version.
User avatar
Steve5563
Posts: 82
Joined: Sun Jan 27, 2019 11:18 pm
Operating System Version (Optional): windows 10
Graphics Processor: nVidia with Vulkan support
Location: Australia

Re: Doom 1 Parallax Mapping (2 versions available)

Post by Steve5563 »

thanks Andrew i did not know that.
User avatar
Steve5563
Posts: 82
Joined: Sun Jan 27, 2019 11:18 pm
Operating System Version (Optional): windows 10
Graphics Processor: nVidia with Vulkan support
Location: Australia

Re: Doom 1 Parallax Mapping (2 versions available)

Post by Steve5563 »

so i found out that WolfenDOOM has a modified version of this shader that works with gzdoom 4.5 and that the bright maps do work with it.
so i compared both shaders side by side and copy / pasted and deactivated some lines of code for this parallax shader listed at the start of this thread.
and i have got it working out of sheer luck as i had no idea what i am doing with shader code.
these are the changes i made.

Code: Select all

#define RELIEF_PARALLAX
// #define NORMAL_PARALLAX

mat3 GetTBN();
vec3 GetBumpedNormal(mat3 tbn, vec2 texcoord);
vec2 ParallaxMap(mat3 tbn);

//Material ProcessMaterial()       							---------------not needed anymore
void SetupMaterial(inout Material material)					//---------------line sourced from wolfendoom's modified parallax shader
{
    mat3 tbn = GetTBN();
    vec2 texCoord = ParallaxMap(tbn);

    //Material material; 									-----------not needed anymore
    material.Base = getTexel(texCoord);
    material.Normal = GetBumpedNormal(tbn, texCoord);
	material.Bright = texture(brighttexture, texCoord); 	//----------- forced brightmap to load here
#if defined(SPECULAR)
    material.Specular = texture(speculartexture, texCoord).rgb;
    material.Glossiness = uSpecularMaterial.x;
    material.SpecularLevel = uSpecularMaterial.y;
#endif
#if defined(PBR)
    material.Metallic = texture(metallictexture, texCoord).r;
    material.Roughness = texture(roughnesstexture, texCoord).r;
    material.AO = texture(aotexture, texCoord).r;
//#endif                                                 	-----------not needed anymore
//#if defined(BRIGHTMAP)                                 	-----------not needed anymore
//    material.Bright = texture(brighttexture, texCoord);	-----------not needed anymore
#endif
    //return material; 						 				-----------not needed anymore
}
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 (2 versions available)

Post by Darkcrafter »

After 5 years I have finally fixed the "fisheye" artifact, when you get very close to a wall it will distort like a huge round bump inside or outside.

The wrong thing was initially done by the original author, maybe due to a desire to optimize the shader?

Code: Select all

//    vec2 P = V.xy * parallaxScale; - how it was done

//    vec2 P = (V.xy / V.z) * parallaxScale; - how it needs to be done
It lacked necessary coordinates computation.
"A couple hours later moment" - a bugfix for weird warping at steep angles.

The link to download it is the same:
User avatar
Rachael
Posts: 13718
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Doom 1 Parallax Mapping (2 versions available)

Post by Rachael »

Thank you for that!

Return to “Shaders”