D3d_set_lighting - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

Notation

Description

Sets whether or not to use lighting for rendering with any proceeding draw calls. If you do not set any lights using either d3d_light_define_point or d3d_light_define_direction and then enable them using d3d_light_enable everything rendered will be black except for the background color, unless of course you change the d3d_light_define_ambient function to use a different color to define darkness than using the default black.

Parameters

  • enable boolean value whether or not 3D lighting is currently used when rendering (true or false)

Return Values

No values are returned from the function.

Example Call

// Demonstrates drawing a cube with the current lighting settings then drawing one without any lighting using the same texture on each cube.
d3d_set_lighting(true);
d3d_draw_block(30, 30, -20, 70, 70, 20, background_get_texture(bg_example), 1, 1);
d3d_set_lighting(false);
d3d_draw_block(-20, -20, -20, 20, 20, 20, background_get_texture(bg_example), 1, 1);

NOTOC