OpenB3D Questions

Started by Krischan, January 04, 2019, 23:33:07

Previous topic - Next topic

Krischan

No Mark, I have to thank you. With OpenB3D, my project looks much better than all MiniB3D tests before. Optimizing the shader is a good idea, yes it is test.frag. I'm still not very good writing shaders and this one became complex. I'd like to have a shader style like in "Legend of Grimrock" (it looks very similar but the name is a coincidence and my game will work different than LOG), with nice lighting and shadows but I never achieved it, not even close. So more help is welcome and appreaciated.

As you can see in the test.frag I'm using Distance Fog, Tone Mapping, some kind of flashlight illumination/attenuation and a fake bumpmap to create depth. It looks somehow nice but is far away from a really good looking shader. And I had problems to make the shadows work with my level geometry.

I think another important point are very good normal textures, I'm using my own "Legend of Faerghail Normalmap Generator.bmx" to save time by converting a diffuse map into a normalmap, but all normalmap textures should be drawn by hand according to the diffuse map to have better detail (though my tool already creates nice results in a single mouseclick). To make it work again you must comment the "Import brl.d3d9max2d" and uncomment the "Import brl.glmax2d" line, I don't know what happened there (I'm getting a _d3dDev.Reset failed)

https://www.youtube.com/watch?v=_HnTeQFBIq0
Kind regards
Krischan

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

markcwm

Hi Krischan,

yes that does look awesome, much better than LOF. I have been kind of distracted getting multisample antialiasing (for Windows) running and fixing several bugs with ClearWorld, which is still not finished.

I think the soft shadows there are shader based, I was talking to RonTek about this and he posted some code which I'll try to convert to Openb3dmax, here's the link.

Qube

@Krischan - That looks really impressive and highly professional, 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.

Derron

Quote from: Qube on February 23, 2019, 23:20:01
@Krischan - That looks really impressive and highly professional, nice work indeed :)

Are you talking about the screenshots (Krischan's work) or the gameplay video (of another game) ?


bye
Ron

Qube

QuoteAre you talking about the screenshots (Krischan's work) or the gameplay video (of another game) ?
Krischan's work of course. I do know that LOG is not his :P. I kinda missed this thread and only just read through it.
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.

Krischan

Thanks Qube, you should see it in action (if it runs, see PM). But I didn't make any progress in the last months as Mark and I had to find out and fix some nasty OpenB3D bugs first, which is this topic about.

And without Mark, it would not exist in this form. So thanks again to Mark for OpenB3D at this point ;D
Kind regards
Krischan

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

Krischan

Quote from: markcwm on February 23, 2019, 23:12:20yes that does look awesome, much better than LOF.
Very true, but it hurts :P. To distinguish the two games better I've switched the name to "Faerghail" only. Faerghail already looks nice but it could look even nicer. Perhaps you have an idea how to pimp it.

Quote from: markcwm on February 23, 2019, 23:12:20I think the soft shadows there are shader based, I was talking to RonTek about this and he posted some code which I'll try to convert to Openb3dmax, here's the link.
Yes, Grimrock is using shaders for everything - and they have very nice and clean normalmaps (see attachment). For OpenB3D I would prefer a simple shadow solution that I could add to the game without having to rewrite much of it.
Kind regards
Krischan

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

Qube

#52
QuoteThanks Qube, you should see it in action (if it runs, see PM).
Thanks for the PM :) - I wasn't aware of the original but was that an Amiga emulator in an exe? lol, so cool. Where are such magics from? ( so behind the times )

I tried your other zip file in both VM and native boot but each one failed unfortunately. They both got as far as showing the screen res options > loading splash screen with compass and then an "EXPECTION_ACCESS_VIOLATION" error.

I only have Windows 7 via VM and Windows 10 as a native boot so if you want me to install any bits and pieces or debug stuff then feel free to send as much as you want :)

*edit* - The other exe's in the zip file for the maps and stuff appeared to run fine though.
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.

markcwm

Qube, it could be the shader code, it only runs in GL 2.1.

Krischan, yeah don't get me wrong I think the art in Faergail is fine but it needs nicer bumpmapping code, which would be correct angle calculations and less glossy, maybe the lighting is a bit better too.

Qube

QuoteQube, it could be the shader code, it only runs in GL 2.1.
Does that not work on Window 10?
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.

Krischan

#55
Qube, it should work on a native system but not in a VM, perhaps VMware but I don't own it. Which graphics card do you have: ATI/nVidia/Model? GPU RAM size? Here it is working on Windows 10 x64 Pro 1809 with a nVidia RTX 2080/8GB, Driver version 417.71 which is not the newest but still new enough.

And yes, the Amiga emulator is WinUAE (here the old version 3.4) which comes in a single exe today, I've only renamed it. The harddrive setup was complex but it runs very good and fast. You can restore an old savegame like "Aktuell" or "Schloss" which is inside the castle to see the difference between the original and Faerghail. But don't expect too much, this game is 30 years old now, this is "gaming stone age".

Mark, I know the bumpmapping is not correct, there is much room for improvements or we should use a complete new shader. I was starting with the bumpmap2.frag example, wasn't happy with it and rewrote everything to meet my needs. But writing shaders, I'm still a newbie. They are hard to debug and there are a lot of mathemetics and procedures inside I don't understand yet.
Kind regards
Krischan

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

Qube

Windows 10 is native and not VM. I tried native first and then a VM but both failed. I have a few games installed on Windows 10 so all needed bits should be present.

GPU is a Radeon RX580 8GB which should be up to the task :)
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.

Krischan

Then it must be the shader itself as I can't check the game on a ATI card here (I can only debug the shader source using the included glslangvalidator.exe which says it has some errors inside but works so far, at least on my rig). I decided to keep Intel+nVidia for my new rig as this combination never made any problems (even if it is much more expensive than AMD) and got rid of all AMD stuff years ago. Perhaps I'll buy a smaller rig with AMD/ATI only for my wife in the future to test the games there, but not yet.

However, you can change the EXE with the attached one, which is a recompile with the basic.frag shader which has no compilation errors, perhaps it works. But it looks not so good like the test shader. Or fix the shader bug to make it run with ATI and recompile it with BlitzmaxOS and the latest OpenB3D by yourself, the full source is included. ;D
Kind regards
Krischan

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

Qube

That one worked fine, thanks. Still looks really good without a fancy shader :)

QuoteI decided to keep Intel+nVidia for my new rig as this combination never made any problems (even if it is much more expensive than AMD)
Mine is a special Apple version in an iMac so it's super expensive for what it is :P
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.

Krischan

Good to hear that it works now. Looks like I have to put more effort into the shader QA. Ok, new release date for Faerghail is set to Fall 2059, after my funeral :o

I abandoned iMac after they decided to go for Intel+AMD, a bad combination IMHO - either one should use the overexpensive Intel+nVidia combo or go for the cheaper rebels from AMD instead. But don't mix it. And I still remember the problems I had back in 2001 with my Radeon 8500, never again, they've lost me as a customer forever.

My previous iMac was the Late 2013 (i7-4770+nVidia 780M) which is still a really good machine but after 5 years it became "too slow" for me (I know, first world problems :D) so I sold it and got my new rig which is really up to date now. And now as they'll go for ARM in the Macs, Apple is history to me. Good luck without Steve Jobs, I'm off.

If I want to take a look into Mojave I now start Virtualbox and there is my old system again (thanks to Disk2VHD) which is now encapsulated as a slave of Win10 :-D Was not that easy but it's working. But I'm working 99% on Windows, so it is merely a waste of SSD space, I've been just curious if it works.
Kind regards
Krischan

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