August 20, 2019, 12:43:21 AM

Author Topic: OpenB3D Vs. MiniB3D  (Read 3637 times)

Offline Kippykip

  • Jr. Member
  • **
  • Posts: 90
    • Kippykip Forums!
OpenB3D Vs. MiniB3D
« on: September 25, 2017, 06:54:27 PM »
Hey everyone!
I was just wondering about the 2 3D modules for BlitzMax.
Which one is the better module to use? As in, which one has the most Blitz3D commands?
I remember MiniB3D had some issues with the sprites and EntityFX fullbright, however it also had a Render to Texture feature too.
Is there any issues with OpenB3D?
Thanks! :)

Offline Krischan

  • Full Member
  • ***
  • Posts: 200
    • Krischan's Homepage
Re: OpenB3D Vs. MiniB3D
« Reply #1 on: September 25, 2017, 11:52:46 PM »
Decide yourself, this has been done with OpenB3D in Blitzmax:

I've switched to OpenB3D several months ago.
Kind regards
Krischan

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

Offline Kippykip

  • Jr. Member
  • **
  • Posts: 90
    • Kippykip Forums!
Re: OpenB3D Vs. MiniB3D
« Reply #2 on: September 26, 2017, 03:50:25 AM »
Holy shit, ok nevermind I'm switching too!

Offline MagosDomina

  • Full Member
  • ***
  • Posts: 121
    • Aspiring game developer website.
Re: OpenB3D Vs. MiniB3D
« Reply #3 on: September 27, 2017, 03:09:45 AM »
Amazing results! That game has a nice atmosphere.
Central hub for my Game Design related activities.
http://www.magosdomina.com/

Windows 7 PRO 64-bit, 48Gb RAM, CPU: Dual Hexacore Intel Xeon 3.33 GHZ, Nvidia Quadro 5800FX 4Gb x 2 SLI.

Online Steve Elliott

  • Hero Member
  • *****
  • Posts: 1916
Re: OpenB3D Vs. MiniB3D
« Reply #4 on: September 27, 2017, 09:10:45 AM »
Yes great atmosphere in your game  8)
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Mojave, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.1, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspbian Buster, pi4 4Gb RAM,1.5Ghz

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 397
Re: OpenB3D Vs. MiniB3D
« Reply #5 on: September 28, 2017, 02:23:21 AM »
I updated the Openb3d Readme to include a list of features.

Quote
I was just wondering about the 2 3D modules for BlitzMax.
Which one is the better module to use? As in, which one has the most Blitz3D commands?
I remember MiniB3D had some issues with the sprites and EntityFX fullbright, however it also had a Render to Texture feature too.
Is there any issues with OpenB3D?
There are more than 2, Irrlicht by gman for example. It depends what you want to do but if you want full-features Openb3d has most Blitz3d commands but it's not entirely bug-free yet. Could you explain more about sprites and EntityFX fullbright, maybe an example?

Openb3d has texture rendering and CameraToTex for rendering to a second camera. There are no major bugs, most commands work but some things don't. If you find a bug please report it to the Minib3d board.

Offline Kippykip

  • Jr. Member
  • **
  • Posts: 90
    • Kippykip Forums!
Re: OpenB3D Vs. MiniB3D
« Reply #6 on: September 28, 2017, 08:47:24 AM »
I updated the Openb3d Readme to include a list of features.

Quote
I was just wondering about the 2 3D modules for BlitzMax.
Which one is the better module to use? As in, which one has the most Blitz3D commands?
I remember MiniB3D had some issues with the sprites and EntityFX fullbright, however it also had a Render to Texture feature too.
Is there any issues with OpenB3D?
There are more than 2, Irrlicht by gman for example. It depends what you want to do but if you want full-features Openb3d has most Blitz3d commands but it's not entirely bug-free yet. Could you explain more about sprites and EntityFX fullbright, maybe an example?

Openb3d has texture rendering and CameraToTex for rendering to a second camera. There are no major bugs, most commands work but some things don't. If you find a bug please report it to the Minib3d board.
If I recall, sprites had an issue where they would simply be invisible when using some SpriteViewMode commands, and the EntityFullBright was affected by lights and wasn't fullbright or something.

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: OpenB3D Vs. MiniB3D
« Reply #7 on: September 28, 2017, 09:10:51 AM »
There are also bumpmapping issues with directional lighting. I think you should look into Adam's work with MiniB3D Monkey-X on how this is done properly.

Offline Kippykip

  • Jr. Member
  • **
  • Posts: 90
    • Kippykip Forums!
Re: OpenB3D Vs. MiniB3D
« Reply #8 on: October 14, 2017, 12:58:21 PM »
Well I ended up not using OpenB3D.
After a while on using it, I find it usually crashes with a 50/50 chance when loading the map. And for my big map, it crashes more like 95% of the time!
MiniB3D does not crash at all however so I'm going with that.
Wasn't going to use shaders anyway
However a couple functions I used in OpenB3D aren't in MiniB3D so I backported them for my project.
Code: [Select]
'Backported functions from Openb3d, but since that module is a bit buggy, I'm gonna stick with this minib3d.
Function ActMoveTo(TMP_Entity:TEntity, TMP_X:Float, TMP_Y:Float, TMP_Z:Float, TMP_Rate:Float)
Local dx:Float = TMP_X:Float - EntityX(TMP_Entity:TEntity)
Local dy:Float = TMP_Y:Float - EntityY(TMP_Entity:TEntity)
Local dz:Float = TMP_Z:Float - EntityZ(TMP_Entity:TEntity)
Local n:Float = Sqr(dx:Float * dx:Float + dy:Float * dy:Float + dz:Float * dz:Float)

If (n:Float < TMP_Rate:Float)
Return True
EndIf

TranslateEntity(TMP_Entity:TEntity, dx:Float / n:Float * TMP_Rate:Float, dy:Float / n:Float * TMP_Rate:Float, dz:Float / n:Float * TMP_Rate:Float)
Return False
End Function

Function ActTurnTo(TMP_Entity:TEntity, TMP_Pitch:Float, TMP_Yaw:Float, TMP_Roll:Float, TMP_Rate:Float)
Local dx:Float = TMP_Pitch:Float - EntityPitch(TMP_Entity:TEntity)
Local dy:Float = TMP_Yaw:Float - EntityYaw(TMP_Entity:TEntity)
Local dz:Float = TMP_Roll:Float - EntityRoll(TMP_Entity:TEntity)
Local n:Float = Abs(dx) + Abs(dy) + Abs(dz)

If (n:Float < TMP_Rate:Float)
Return True
EndIf

Local p:Float = dx / n * TMP_Rate + EntityPitch(TMP_Entity:TEntity)
Local y:Float = dy / n * TMP_Rate + EntityYaw(TMP_Entity:TEntity)
Local r:Float = dz / n * TMP_Rate + EntityRoll(TMP_Entity:TEntity)
RotateEntity(TMP_Entity:TEntity, p, y, r)
Return False
End Function

Also the sprite bugs and fullbright bugs seem to be fixed in MiniB3D now so I'm happy

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 397
Re: OpenB3D Vs. MiniB3D
« Reply #9 on: October 14, 2017, 05:58:46 PM »
Hi KippyKip, what sort of map are you using? Is it your own format? If you send me a copy by email I'll try to see what's wrong. Thanks.

Offline Kippykip

  • Jr. Member
  • **
  • Posts: 90
    • Kippykip Forums!
Re: OpenB3D Vs. MiniB3D
« Reply #10 on: October 24, 2017, 05:24:00 AM »
Hi KippyKip, what sort of map are you using? Is it your own format? If you send me a copy by email I'll try to see what's wrong. Thanks.
It seems the more models I make it load, the more it also crashes, it's hard to debug too as it just points to the LoadAnimMesh command. I'll send you an email.
The maps I'm using are maps exported in GZDoom builder and then re-exported in Milkshape 3D to the .B3D model format

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: OpenB3D Vs. MiniB3D
« Reply #11 on: October 24, 2017, 04:47:17 PM »
It seems the more models I make it load, the more it also crashes

You could also try loading each model once and just clone it or copy mesh for improved performance.

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 397
Re: OpenB3D Vs. MiniB3D
« Reply #12 on: October 25, 2017, 02:23:26 AM »
Hi,

Yes the Openb3d loaders are not too good although I thought the B3D loader was okay as it's ported from Minib3d. I only tested your models in Ubuntu and yes with the default LoadMesh commands all the models crash immediately.

With Minib3d it loads skybox and gm_construct but map31 crashes with the error "Unhandled exception: Attempt to index array element beyond array length" on line 589 "If tr_brush_id<>-1 Then surf.PaintSurface(brush:TBrush[tr_brush_id])" which could be fixed with "And (tr_brush_id>0 And tr_brush_id<brush_no)" I need to test this.

In Openb3d, there is now a native loader LoadMeshB3D (this is a temporary name, it will be renamed LoadMesh and a flag usenative will determine the loader) it seems to work for skybox and gm_construct but again map31 gives the same error at PaintSurface.

Then there is the Assimp wrapper loader which doesn't load animations yet but is otherwise finished. This worked for skybox and gm_construct but again map31 failed with a "nothing imported" message.

To use Assimp, just download and unzip, build with "bmk makemods openb3dlibs.assimp -a -w -g x64" then import it with "Framework Openb3d.B3dglgraphics" and "Import Openb3dLibs.Assimp" and call with aiLoadMesh instead of LoadMesh.

So what you can do with LoadMeshB3D is set it to debug with "TB3D.LOG_CHUNKS = 1" this shows for map31 that the model has about 136 brushes and the last surface (or tris) in the file has an invalid brush id "TRIS tr_brush_id=-127".

Offline Derron

  • Hero Member
  • *****
  • Posts: 2329
Re: OpenB3D Vs. MiniB3D
« Reply #13 on: October 25, 2017, 09:35:44 AM »
Quote
And (tr_brush_id>0 And tr_brush_id<brush_no)

If you talk about indices then ">= 0 ... <brush_no", if you are talking about numbers (index = number-1) then it should be ">0 ... <=brush_no".

At least this looks like a potential error...

bye
Ron

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 397
Re: OpenB3D Vs. MiniB3D
« Reply #14 on: October 25, 2017, 10:04:34 PM »
Hi,

I tested the file map31 and changed line 589 to just "If tr_brush_id>-1 Then surf..." which loads the file but textures are missing but there's nothing more I can do about it, the file will need edited. In B3Ds brush indexes can be any positive value an int can store.