Configuration Options for peng3d¶
Almost all important settings can be configured per-window or globally via the Peng.cfg or Window.cfg attributes.
Graphic Settings/OpenGL Base State¶
For most of these graphical settings, it is important to actually use the exact type specified. For example, you should only pass floats and not integers if the specified type is float.
-
graphics.clearColor¶ A 4-tuple of RGBA colors used to clear the window before drawing.
Each Color part should be a float between
0and1.By default, this option is set to
(0.,0.,0.,1.).Be sure to verify that each value is a float, not an integer.
-
graphics.wireframe¶ A Boolean value determining the polygon-fill-mode used by OpenGL.
Trueresults inGL_LINEbeing used, whileFalsewill result inGL_FILLbeing used.This option can be used to create a wireframe-like mode.
The default value for this option is
False.Note
This option is always turned off by
PengWindow.set2d()but re-enabled byPengWindow.set3d()if necessary.
-
graphics.fieldofview¶ An float value passed to
gluPerspective()as the first argument.For more information about this config option, see the GL/GLU documentation.
By default, this option is set to
65.0.
-
graphics.nearclip¶ -
graphics.farclip¶ An float value specifying the near and far clipping plane, respectively.
These clipping planes determine at what point vertices are cut off to save GPU cycles.
By default,
graphics.nearclipequals0.1andgraphics.farclipequals10000.
Fog settings¶
-
graphics.fogSettings¶ Config()object storing the fog-specific settings.To access fog settings, use
peng.cfg["graphics.fogSettings"]["<configoption>"]as appropriate.
-
graphics.fogSettings["enable"]¶ A boolean value activating or deactivating the OpenGL fog.
By default disabled.
-
graphics.fogSettings["color"]¶ A 4-Tuple representing an RGB Color.
Note that the values should be 0<=n<=1, not in range(0,256).
For most cases, this value should be set to the clear color, else, visual artifacts may occur.
-
graphics.fogSettings["start"]¶ -
graphics.fogSettings["end"]¶ Defines start and end of the fog zone.
The end value should be nearer than the far clipping plane to avoid cut-off vertices.
Each value should be a float and is measured in standard OpenGL units.
By default, the fog starts at 128 units and ends 32 units further out.
Light settings¶
-
graphics.lightSettings¶ Config()object storing the light settings.To access light settings, use
peng.cfg["graphics.lightSettings"]["<configoption>"]as appropriate.
-
graphics.lightSettings["enable"]¶ A boolean value activating or deactivating the light config.
By default disabled.
Todo
Implement light settings with shader system
Controls¶
Note that most of these config values are read when the appropriate objects are initialized, this means that you should consult the objects documentation for how to change the option at runtime.
Mouse¶
-
controls.mouse.sensitivity¶ Degrees to move per pixel traveled by the mouse.
This applies to both horizontal and vertical movement.
Defaults to
0.15.
Keyboard¶
-
controls.controls.movespeed¶ Speed multiplier for most movements.
Defaults to
10.0.
-
controls.controls.verticalspeed¶ Speed multiplier for vertical movement.
Defaults to
5.0.
These keys are all registered with the mod flag set to False, thus they will ignore any modifiers.
-
controls.controls.forward¶ -
controls.controls.backward¶ -
controls.controls.strafeleft¶ -
controls.controls.straferight¶ Four basic movement keys.
Each of these keys can be changed individually.
Defaults are
w,s,aandd, respectively.
-
controls.controls.jump¶ Jump key.
Defaults to
space.
-
controls.controls.crouch¶ Crouch key.
Defaults to
lshift.
Commonly used Key Combination Configuration Values¶
-
controls.keybinds.common.copy¶ -
controls.keybinds.common.paste¶ -
controls.keybinds.common.cut¶ Key Combinations used to be used by various parts of the GUI.
Currently used by the
peng3d.gui.text.TextInput()Widget for basic clipboard operations.By default, these are set to the commonly used values of
Ctrl-Cfor Copy,Ctrl-Vfor Paste andCtrl-Xfor Cutting.
General Controls Configuration Values¶
-
controls.keybinds.strict¶ Whether or not keybindings should be strict.
See
peng3d.keybind.KeybindHandler()for more information.
Debug Options¶
All of these options are disabled by default.
-
controls.keybinds.debug¶ If enabled, all pressed keybinds will be printed.
-
debug.events.dump¶ If enabled, all events are printed including their arguments.
Note that
on_drawandon_mouse_motionare never printed to avoid excessive outputs.
-
debug.events.logerr¶ If enabled, Exceptions catched during event handling are printed.
Note that only
AttributeErrorexceptions are catched and printed, other exceptions will propagate further.
-
debug.events.register¶ If enabled, all event handler registrations are printed.
-
debug.events.dumpfile¶ If not an empty string, this should point to a valid file path for dumping all event names.
If enabled, all event handler registrations and event sends will be logged to this file. Note that only the name of the event without data is stored and automatically deduplicated.
Defaults to
"".
Resource Options¶
-
rsrc.enable¶ Enables or Disables the resource module.
By default enabled.
-
rsrc.basepath¶ Base directory of the Resource Manager.
By default determined via
pyglet.resource.get_script_home().
-
rsrc.maxtexsize¶ Maximum Texture size per bin.
Limits the texture in size, useful if the graphics card has big textures (16kx16k) but only few textures will be needed.
By default set to 1024.
Event Options¶
-
events.removeonerror¶ If True, automatically removes erroring event handlers. Note that the
raiseErrorsparameter takes precedent over this setting.Defaults to
True.
-
events.maxignore¶ An integer number defining the maximum amount of ignored event messages to write to the log file.
This setting is per event, not globally.
Defaults to 3.
Other Options¶
-
pyglet.patch.patch_float2int¶ Enables the float2int patch for pyglet.
See
peng3d.pyglet_patch.patch_float2int()for more information.Enabled by default.
Todo
Implement more config options