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 0 and 1.

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.

True results in GL_LINE being used, while False will result in GL_FILL being 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 by PengWindow.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.nearclip equals 0.1 and graphics.farclip equals 10000.

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 configvalue at runtime.

Mouse

controls.mouse.sensitivity

Degrees to move per pixel travelled 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, a and d, respectively.

controls.controls.jump

Jump key.

Defaults to space.

controls.controls.crouch

Crouch key.

Defaults to lshift.

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_draw and on_mouse_motion are never printed to avoid excessive outputs.

debug.events.logerr

If enabled, Exceptions catched during event handling are printed.

Note that only AttributeError exceptions are catched and printed, other exceptions will propagate further.

debug.events.register

If enabled, all event handler registrations are printed.

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