OpenB3D PBR Shader Demo

Started by Krischan, January 02, 2020, 00:03:18

Previous topic - Next topic

Krischan

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.

https://www.youtube.com/watch?v=sIriApU2x_8

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]
Metaverse | Blitzbasic Archive | My Github projects

Naughty Alien


Derron

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.

Krischan

> 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]
Metaverse | Blitzbasic Archive | My Github projects

iWasAdam

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 :)

Krischan

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]
Metaverse | Blitzbasic Archive | My Github projects

Derron

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

Krischan

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]
Metaverse | Blitzbasic Archive | My Github projects

Derron

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

Krischan

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]
Metaverse | Blitzbasic Archive | My Github projects

Derron

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

Qube

Wow! now that looks impressive. Very nice work indeed :)
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Steve Elliott

Some very nice work here, and what could be the beginnings of a very atmospheric dungeon-like game.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Krischan

Quote from: Steve Elliott on January 03, 2020, 10:01:14
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]
Metaverse | Blitzbasic Archive | My Github projects

Naughty Alien

I think Gabor could give you a hand, but he is probably busy elsewhere..