Ooops
May 30, 2020, 04:17:52 PM

Author Topic: OpenB3D PBR Shader Demo  (Read 851 times)

Offline Krischan

  • Full Member
  • ***
  • Posts: 211
    • Krischan's Homepage
OpenB3D PBR Shader Demo
« on: January 02, 2020, 12:03:18 AM »
First: Happy New Year! Second: reports about my withdrawal from Blitzbasic are strongly exaggerated, I've had a lot of other things to do in 2019 ;D But recently I have been working intensively with Blender 2.8, PBR, GLSL and Substance. The result is a small demo which I would like to share with you. I have created a small video and some screenshots, have fun with it.



The shader already looks quite good but I'm sure I've made some mistakes. First, the spotlight effect doesn't look right. I've played around a lot with it but couldn't make it any better. Second I'm sure there is a problem with the Parallax Occlusion mapping as it is only barely noticeable. Perhaps there is a problem with the Tangent/Worldspace coordinates.

If you want to take a look at the source by yourself, you can download it here with all textures and precompiled executables to run the demos in 1920x1080 windows:
PBR_ShaderDemo.zip (20MB)

I would be very happy about any improvements and optimizations. ;) Oh, and Mark if you want you can use this or a simplified version of it in the OpenB3D demos.
Kind regards
Krischan

Windows 10 Pro | i7 9700K@ 3.6GHz | RTX 2080 8GB]
My Blitzbasic Archive | Extrasolar Project | My Github projects

Offline Naughty Alien

  • Hero Member
  • *****
  • Posts: 701
Re: OpenB3D PBR Shader Demo
« Reply #1 on: January 02, 2020, 01:49:38 AM »
very very nice man..

Offline Derron

  • Hero Member
  • *****
  • Posts: 2975
Re: OpenB3D PBR Shader Demo
« Reply #2 on: January 02, 2020, 09:38:58 AM »
Are the bugs you mention what is visible at 1:15 of the video (and around 3:00 too) ?

Looking good so far - albeit I think bricks in old castles won't be so shiny new - or glossy from being so wet. They are worn out / old - almost breaking apart into the material they were made of. Exception is "natural" stone - which would be "rough" nonetheless - and only shiny in the metal or quartz vains they have built in.

Maybe having "rocks" (for nice bump/normal - and maybe tesselation presentation) and metal doors would be better to show stuff - might look "more realistic" then.
Or create some "water puddles" for reflection.

Also interesting to look (PBR wise) is ICE - so something with a different IOR (frozen glass ... ice ...) or stuff like "glowing iron" (so a fireplace of a smith with some iron glowing in).

As you have dynamic lights - maybe you could fake some fire (particles + some emitting and slightly moving/wobbling objects - or nonfaked, emissive particles).


Maybe this gave you some ideas for 2020 :)


PS: Blender 2.82 (or 81) help with their denoiser - except you are using Eevee already because it might look more similar to your engine than a rendering not using "faked" effects like Eevee does.

Offline Krischan

  • Full Member
  • ***
  • Posts: 211
    • Krischan's Homepage
Re: OpenB3D PBR Shader Demo
« Reply #3 on: January 02, 2020, 01:48:24 PM »
> Are the bugs you mention what is visible at 1:15 of the video (and around 3:00 too)

Yes, that comes from the Parallax Occlusion function when you get too close to a wall - then the UVs are warped too much at very close distances. I think the function itself works, it must be something with the coordinate system.

I know that the bricks look artificial, it is very hard to find free suitable textures and I've just started working with Substance Designer, which is a very complex tool, so that's the best free texture I've found so far. I've started with my own textures from my game project and used the great tool Materialize to convert them to PBR and the results look quite good, but B2M3 from Substance and Substance Designer produce much better results (they are currently on sale in Steam if you don't like the subscription Adobe introduced). I think it is better to create the texture from the scratch instead of converting a photo, but it takes a lot of time.

The metal demo is just an extreme example how different the reflections become with a metallic texture still using the same shader. My next goal ist to include everything into my RPG game project.

And I'd be happy if somebody could review the shader code. It was a hard piece of work to put it all together and I still don't understand some details in it.
Kind regards
Krischan

Windows 10 Pro | i7 9700K@ 3.6GHz | RTX 2080 8GB]
My Blitzbasic Archive | Extrasolar Project | My Github projects

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1718
Re: OpenB3D PBR Shader Demo
« Reply #4 on: January 02, 2020, 03:22:01 PM »
be aware that Substance (designer and the rest) have been bought by Adobe and are no longer free. The current status of them is unsure as to whether Adobe will can them completely (absorbing the tech into photoshop, etc) or offer them as part of their monthly subscriptions.  :(
They will be discontinued from Steam at some stage - probably not too far in the future.

Very nice looking - add some shadows and you've got a winner :)

Offline Krischan

  • Full Member
  • ***
  • Posts: 211
    • Krischan's Homepage
Re: OpenB3D PBR Shader Demo
« Reply #5 on: January 02, 2020, 03:57:48 PM »
Regarding Substance: I know. The current steam version gets Updates until January 2021 and I don't need the source textures, which are not included if you go Steam. BUT: I've synchronized my Steam account with Substance and got separate license keys from them for each of their products I've bought, so I can install them without Steam. Let's see what will happen in one year.

Shadows: I tried to add the OpenB3D shadows but first it looks weird and the demo crashes soon. Something must be colliding with my shader as the shadows work without the shader applied and vice versa. Perhaps Mark can take a look at it.
Kind regards
Krischan

Windows 10 Pro | i7 9700K@ 3.6GHz | RTX 2080 8GB]
My Blitzbasic Archive | Extrasolar Project | My Github projects

Offline Derron

  • Hero Member
  • *****
  • Posts: 2975
Re: OpenB3D PBR Shader Demo
« Reply #6 on: January 02, 2020, 04:02:59 PM »
When were Substance products free?

For PBR there are some node setup tutorials to create PBR from single textures in Blender. So it might be useable to generate textures from it.
I remember the time when people draw in their scratches and cavity maps by hand instead of one-clicking in SP.


Bye
Ron

Offline Krischan

  • Full Member
  • ***
  • Posts: 211
    • Krischan's Homepage
Re: OpenB3D PBR Shader Demo
« Reply #7 on: January 02, 2020, 04:16:58 PM »
I think in a few years, Blender will become the main Open Source competitor for Substance. But not yet. After Adobe acquired Allegorithmic there were a lot of discussions. You can even discuss if it is worth to buy the Steam version(s) or go for subscription already (Steam: 233,61€ vs. 195,60€ subscription). And without a sale, Steam is even more expensive. But I don't like subscriptions and Steam is the only way to get a real license key at the moment, but with a one-year limited update plan.

I played a lot with Filter Forge and other tools but they are slow and the results are not so stunning like in Substance Designer. And I don't want to draw my textures only in Photoshop when it comes to PBR which needs the 3rd dimenson.
Kind regards
Krischan

Windows 10 Pro | i7 9700K@ 3.6GHz | RTX 2080 8GB]
My Blitzbasic Archive | Extrasolar Project | My Github projects

Offline Derron

  • Hero Member
  • *****
  • Posts: 2975
Re: OpenB3D PBR Shader Demo
« Reply #8 on: January 02, 2020, 05:53:19 PM »
There are no real counterparts for Substance Painter at the moment - some say one should use ArmorPaint:
https://armorpaint.org (downloads there are 16$)
https://github.com/armory3d/armorpaint (build it on your own or use one of the older releases there - for free)

If you really enjoy creating your own materials then ArmorPaint and its node based approach might be a joy for you. If you prefer "premade" materials with some knobs to adjust  then go with Substance Painter (I know you talk about Substance Designer). Both allow layer/mask based workflows.

I wished there was an FOSS alternative to SP - with an almost identical workflow/layout. But it won't happen as it does not happen for Photoshop (best chances for now is "Krita" - has more attention than Gimp).


bye
Ron

Offline Krischan

  • Full Member
  • ***
  • Posts: 211
    • Krischan's Homepage
Re: OpenB3D PBR Shader Demo
« Reply #9 on: January 02, 2020, 05:58:28 PM »
For Photoshop: ever tried https://www.photopea.com? Not exactly Photoshop, but a well done clone for free.
Kind regards
Krischan

Windows 10 Pro | i7 9700K@ 3.6GHz | RTX 2080 8GB]
My Blitzbasic Archive | Extrasolar Project | My Github projects

Offline Derron

  • Hero Member
  • *****
  • Posts: 2975
Re: OpenB3D PBR Shader Demo
« Reply #10 on: January 02, 2020, 06:06:28 PM »
Yes I tried that. It misses most of the vector part (it has shapes but vector manipulation is missing). Also disliking the "online" thing. Pressure sensitivity is something I did not get working with it too - albeit there seems to be support for it.

Will have to stay with my stone old PS for now ... via wine it sucks but has working pressure sensitivity. If I only do "mouse work" I prefer to run it in an old XP-VM as it does not have some window-manager-problems like in wine (tool panels behind main window) - or odd crashes.


bye
Ron

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 2372
Re: OpenB3D PBR Shader Demo
« Reply #11 on: January 03, 2020, 09:34:28 AM »
Wow! now that looks impressive. Very nice work indeed :)
Until the next time...

Online Steve Elliott

  • Hero Member
  • *****
  • Posts: 2452
Re: OpenB3D PBR Shader Demo
« Reply #12 on: January 03, 2020, 10:01:14 AM »
Some very nice work here, and what could be the beginnings of a very atmospheric dungeon-like game.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspberry pi 3 and 4.

Offline Krischan

  • Full Member
  • ***
  • Posts: 211
    • Krischan's Homepage
Re: OpenB3D PBR Shader Demo
« Reply #13 on: January 05, 2020, 09:11:29 AM »
Some very nice work here, and what could be the beginnings of a very atmospheric dungeon-like game.

I'm working on that. ;D Beside that: are there no GLSL shader experts here to take a look at my problems? I hardly dare to post the problem at khronos.org community as we're using a "dead" language and the legacy version 1.30 / OpenGL 2.0 pipeline in OpenB3D and the guys will probably laugh at me. ::)
Kind regards
Krischan

Windows 10 Pro | i7 9700K@ 3.6GHz | RTX 2080 8GB]
My Blitzbasic Archive | Extrasolar Project | My Github projects

Offline Naughty Alien

  • Hero Member
  • *****
  • Posts: 701
Re: OpenB3D PBR Shader Demo
« Reply #14 on: January 05, 2020, 09:14:14 AM »
I think Gabor could give you a hand, but he is probably busy elsewhere..

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal