Using IES files in GDL

IES – Illuminating Engineering Society – is an industry standard for photometric description of a light source. The used files have *.ies extension, and have ASCII encoding.

The GDL does not handle the *.ies files directly, it does not read information from them and does not check their validity. The processing of the photometric description files is done by the Cinema 4D rendering engine. For the rendering engine the names of the *.ies files should be given in the LIGHT command‘s “c4d_pho_file” parameter.

The IES files only contain information about the 3D dimsensions of the light. The following example shows a parametrisation of the LIGHT command with *.ies files:

! ======================================================================
! IES Sample Light
! ======================================================================

    dim c4dGenColor[3]
        c4dGenColor[1] = gs_color_red
        c4dGenColor[2] = gs_color_green
        c4dGenColor[3] = gs_color_blue

    ! The coordinate system of the Cinema 4D rendering engine differs from the 
    ! ARCHICAD coordinate system, therefore the following transformations are needed 
    ! to create a light with an illumination from top to bottom.

    rotz 90
    roty 90

    light               c4dGenColor[1],  ! to set the red component of the light
                        c4dGenColor[2],  ! to set the green component of the light
                        c4dGenColor[3],  ! to set the blue component of the light

        ! parameters for internal rendering engine
                        1,               ! Shadow on/off
                        0,               ! Light Cone Radius
                        0,               ! Angle 1 /maximum light/
                        0,               ! Angle 2 /angle faloff light/
                        0,               ! Angle Faloff
                        0,               ! Light Start
                        1,               ! Light Stop
                        0,               ! Distance Falloff

        ! parameters for Cinema4D rendering engine
                        ! to set general light type - (if there is no ies file loaded)
        ADDITIONAL_DATA c4d_gen_Type             = "Omni",

                        ! to set light color
                        c4d_gen_Color            = c4dGenColor,

                        ! to set strength of the light beam
                        c4d_gen_Intensity        = gs_light_intensity / 100,

                        ! to set near clipping of the light
                        c4d_det_NearClip         = 0,

                        ! to set far clipping of the light
                        c4d_det_FarClip          = 0,

                        ! to set distance of the light falloff
                        ! (if c4d_pho_Photometric = 0)
                        c4d_det_Radius           = 1,

                        ! to set falloff type
                        c4d_det_Falloff          = "InverseSquare",

                        ! to set area shape visible - (if c4d_pho_UseIESSize = 1)
                        c4d_det_ShowinRender     = 1,

                        ! to set area shape visible in reflection 
                        ! (if c4d_pho_UseIESSize = 1)
                        c4d_det_ShowinReflection = 1,

                        ! to set Use Intensity Given in Photometric File
                        c4d_pho_Photometric      = 1,

                        ! to set Use ies files - (must set 1)
                        c4d_pho_UseIES           = 1,

                        ! to set the file name of the ies (with .ies extension)
                        c4d_pho_File             = "*.IES",

                        ! to set Use Area Shape and Size
                        c4d_pho_UseIESSize       = 1

    del 2

TipsAndTricks_UseIESLight_Ex1

If separate area shape sizes are required instead of the sizes and shape given in *.ies file, the LIGHT command should have the following parametrisation:

! ======================================================================
! IES Sample Light
! ======================================================================

    dim c4dGenColor[3]
        c4dGenColor[1] = gs_color_red
        c4dGenColor[2] = gs_color_green
        c4dGenColor[3] = gs_color_blue

    rotz 90
    roty 90

    light               c4dGenColor[1],  ! to set the red component of the light
                        c4dGenColor[2],  ! to set the green component of the light
                        c4dGenColor[3],  ! to set the blue component of the light

        ! parameters for internal rendering engine
                        bGenShadow,      ! Shadow on/off
                        0,               ! Light Cone Radius
                        0,               ! Angle 1 /maximum light/
                        0,               ! Angle 2 /angle faloff light/
                        0,               ! Angle Faloff
                        0,               ! Light Start
                        c4DetRadius,     ! Light Stop
                        0,               ! Distance Falloff

        ! parameters for Cinema4D rendering engine
                        ! to set general light type - (if there is no ies file loaded)
        ADDITIONAL_DATA c4d_gen_Type             = "Omni",

                        ! to set light color
                        c4d_gen_Color            = c4dGenColor,

                        ! to set strength of the light beam
                        c4d_gen_Intensity        = gs_light_intensity / 100,

			! to set separate area shape
			c4d_det_AreaShape	 = "Cube",

			! to set separate area shape "X" size
			c4d_det_AreaX		 = 0.5,

			! to set separate area shape "Y" size
			c4d_det_AreaY		 = 0.5,

			! to set separate area shape "Z" size
			c4d_det_AreaZ		 = 0.5,

                        ! to set near clipping of the light
                        c4d_det_NearClip         = 0,

                        ! to set far clipping of the light
                        c4d_det_FarClip          = 0,

                        ! to set distance of the light falloff
                        ! (if c4d_pho_Photometric = 0)
                        c4d_det_Radius           = 1,

                        ! to set falloff type
                        c4d_det_Falloff          = "InverseSquare",

                        ! to set area shape visible - (if c4d_pho_UseIESSize = 1)
                        c4d_det_ShowinRender     = 1,

                        ! to set area shape visible in reflection 
                        ! (if c4d_pho_UseIESSize = 1)
                        c4d_det_ShowinReflection = 1,

                        ! to set Use Intensity Given in Photometric File
                        c4d_pho_Photometric      = 1,

                        ! to set Use ies files - (must set 1)
                        c4d_pho_UseIES           = 1,

                        ! to set the file name of the ies (with .ies extension)
                        c4d_pho_File             = "*.IES",

                        ! to set Use Area Shape and Size
                        c4d_pho_UseIESSize       = 1

    del 2

TipsAndTricks_UseIESLight_Ex2