There are three types of light sources in the Varwin library:

  • Spot light
  • Direct light
  • Point light
  • No light

All light sources are visible in the editor, but invisible in preview mode

Setting in the inspectorLink to Setting in the inspector

In the settings of the inspector, for all light sources the same parameters are set to change

  1. Color - set the color of the outgoing light

  2. Distance - the distance to which the light can travel at most

  3. intensity - sets the density of the incident light on a surface

  4. Shadows type - Parameter that affects the shadows of objects within the light range of this source. Among the available parameters of this block there are available:

    1. No shadows - Objects do not cast shadows

    2. Hard shadows - Objects cast clear shadows

    3. Soft shadows - The objects cast more blurred shadows than hard shadows

  5. Shadow strength - sets the intensity of shadows cast by objects

There is an additional setting in the Inspector for the floodlight, which regulates the angle of illumination by the given light source

SpotlightLink to Spotlight

The floodlight source shines, respectively, like a spotlight

Behaviors are defined for floodlighting:

  1. Spotlight angle - angle of light propagation from the spotlight

  2. Range of light - the distance over which light can spread to a maximum extent

  3. light intensity - sets the density of the incident light on a surface

  4. Shadow intensity - sets the intensity of casting shadows from objects

  5. Glow Color - sets the color of the outgoing light. To set the color, click on the color in the block and specify the color either in HEXA/RGBA/HSLA formats or in the palette. More about working with color

  6. Type of shadows - Parameter that affects the shadows of objects that are in the range of the light from this source. Among the available parameters of this block are available:

    1. No shadows - Objects do not cast shadows

    2. Hard shadows - Objects cast clear shadows

    3. Soft shadows - The objects cast more blurred shadows than hard shadows

Example of usageLink to Example of usage

In the standard project “Flying bot world” place a spotlight over the robot’s head

In the logic editor, assemble the following diagram. Note that in the last block the light is given a constant rotation along the Y-axis

Apply logic and run the project

Directional lightLink to Directional light

Directional light is a global light source, you can position it on stage like the sun. Its position and scale don’t matter, only its rotation - you can place it under the ground. It determines where the light will fall from

 


If the scene template already has a global light source, setting this will not affect the lighting

Behaviors are defined for directional light:

  1. light intensity - sets the density of incident light on a surface

  2. shadow intensity - sets the intensity of casting shadows from objects

  3. Glow Color - sets the color of the outgoing light. To set the color, click on the color in the block and specify the color either in HEXA/RGBA/HSLA formats or in the palette. More about working with color

  4. type of shadows - Parameter that affects the shadows of objects in the light range of this source. Among the available parameters of this block are available:

    1. No shadows - Objects do not cast shadows

    2. Hard shadows - Objects cast clear shadows

    3. Soft shadows - Objects cast more blurred shadows than hard shadows

Point lightLink to Point light

The point light, unlike the previous ones, shines in all directions at once - no matter what rotation you set it to

Behaviors are defined for point light:

  1. Range of light - the distance over which light can travel at most

  2. light intensity - sets the density of light falling on a surface

  3. Shadow intensity - sets the intensity of shadows cast by objects

  4. Glow Color - sets the color of the outgoing light. To set the color, click on the color in the block and specify the color either in HEXA/RGBA/HSLA formats or in the palette. More about working with color

  5. Type of shadows - Parameter that affects the shadows of the objects that are in the range of the light from this source. Among the available parameters of this block are available:

    1. No shadows - Objects do not cast shadows

    2. Hard shadows - Objects cast clear shadows

    3. Soft shadows - Objects cast more blurred shadows than hard shadows

Lack of lightLink to Lack of light