BlitzB3DExporter

From DeleDWiki

(Redirected from B3D)
Jump to: navigation, search

Blitz B3D Exporter Plugin

Contents

Installation

You can download the latest version of the exporter here.

Simply unzip the DLLs into the Plugin folder of your DeleD installation. The next time DeleD is started, the plugin will be loaded.

Usage

Invoke the plugin from the DeleD Plugin menu. The following window will appear:

image:Blitz3DExporter.png

Options

  • Filename: The name of the B3D file to export. Press the ... button to browse.
  • Texture Folder: The folder where the textures will be exported to. Can be either an absolute or a relative path (the exported B3D file will always contain a relative path). Leave blank to export the textures into the same location as the B3D.
  • Scale factor: You might want to adjust the scale of the mesh, so that it matches up with the rest of the scene when you load it into your target application here. If you want to make the imported object smaller, simply use fractional numbers (0.5, 0.001, etc).
  • Export Lightmaps: If you have lightmaps generated for your current map, but don't want to export them, turn this option off.
  • Export Texture Files: If this option is turned off, the physical texture files won't be exported with the mesh. You might want to use this when you replaced the textures in your target application, and don't want them to be overwritten with each export.
  • Export Texture Categories as Subfolders: Turn on this option to generate subfolders inside the texture folder for each texture category (Walls, Floors, Nature etc.). Only effective when the Export Texture Files option is checked.

The plugin will remember the options you last selected (it stores them in a .ini file).

If you press ok, the export will start. A progress bar will appear showing the export progress.

Experimental DOT3 normal mapping support

The current version of the exporter has experimental support for the DOT3 blend support inside B3D.

  • Add a normal map as a separate layer to any material inside DeleD
  • Using the tag/properties of that material, mark it as 'blendlayerX dot3', with 'X' the number of the normal map layer. For instance, 'blendlayer2 dot3' will mark layer 2 as the normal map.

This functionality is largely untested, and needs to be improved in future revisions of the exporter. Once DeleD gets native Normalmapping support, this particular functionality will become obsolete, and will be removed from the plugin.

Known Issues

  • The B3D exporter will probably not properly export materials containing more than 2 textures (provided by future DeleD versions). I am not sure at the moment wether the B3D file format supports this, and how.
  • Lightmap support (that is, truely importing lightmaps as a DeleD lightmap layer) is experimental. The importer only imports a brush texture as a lightmap when it is marked with flags '65585'. This is compatible with lightmaps from both the DeleD and the 3D World Studio B3D exporter.

Loading a Map in B3D

Graphics3D 1024,768 ;set this to your desktop resolution or whatever resolution you want

SetBuffer BackBuffer()

;load logo
logo=LoadImage("splash/logo.bmp") ;Your Game Logo
MidHandle logo
Cls
DrawBlock logo,GraphicsWidth()/2,GraphicsHeight()/2
Flip

Delay 3000

 ;load music
music=LoadSound("music/whatever.mp3") ;your bgm sound
If music
LoopSound music
mc=PlaySound(music)
EndIf

AntiAlias True
WBuffer True

 ;create camera
cam=CreateCamera()
CameraRange cam,1,70000
CameraZoom cam,1.4
RotateEntity cam,0,90,0
MoveEntity cam,0,550,0

mousespeed#=0.3
cameraspeed#=5
camerasmoothness#=5

 ;load level (b3d mesh)
map=LoadMesh("maps/temple.b3d")
If Not map RuntimeError "Failed to load map "+Chr(34)+mapfile+Chr(34)+"."
 ;ScaleEntity map,3,3,3

 ;load skydome
skydome=LoadMesh("domes/dome.b3d")
PositionEntity skydome,0,-50,0
ScaleEntity skydome,6000,6000,6000
FlipMesh skydome ;ensures the sky texture is painted to the inside of the ball

 ;make skydome bright
EntityFX skydome,1

While Not KeyHit(1)
   
RotateEntity skydome,0,0,0,1
   
 ;toggle wireframe enable value between true and false when spacebar is pressed
If KeyHit(57)=True Then enable=1-enable
   
 ;enable/disable wireframe rendering
WireFrame enable
   
 ;camera controls
mx#=CurveValue(MouseXSpeed()*mousespeed,mx,camerasmoothness)
my#=CurveValue(MouseYSpeed()*mousespeed,my,camerasmoothness)
MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
pitch#=EntityPitch(cam)
yaw#=EntityYaw(cam)
pitch=pitch+my
yaw=yaw-mx
If pitch>89 pitch=89
If pitch<-89 pitch=-89
RotateEntity cam,0,yaw,0
TurnEntity cam,pitch,0,0
   
cx#=(KeyDown(32)-KeyDown(30))*cameraspeed
cz#=(KeyDown(17)-KeyDown(31))*cameraspeed
MoveEntity cam,cx,0,cz

UpdateWorld()
RenderWorld()
Flip
Wend
   
Function CurveValue#(newvalue#,oldvalue#,increments )
If increments>1 oldvalue#=oldvalue#-(oldvalue#-newvalue#)/increments
If increments<=1 oldvalue=newvalue
Return oldvalue#
End Function

See also

Personal tools