Product Chat / GG PBR Heightmap - Parallax Occlusion Mapping - Experimental Shader

Author
Message
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 4th Aug 2018 01:21 Edited at: 4th Aug 2018 01:21
Hi all,

this is an experiment that uses the so far unused height map texture within GG's PBR framework.

I've no doubt Lee or Preben will get to this at some point (or they might want to adopt this if it works OK for most), but if you want to try a version that I use (sparingly on a few entities because it sucks FPS) then I've attached the shaders and a "path" entity/textures to try it with (the apbr_basic_parallax.fx shader needs an appropriate height-map texture).

Be sure to back-up your stock apbr_core.fx before you move the attached apbr_core and apbr_basic_parallax shaders into effectbank\reloaded. The "path_circle" entity files you can put anywhere appropriate in entitybank folder.

If you have any PBR assets to hand that have a heightmap texture (needs suffix _height in GG), it would be great to see screenshots of how they look (use effect = effectbank\reloaded\apbr_basic_parallax.fx in the fpe).

Cheers.

Attachments

Login to view attachments
Earthling45
7
Years of Service
User Offline
Joined: 3rd Sep 2016
Location: Zuid Holland Nederland
Posted: 4th Aug 2018 14:23
Thanks cybernescence.

It looks fantastic, now i'm finally able to continu with some models which are essentially boxes with height and dept drawn onto it with the use of substance painter.

My gtx amd6300 with a gtx960 gives a lowest framerate of 32 when im standing on top of the circle and looking down.
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 4th Aug 2018 14:57
Very nice. Thank you.
Will give it a test.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 4th Aug 2018 16:02
This looks wonderful!

Is it at all possible to have a parallax DNS shader?
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th Aug 2018 16:14
Awesome, looks like a Blender scene I wonder how much fps does it tend to eat?
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 4th Aug 2018 17:57 Edited at: 4th Aug 2018 17:57
@Earthling45 - thanks for trying it out - be interested to see how it works with your height-mapped assets

@Pirate Myke - hope it works with some of your assets

@Wolf - probably, but may have to use the "_I" as a sacrificial height map without engine changes

DVader - a fair bit - it is raymarching a lot for each pixel so I would only use it selectively in scenes, I added a range limit (500) to try and rduce the performance impact - this could be adjusted up/down to suit as a setting (not there now). Also the min/max steps for the iteration of the calcs could be adjusted - get different/not very good results at oblique angles if reduce the steps too far (but performance goes up).

Here's a stepped hill, there is no geometry in the hill other than a curved plane.

Attachments

Login to view attachments
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 4th Aug 2018 17:59
Quote: "
@Wolf - probably, but may have to use the "_I" as a sacrificial height map without engine changes"


Oh! that is quite alright
JPH-GAMES
3D Media Maker
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Belgique
Posted: 4th Aug 2018 18:45
This is great news, I will put it into practice if you allow it.
very big thank you cybernescence.

Intel Pentium CPU G3220 3.000 GHz , 8 GB Ram , NVIDIA GeForce GTX 745 2GB , Windows 10 64-bit.
GameGuru , S2Engine HD , Shoot EM Up , CopperCube 5 , Clicteam Fusion 2.5 , Platfinity .
Earthling45
7
Years of Service
User Offline
Joined: 3rd Sep 2016
Location: Zuid Holland Nederland
Posted: 5th Aug 2018 01:10
Quote: "@Earthling45 - thanks for trying it out - be interested to see how it works with your height-mapped assets
"


Wel it needs some work, i've lowered the heightmap scale to 0.01 but it is still to much (if i've meddled with the right value) compared to what i see in the model viewer which i use to preview 3d objects with parallax mapping. in the model viewer the setting for the heightmap is 0.04. the other problem is that as can be seen in the video, it is upwards when looking down, downwards when looking up. I saw this also in the model viewer when looking at the screws at the back.


Bugsy
15
Years of Service
User Offline
Joined: 24th Nov 2008
Location: Savannah
Posted: 5th Aug 2018 07:55
absolutely awesome. I hope to see a DNS version of this shader. I assume it would have to be used EXTREMELY sparingly?
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 6th Aug 2018 19:12 Edited at: 6th Aug 2018 19:13
@Earthling45

Parallax Mapping is a great technique to boost details, but does come with drawbacks you'll have to consider when using it. Most often parallax mapping is used on floor or wall-like surfaces where it's not as easy to determine the surface's outline and the viewing angle is most often roughly perpendicular to the surface. It should work OK on box type entities, so I've tweaked the shader (attached) - not sure if this will be any better, tested it on the 'toy box' below - also attached.

@JPH-GAMES - please use it if it is of any use to you

@Bugsy - it does drag down FPS - best way is to give it a try (though think you're on x9 still at the moment), but yes in general, would save it for paths and such that are for the 'wow' scenes

Cheers.



Attachments

Login to view attachments
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 7th Aug 2018 16:25
Sweet. I will give it a shot. Still trying to get the right map for it. All my old maps are not even close.

But I have a bunch of mega scan assets to test.

On my old boat anchor machine, I had your example plus two floor pieces on the map and a log asset from mega scans duplicated a dozen time. 3 spot lights and 1 dynamic omni light.
All using the shader.

Was getting 60 fps, so it appears to not be as chunky as you think.

I am very happy with this and hope to see it in the main build soon.

Thanks for giving us the modifies shader to play with.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Earthling45
7
Years of Service
User Offline
Joined: 3rd Sep 2016
Location: Zuid Holland Nederland
Posted: 8th Aug 2018 19:43
@cybernescence

Thanks, the box looks really good.
Four of 5 kittens have a new home now, one will stay with her mom and i should have more time now to pick up modeling again. Thanks for the modified shader.
Stab in the Dark software
GameGuru TGC Backer
21
Years of Service
User Offline
Joined: 12th Dec 2002
Location: Upstate New York USA
Posted: 9th Aug 2018 19:02
Well this explains why PBR models with a high poly bake do not look correct in GG.
Without the POM shader the high poly bake will be very flat.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 9th Aug 2018 21:29
Well yeah of course, without a height map you're relying on normal maps and there's only so much you can do with normals
[img]belidos3d.swgrp.co.uk/wp-content/uploads/2016/03/blogo.png[/img]
Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Nomad Soul
GameGuru Tool Maker
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location: United Kingdom
Posted: 10th Aug 2018 00:15
Yeah so I wouldn't use this kind of shader for anything except floors.

It can look absolutely stunning on the ground but I find on walls it just looks too much. Plus its a crazy drain on performance of course.
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 10th Aug 2018 09:08
I have another one coming that has much less performance impact - offset bump mapping - it augments normals but based around height texture. I’ll post it here for comment/test.

Cheers.
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 10th Aug 2018 14:09
Excellent. Thank you.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 12th Aug 2018 08:26 Edited at: 12th Aug 2018 08:28
Did some more playing with some old textures, and found some online with displacement maps. Some Mega Scan assets also.
Yours:


Mega Scans Assets with displacement maps:


From https://3dtextures.me/




Old textures sorted out:




Trouble one still:
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 12th Aug 2018 15:29
Awesome Myke !!
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 18th Aug 2018 07:53
My flat surfaces have this issue. It is hit or miss for me.


But cubes are looking great from the sides.



@cybernescence
How did you get your cobble stones so perfect?
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 18th Aug 2018 08:29
Hi PirateMyke - any chance you could drop me link for your flat surfaces that are having an issue so I can see if I can find the problem?

I ported the parallax code from a couple of sources and used the cobblestone texture as the main test texture so maybe I’ve tuned it too far to that texture or I’ve missed something.

Thanks for continuing to test.

I have the other approach nearly ready too and then will look at tesselation (vertex displacement).

Cheers.
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 18th Aug 2018 14:17
@cybernescence
PM sent. Thank you.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 23rd Aug 2018 12:13
@cybernescence : When you think the Parallax Mapping Shader is complete, feel free to send it directly to me and I will see if I can work it into the next update as an extra shader option. I had not planned to activate work around the reserved _height texture slot but as you've already made a great start I guess I can make some time to bring it to life for everyone.
PC SPECS: Windows 8.1 Pro 64-bit, Intel Core i7-5930K (PASSMARK:13645), NVIDIA Geforce GTX 980 GPU (PASSMARK:9762) , 32GB RAM

Duchenkuke
GameGuru VBOTB Developer
7
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 27th Aug 2018 22:01
YES ! DO IT, this is way to amazing!
Duchenkuke
GameGuru VBOTB Developer
7
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 28th Aug 2018 06:32
can this be applied to terrain too ?
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 28th Aug 2018 07:31
@PyrateMyke - thanks I got your textures and see the issue it is something to do with tangent calcs I think in the engine but not yet sure - I’ve tried a number of alternative approaches and not quite fixed this yet.

@Lee - will do though I may need your help - see above - though I will try and resolve so you don’t have to spend time on something unplanned.

@Duke - in theory yes but I suspect it will drag performance down unacceptably - I would only use it sparingly.

Cheers.
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 28th Aug 2018 14:29
Cool. Let me know if you need some more textures to try.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 28th Aug 2018 20:59
Wow. I need this.
Jim C
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 29th Aug 2018 06:57 Edited at: 29th Aug 2018 06:58
Some more playing around.



Now I have seemed to found a problem with the AO textures repeating on all the objects with the same mesh assigned to the FPE files. Everything but the stairs are using a 100x100x5 slab. I did use a transparent color map for the grates on the floors.




Debug mode on the AO
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Duchenkuke
GameGuru VBOTB Developer
7
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 29th Aug 2018 07:51
I have the same issue as myke... textures looking all wrong...



Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 29th Aug 2018 08:08
preservetangents = 1 in the FPE file seems to make this better. Below images with it on now.

But this is not ready for walls yet. As everything at eye level will walk really bad.
Just for floors.





Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Duchenkuke
GameGuru VBOTB Developer
7
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 29th Aug 2018 08:15
Duchenkuke
GameGuru VBOTB Developer
7
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 29th Aug 2018 08:33
where to put this in the fpe ?


preservetangents = 1

"visuals" section ?
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 29th Aug 2018 13:40
In the visuals section will work for the fpe file.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 29th Aug 2018 22:42
those are flat models? wow they really look like they're indented... i personally can never really see the normals in GG but this is impossible not to see, impressive
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 4th Sep 2018 15:18 Edited at: 4th Sep 2018 15:20
Hi - well that took some finding, but think I've got it fixed

This will need an engine change to be used easily as need to be able to pass in a height factor reference per model relating to the model/heightmap being used - so e.g. an fpe entry such as heightmapfactor = 20, as some models will 'swim' or look flat without an adjust. There was another issue too with the tangent view vector, this seems to be OK now but if anyone has any other models with heightmaps they don't mind sharing just for me to test, that would be great. Don't want to pass it to Lee to review if it still has issues .

Cheers.

Attachments

Login to view attachments
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 4th Sep 2018 15:21
Very nice.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

lorddweeb
7
Years of Service
User Offline
Joined: 22nd Feb 2017
Location:
Posted: 4th Sep 2018 16:07
Very impressive work. Unfortunately I'm away from my modeling computer for about a week, but I'm interested in giving this a try when I'm back, whether it's still in testing or not.

It's exciting seeing you and Preben and others pushing GG forward.
PM
Earthling45
7
Years of Service
User Offline
Joined: 3rd Sep 2016
Location: Zuid Holland Nederland
Posted: 23rd Oct 2018 02:52 Edited at: 23rd Oct 2018 03:09


Lowering the stepsize does wonders, i was having a go again with parallax but had problems when viewing the assets from angles, more samples or lowering the heightscale did not solve that but after reading up on parallax mapping i read about lowering the stepsize as a way to solve these problems and it did.

Edit: added picture of the computer, also looks a lot better now.

Attachments

Login to view attachments
Earthling45
7
Years of Service
User Offline
Joined: 3rd Sep 2016
Location: Zuid Holland Nederland
Posted: 4th Nov 2018 18:51

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-20 15:30:21
Your offset time is: 2024-04-20 15:30:21