OpenB3D Vs. MiniB3D

Started by Kippykip, September 25, 2017, 18:54:27

Previous topic - Next topic

Kippykip

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

Krischan

#1
Decide yourself, this has been done with OpenB3D in Blitzmax:
https://www.youtube.com/watch?v=Fdxv3kRQDkQ
I've switched to OpenB3D several months ago.
Kind regards
Krischan

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

Kippykip

Holy shit, ok nevermind I'm switching too!

MagosDomina

Amazing results! That game has a nice atmosphere.

Steve Elliott

Yes great atmosphere in your game  8)
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

markcwm

I updated the Openb3d Readme to include a list of features.

QuoteI 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.

Kippykip

Quote from: markcwm on September 28, 2017, 02:23:21
I updated the Openb3d Readme to include a list of features.

QuoteI 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.

RonTek

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.

Kippykip

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.
'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

markcwm

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.

Kippykip

Quote from: markcwm on October 14, 2017, 17:58:46
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

RonTek

Quote from: Kippykip on October 24, 2017, 05:24:00
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.

markcwm

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".

Derron

QuoteAnd (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

markcwm

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.