View Categories

IES Işık

3 dakika okuma

giriiş #


Bu bölümde, V-Ray’de bulunan en fotogerçekçi ışıklardan biri olan IES ışığını ele alacağız. IES, Aydınlatma Mühendisliği Topluluğu anlamına gelir. Eklenti, şekli değiştirilebilen bir .IES profili aracılığıyla tanımlanan ölçülmüş gerçek dünya ışıklarını uygular. .IES profili genellikle gerçek bir ışık kaynağından yayılan ışığın şeklini ve yönünü (genellikle dağılımını) temsil eder. Biçim ayrıca gerçek yoğunluk, mesafe zayıflaması ve renk sıcaklığı hakkında bilgi içerir. Birçok .IES dosyası, üreticiler tarafından çevrimiçi olarak sağlanabilir.

Işık ve ışık üniteleri #


  • Işık şiddeti – kandela :
    Bir ışık kaynağının belirli bir yönde birim katı açı başına yaydığı, dalga boyu ağırlıklı güç.

  • Işık akısı – lümen :
    lm = cd·sr (bir steradyanlık katı açı üzerinde bir kandela ışık şiddeti)

  • Aydınlatma şiddeti – lüks :
    lx = lm/m2

  • Parlaklık – cd/m2 (nit) :
    Belirli bir yönde ilerleyen ışığın birim alan başına düşen ışık şiddeti


Ölçüm #


Uzak alan fotometrisi #

Işığın noktasal bir kaynak olduğu varsayılır. Bu, goniophotometre adı verilen cihazlarla gerçekleşir. İlk goniophotometreler, ışık kaynağı etrafında 360 derece döndürülen bir ışık sensörü kullanıyordu. Ölçüm için üç standart vardır: Tip A, Tip B, Tip C. Hepsi aynı dosya türüyle sonuçlanır. Ölçüm sonucu toplam ışık akısıdır.

Yakın alan fotometrisi #

Işık kaynağının şeklini dikkate alır. Bunu sağlamanın bir yolu, sensörün ışık kaynağına daha yakın olmasıdır. Diğer yöntemler genellikle pratik kullanım için çok büyük dosyalar üretir.

Bağıl ve mutlak fotometri #

  • Bağıl fotometri  – ışık şiddeti dağılımı, toplam ışık akısına göre ölçeklendirilir.

  • Mutlak fotometri  – toplam ışık akısı mevcut değildir.

Daha fazla okuma #


IES formatını detaylı olarak ele almayacağız, ancak fotometrik rapor formatı hakkında daha fazla bilgiyi aşağıdaki makalede bulabilirsiniz:

“IES LM-63-1986: Fotometrik Verilerin Elektronik Aktarımı için IES Tarafından Önerilen Standart Dosya Formatı.” 1991, 1995, 2001, 2002 yıllarında revize edilmiştir. ANSI/IESNA LM-63-02

Kullanılabilecek diğer standartlar arasında  CIBSE TM14:1988 ve  EULUMDAT yer almaktadır .

Konuyla ilgili daha fazla bilgi için, Ian Ashdown, P. Eng., LC, FIES tarafından yazılan ve LIGHTFAIR 2001 Ön Konferans Çalıştayında yayınlanan “Fotometrik Düşünme” başlıklı makaleyi arayabilirsiniz.

Parametreler #


IES ışıkları, genel ışık parametrelerinin yanı sıra aşağıdaki özel LightIES eklentisi parametrelerinden de etkilenir :

  • ies_file  – Işık kaynağını tanımlayan dosyanın yolu

  • filter_color  – Işığı renklendirmek için kullanılır. Varsayılan değer beyazdır (1.0, 1.0, 1.0). Işık rengi, IES dosyasındaki renk sıcaklığı ile tanımlanır.

  • soft_shadows  – Noktasal ışık olarak sert gölgeler oluşturmak için 0 (varsayılan) olarak ayarlayın; gölgeler için ışığın şeklini kullanmak için 1; aydınlatma için de şekli kullanmak için 2 olarak ayarlayın.

  • güç  – Dosyada belirtilen gücü, 0’dan büyükse geçersiz kılar. Birimi lümendir.

  • ies_light_shape  – Değeri ≥ 0 olarak ayarlanırsa dosyadaki şekli geçersiz kılar. Olası numaralandırılmış değerler: aşağıdaki tabloya bakın.

  • ies_light_width  – ies_light_shape geçersiz kılma özelliği etkinleştirildiğinde kullanılır.

  • ies_light_length  – ies_light_shape geçersiz kılma özelliği açık olduğunda kullanılır.

  • ies_light_height  – ies_light_shape geçersiz kılma özelliği etkinleştirildiğinde kullanılır.

  • ies_light_diameter  – ies_light_shape geçersiz kılma özelliği açık olduğunda kullanılır.

Olası şekil değerlerini ve parametre kısıtlamalarını gösteren tablo aşağıdadır:

Şekil

Genişlik

Uzunluk

Yükseklik

Çap

0=puan

0

0

0

0

1=dikdörtgen

≥ 0

≥ 0

0

0

2=çember

0

0

0

< 0

3=küre

0

0

0

< 0

4=dikey silindir

0

0

> 0

< 0

5 = yatay silindir (uzunluk)

0

> 0

0

< 0

6 = yatay silindir (genişlik)

> 0

0

0

< 0

7=elips (uzunluk)

< 0

> 0

0

0

8=elips (genişlik)

> 0

< 0

0

0

9=elipsoid (uzunluk)

< 0

> 0

< 0

0

10=elipsoid (genişlik)

> 0

< 0

< 0

0

Örnek #


Aşağıdaki kod, AppSDK kurulum paketinde yer alan scenes/assets klasöründeki örnek IES dosyasını kullanmaktadır:

# Compatibility with Python 2.7.
from __future__ import print_function
 
# The directory containing the vray shared object should be present in the PYTHONPATH environment variable.
# Try to import the vray module from VRAY_SDK/python, if it is not in PYTHONPATH
import sys, os
VRAY_SDK = os.environ.get('VRAY_SDK')
if VRAY_SDK:
    sys.path.append(os.path.join(VRAY_SDK, 'python'))
import vray
 
SCENE_PATH = os.path.join(os.environ.get('VRAY_SDK'), 'scenes')
# Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
os.chdir(SCENE_PATH)
 
# The renderer is automatically closed after the `with` block.
with vray.VRayRenderer() as renderer:
    # Register a simple log callback. Always useful for debugging.
    def dumpMsg(renderer, message, level, instant):
        if level == vray.LOGLEVEL_ERROR:
            print("[ERROR]", message)
        elif level == vray.LOGLEVEL_WARNING:
            print("[Warning]", message)
        elif level == vray.LOGLEVEL_INFO:
            print("[info]", message)
        # Uncomment for testing, but you might want to ignore these in real code
        #else: print("[debug]", message)
    renderer.setOnLogMessage(dumpMsg)
    # Load scene from a file.
    renderer.load(os.path.join(SCENE_PATH, 'lighting.vrscene'))
    # Remove original light source from the scene.
    del renderer.plugins["VRayLightDomeShape1"]
    # LightIES is a light source plugin that can be used to create physically accurate area lights 
    # from .IES files produced by metering real life light fixtures.
    # It also allows specifying a simple custom shape like a cylinder or box.
    light = renderer.classes.LightIES()
    # Specify the light position, rotation and scale.
    light.transform = vray.Transform(
        vray.Matrix(
            vray.Vector(0.9745879, 0.2240055, 0),
            vray.Vector(1.110223e-016, -4.440892e-016, -1),
            vray.Vector(-0.2240055, 0.9745879, -4.440892e-016)),
        vray.Vector(227.955764705938, 112.5306789507133, 112.2503672299417))
    # Specify the color of the light in RGB float values and alpha(1.0f)
    light.color = vray.AColor(0.712, 0.9335393, 1)
    # Specify the path to the .IES file to use for the light.
    light.ies_file = os.path.join(SCENE_PATH, 'assets', 'IES_Example_3.IES')
    # Multiplies the light color and intensity. (Can be used as an intensity control).
    light.filter_color = vray.Color(4, 4, 4)
    # Override the shape of the light.
    # Depending on the shape of the light some of the following properties have to be specified:
    #   ies_light_width - Light shape width in metres.
    #   ies_light_height - Light shape height in metres.
    #   ies_light_length - Light shape length in metres.
    #   ies_light_diameter - Light shape diameter in metres.
    # Possible values are:
    #  -1 (default shape from IES file) - default
    #   0 (Point)
    #   1 (Rectangular)
    #   2 (Circular)
    #   3 (Sphere)
    #   4 (Vertical Cylinder)
    #   5 (Horizontal cylinder oriented along lum.lenght)
    #   6 (Horizontal cylinder oriented along lum.width)
    #   7 (Ellipse oriented along lum.lenght)
    #   8 (Ellipse oriented along lum.width)
    light.ies_light_shape = 0
    # Specify shadow offset from the surface. Helps to prevent polygonal shadow artifacts on low-poly surfaces.
    light.shadowBias = 0.02
    # Specify that the bumped normal should be used to check if the light direction is below the surface.
    light.bumped_below_surface_check = True
    # Start rendering.
    renderer.startSync()
    # Wait for rendering to end.
    renderer.waitForRenderEnd()
#define VRAY_RUNTIME_LOAD_PRIMARY
 
#include "vraysdk.hpp"
#include "vrayplugins.hpp"
#include "utils.h"
 
using namespace VRay;
using namespace VRay::Plugins;
using namespace std;
 
const char *BASE_PATH = getenv("VRAY_SDK");
string SCENE_PATH = (BASE_PATH ? string(BASE_PATH) : string(".")) + PATH_DELIMITER + "scenes";
 
int main() {
// Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
changeCurrentDir(SCENE_PATH.c_str());
// Load V-Ray SDK library.
VRayInit init(NULL, true);
// Create an instance of VRayRenderer with default options.
// The renderer is automatically closed at the end of the current scope.
VRayRenderer renderer;
// It's recommended to always have a console log
renderer.setOnLogMessage(logMessage);
// Load scene from a file.
renderer.load("lighting.vrscene");
// Remove original light source from the scene.
renderer.deletePlugin("VRayLightDomeShape1");
// LightIES is a light source plugin that can be used to create physically accurate area lights 
// from .IES files produced by metering real life light fixtures.
// It also allows specifying a simple custom shape like a cylinder or box.
LightIES light = renderer.newPlugin<LightIES>();
// Specify the light position, rotation and scale.
light.set_transform(Transform(
Matrix(
Vector(0.9745879, 0.2240055, 0.0),
Vector(1.110223e-016, -4.440892e-016, -1.0),
Vector(-0.2240055, 0.9745879, -4.440892e-016)),
Vector(227.955764705938, 112.5306789507133, 112.2503672299417)));
// Specify the color of the light in RGB float values and alpha(1.0f)
light.set_color(AColor(0.712, 0.9335393, 1.0));
// Specify the path to the .IES file to use for the light.
light.set_ies_file("assets/IES_Example_3.IES");
// Multiplies the light color and intensity. (Can be used as an intensity control).
light.set_filter_color(Color(4.0, 4.0, 4.0));
// Override the shape of the light.
// Depending on the shape of the light some of the following properties have to be specified :
//   ies_light_width - Light shape width in metres.
//   ies_light_height - Light shape height in metres.
//   ies_light_length - Light shape length in metres.
//   ies_light_diameter - Light shape diameter in metres.
// Possible values are :
//  -1 (default shape from .IES file) - default
//   0 (Point)
//   1 (Rectangular)
//   2 (Circular)
//   3 (Sphere)
//   4 (Vertical Cylinder)
//   5 (Horizontal cylinder oriented along lum.lenght)
//   6 (Horizontal cylinder oriented along lum.width)
//   7 (Ellipse oriented along lum.lenght)
//   8 (Ellipse oriented along lum.width)
light.set_ies_light_shape(0);
// Specify shadow offset from the surface. Helps to prevent polygonal shadow artifacts on low-poly surfaces.
light.set_shadowBias(0.02f);
// Specify that the bumped normal should be used to check if the light direction is below the surface.
light.set_bumped_below_surface_check(true);
// Start rendering.
renderer.startSync();
// Wait for rendering to end.
renderer.waitForRenderEnd();
return 0;
}
using System;
using System.IO;
using VRay;
using VRay.Plugins;
 
namespace _05_ies
{
    class Program
    {
        static void Main(string[] args)
        {
            string SCENE_PATH = Path.Combine(Environment.GetEnvironmentVariable("VRAY_SDK"), "scenes");
            // Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
            Directory.SetCurrentDirectory(SCENE_PATH);
 
            // Create an instance of VRayRenderer with default options. The renderer is automatically closed after the `using` block.
using (VRayRenderer renderer = new VRayRenderer())
            {
                // Add a listener for any type of log message.
                renderer.LogMessage += new EventHandler<MessageEventArgs>((source, e) =>
                {
                    // You can remove the if for testing, but you might want to ignore Debug in real code
                    if (e.LogLevel != LogLevelType.Debug)
                    {
                        Console.WriteLine(String.Format("[{0}] {1}", e.LogLevel.ToString(), e.Message));
                    }
                });
                // Load scene from a file.
                renderer.Load("lighting.vrscene");
                // Remove original light source from the scene.
                renderer.DeletePlugin("VRayLightDomeShape1");
                // LightIES is a light source plugin that can be used to create physically accurate area lights 
                // from .IES files produced by metering real life light fixtures.
                // It also allows specifying a simple custom shape like a cylinder or box.
                LightIES light = renderer.NewPlugin<LightIES>();
                // Specify the light position, rotation and scale.
                light.Transform = new Transform(
                    new Matrix(
                        new Vector(0.9745879, 0.2240055, 0),
                        new Vector(1.110223e-016, -4.440892e-016, -1),
                        new Vector(-0.2240055, 0.9745879, -4.440892e-016)),
                    new Vector(227.955764705938, 112.5306789507133, 112.2503672299417));
                // Specify the color of the light in RGB float values and alpha = 1.
                light.Color = new AColor(0.712, 0.9335393, 1);
                // Specify the path to the .IES file to use for the light.
                light.IesFile = Path.Combine("assets", "IES_Example_3.IES");
                // Multiplies the light color and intensity. (Can be used as an intensity control).
                light.FilterColor = new Color(4, 4, 4);
                // Override the shape of the light.
                // Depending on the shape of the light some of the following properties have to be specified:
                //   ies_light_width - Light shape width in metres.
                //   ies_light_height - Light shape height in metres.
                //   ies_light_length - Light shape length in metres.
                //   ies_light_diameter - Light shape diameter in metres.
                // Possible values are:
                //  -1 (default shape from IES file) - default
                //   0 (Point)
                //   1 (Rectangular)
                //   2 (Circular)
                //   3 (Sphere)
                //   4 (Vertical Cylinder)
                //   5 (Horizontal cylinder oriented along lum.lenght)
                //   6 (Horizontal cylinder oriented along lum.width)
                //   7 (Ellipse oriented along lum.lenght)
                //   8 (Ellipse oriented along lum.width)
                light.IesLightShape = 0;
                // Specify shadow offset from the surface. Helps to prevent polygonal shadow artifacts on low-poly surfaces.
                light.ShadowBias = 0.02F;
                // Specify that the bumped normal should be used to check if the light direction is below the surface.
                light.BumpedBelowSurfaceCheck = true;
                // Specify the number of parameter samples for motion blur.
                light.Nsamples = 1;
                // Start rendering.
                renderer.StartSync();
                // Wait for rendering to end.
                renderer.WaitForRenderEnd();
            }
        }
    }
}
var path = require('path');
var vray = require(path.join(process.env.VRAY_SDK, 'node', 'vray'));
 
var SCENE_PATH = path.join(process.env.VRAY_SDK, 'scenes');
// Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
process.chdir(SCENE_PATH);
 
// Create an instance of VRayRenderer with default options.
var renderer = vray.VRayRenderer();
// It's recommended to always have a console log callback
renderer.on("logMessage", function(message, level, instant) {
if (level == vray.LOGLEVEL_ERROR)
console.log("[ERROR] ", message);
else if (level == vray.LOGLEVEL_WARNING)
console.log("[Warning] ", message);
else if (level == vray.LOGLEVEL_INFO)
console.log("[info] ", message);
// Uncomment for testing, but you might want to ignore these in real code
//else console.log("[debug] ", message);
});
// Load scene from a file asynchronously.
renderer.load("lighting.vrscene", function(err) {
    if (err) throw err;
    // Remove original light source from the scene.
    delete renderer.plugins["VRayLightDomeShape1"];
    // LightIES is a light source plugin that can be used to create physically accurate area lights
    // from .IES files produced by metering real life light fixtures.
    // It also allows specifying a simple custom shape like a cylinder or box.
    var light = renderer.classes.LightIES();
    // Specify the light position, rotation and scale.
    light.transform = vray.Transform(
        vray.Matrix(
            vray.Vector(0.9745879, 0.2240055, 0),
            vray.Vector(1.110223e-016, -4.440892e-016, -1),
            vray.Vector(-0.2240055, 0.9745879, -4.440892e-016)),
        vray.Vector(227.955764705938, 112.5306789507133, 112.2503672299417));
    // Specify the color of the light in RGB float values and alpha(1.0f)
    light.color = vray.AColor(0.712, 0.9335393, 1);
    // Specify the path to the .IES file to use for the light.
    light.ies_file = path.join(SCENE_PATH, 'assets', 'IES_Example_3.IES');
    // Multiplies the light color and intensity. (Can be used as an intensity control).
    light.filter_color = vray.Color(4, 4, 4);
    // Override the shape of the light.
    // Depending on the shape of the light some of the following properties have to be specified:
    //   ies_light_width - Light shape width in metres.
    //   ies_light_height - Light shape height in metres.
    //   ies_light_length - Light shape length in metres.
    //   ies_light_diameter - Light shape diameter in metres.
    // Possible values are:
    //  -1 (default shape from IES file) - default
    //   0 (Point)
    //   1 (Rectangular)
    //   2 (Circular)
    //   3 (Sphere)
    //   4 (Vertical Cylinder)
    //   5 (Horizontal cylinder oriented along lum.lenght)
    //   6 (Horizontal cylinder oriented along lum.width)
    //   7 (Ellipse oriented along lum.lenght)
    //   8 (Ellipse oriented along lum.width)
    light.ies_light_shape = 0;
    // Specify shadow offset from the surface. Helps to prevent polygonal shadow artifacts on low-poly surfaces.
    light.shadowBias = 0.02;
    // Specify that the bumped normal should be used to check if the light direction is below the surface.
    light.bumped_below_surface_check = true;
    // Start rendering.
    renderer.start(function(err) {
        if (err) throw err;
        // Wait for rendering to end.
        renderer.waitForRenderEnd(function() {
            renderer.close();
        });
    });
});

Sonuç #


Bu render için kullanılan sahne “Lighting_IES.vrscene” olarak adlandırılır ve sahne paketinde bulunabilir   (içinde bulunan farklı parametrelere ilişkin yorumlar mevcuttur).

Bunu yerel olarak test etmek için, dahil edilen sahnede bulunan IES profiline giden mutlak yolu değiştirmeniz gerekecektir: “vrscenes/light_ies.vrscene”).

Tarafından desteklenmektedir BetterDocs

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir