(→Using bug plug) |
|||
| Line 14: | Line 14: | ||
This will load the bug plugin. | This will load the bug plugin. | ||
| + | |||
| + | If you want to use '''''bug plug''''' in your own applications you can use -plugin=bugplug on the commandline. | ||
Revision as of 12:05, 27 July 2007
Contents |
Using bug plug
The bug plug is a great feature in CS, to easily debug and tweak your 3d world. You can use it, like any other plugin. Just load and register it.
First start walktest for this example, because the castle map will be perfect for this lesson. When walktest has loaded completly, type into the walktest console:
bugplug
This will load the bug plugin.
If you want to use bug plug in your own applications you can use -plugin=bugplug on the commandline.
How it works
The bug plug is in action, when you can see the current fps (frames per second) on the lower left side of screen:
But, bug plug can do more than just displaying the actual framerate.
Press the ctrl+D keys, to see this message:
Now push ‘e’ key on your keyboard, to switch to the wireframe mode:
So the bug plug shows you the wireframe of the rendered meshes. Nice.
At any time, you can take a screenshot with the key combinations: ctrl+D, and F11. The bug plug saves the screenshot in png format into your CS directory (by default, this can be changed) . The first image will be named crystalspace000.png, then crystalspace001.png and so on. The plugin handles the correct numbering automatically, so be not afraid, you never overwrite your previously saved screenshots. When you need a really high resolution screenshot (an “überscreenshot”), press ctrl+D then shift+F11. It will make a 2048*1536 screenshot, I hope, this will satisfy your needs.
Working with meshes
When you press ctrl+s, you can select meshes with mouse click. Just try it now. Press ctrls+s, and click on a simphatic mesh. The result will be something like this:
You can select any mesh in the loaded map file. The following example uses the castle map. Run walktest, then do the following:
Go to the table in the castle level:
Now press ctrl+s, and click on the table. The result should look like this:
Now we can move this mesh with some bug plug key. Press ctrl+D, then shift+Page up keys. The mesh will move 1 unit in Z direction (Z coordinate will be increased by one unit).
The other moving keys are:
shift+Up increase y coordinate by 1 unit
shfit+Down decrease_y coordinate by 1 unit
shift+Left decrease_x coordinate by 1 unit
shift+Right increase_x coordinate by 1 unit
shift+ Page Up increase _z coordinate by 1 unit
Shift+ Page down decrease z coordinate by 1 unit
Note, you can save the changes by pressing ctrl+D then ctrl+F10 keys.
You can hide your selected mesh with the ‘h ‘ debug key: (press ctrl+D, then ‘h’ key):
To undo hide, press shift+h after ctrl+D.
Now go right to the burning torches:
Press ctrl+S, then click on the torch on the wall.
Look around, and you will see, you selected a great box, that includes four torches. Now when you press ctrl+D, then ctrl+alt+C, you will see the colliding triangles:
So you can see, the four torches have been exported by one mesh.
Other possibilities
Bug plug can you show any sector with another colour. Press ctrl+D, then ctrl+shift+C, to get a result like this. (the shot was taken form a point, where three sectors are visible):
You can edit the camera field of view value. Press the f key, then type in a new value.
The b key enables/disables the bounding box display, r does the same with the radial meshes.
Configuring bug plug
Bug plug has two configuration files in the CS/data/config directory. The bugplug.cfg has the following contents:
; file, where the key bindings are stored Bugplug.Keybindings = /config/bugplug.key ; format of the screenshot filename ; the rightmost string of digits is automatically replaced with a number Bugplug.Capture.FilenameFormat = /this/crystal000.png ; MIME type of the screenshot image to save Bugplug.Capture.Image.MIME = image/png ; image saver options for the screenshot file Bugplug.Capture.Image.Options = progressive
The Bugplug.Capture.FilenameFormat key gives the format of the screenshot picture names. When you add the scrshot000.png format, the bug plug will save your screenshots with this naming form (scrshot000,png, scrshot001.png) . The Bugplug.Capture.Image.MIME = image/png key stores the format of the screenshots. You can change it to any image format, that Crystal Space can handle (jpg, tga, bmp, etc).
The second config file has the name bugplug.key. It is a simple text file, which has this (default) content:
ctrl-d=debugenter ctrl-s=mouseenter d=dumpeng shift-d=dumpsec e=edges c=clear ctrl-shift-c=colorsectors alt-c=cacheclear alt-d=cachedump t=texture l=lighting shift-g=gouraud shift-m=mmx shift-t=transp ctrl-b=bilinear ctrl-t=trilinear ctrl-l=ilace m=mipmap shift-i=inter g=gamma alt-b=dblbuff shift-c=dumpcam f=fov shift-f=fovangle alt-t=terrvis b=meshbbox r=meshrad ctrl-alt-c=meshcd ctrl-alt-v=meshvis ctrl-alt-s=meshshad ctrl-alt-b=meshbase ctrl-g=debuggraph ctrl-c=enginecmd toggle_cullstat shift-e=enginestate v=visculview shift-v=visculcmd cycle_view ctrl-v=visculcmd clear_stats alt-v=visculcmd dump_state alt-a=visculcmd analyze_vis 1=visculcmd toggle_frustum 2=visculcmd toggle_coverage 3=visculcmd toggle_history 4=visculcmd toggle_queue 5=visculcmd toggle_vpt 6=visculcmd toggle_ignoresmall 7=visculcmd toggle_clampoccluder 8=visculcmd toggle_splatting 9=visculcmd toggle_invertedclipper 0=visculcmd toggle_ignorebadoccluder shift-1=visculcmd origin_z -- shift-2=visculcmd origin_z ++ shift-3=visculcmd setup_debugsector shift-4=visculcmd navigate_child1 shift-5=visculcmd navigate_child2 shift-6=visculcmd navigate_parent shift-s=debugsector shift-up=mesh_yplus shift-down=mesh_ymin shift-left=mesh_xmin shift-right=mesh_xplus shift-pgup=mesh_zplus shift-pgdn=mesh_zmin up=ds_forward down=ds_backward left=ds_turnleft right=ds_turnright alt-up=ds_up alt-down=ds_down alt-left=ds_left alt-right=ds_right alt-s=debugview s=visculcmd setup_debugview alt-f=visculcmd toggle_freeze ctrl-f=visculcmd exact_freeze f10=savemap ctrl-f10=savemap f11=scrshot ctrl-f11=scrshot shift-f11=uberscreenshot f12=scrshot ctrl-f12=scrshot ctrl-alt-p=fps h=hideselected shift-h=undohide ctrl-p=counterreset alt-p=counterremove shift-p=counterfreeze w=shadowdebug alt-u=unprepare ctrl-m=memorydump p=profdump ctrl-shift-p=profreset ctrl-shift-s=debugcmd iGraphics3D dump_slms ctrl-shift-v=debugcmd iGraphics3D dump_vbostat ctrl-shift-f=debugcmd iGraphics2D dump_fontcache ctrl-shift-z=debugcmd iGraphics3D dump_zbuf ctrl-shift-1=switchculler crystalspace.culling.frustvis ctrl-shift-2=switchculler crystalspace.culling.dynavis ctrl-alt-m=selectmesh ctrl-alt-o=onesector ctrl-alt-l=listplugins
So you can change the key bindings of the debug commands here.
I hope, this short introduction will help you to understand the basics of the usage of bug plug. Just press ctrl+D, and enjoy...













